Red Hat Bugzilla – Bug 1580256
Failed to build AMI because clusterid is not set
Last modified: 2018-10-11 03:20:21 EDT
Description of problem: Failed to build AMI because clusterid is not set Version-Release number of the following components: openshift-ansible-3.10.0-0.46.0.git.0.85c3afd.el7 How reproducible: 100% Steps to Reproduce: 1. Follow document(https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws) to build an AMI. 2. Set openshift_cloudprovider_kind to aws in inventory.yml as example(https://github.com/openshift/openshift-ansible/blob/master/playbooks/aws/provisioning-inventory.example.ini) 3. Execute build_ami playbook as step 1(https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws#step-1): # ansible-playbook -i inventory.yml build_ami.yml -e @provisioning_vars.yml cat inventory.yml ... openshift_cloudprovider_kind=aws ... Actual results: # ansible-playbook -i inventory.yml /usr/share/ansible/openshift-ansible/playbooks/aws/openshift-cluster/build_ami.yml -e @provisioning_vars.yml -vvv ... TASK [openshift_sanitize_inventory : Ensure clusterid is set along with the cloudprovider] *************************************************************************************************** task path: /usr/share/ansible/openshift-ansible/roles/openshift_sanitize_inventory/tasks/main.yml:35 Monday 21 May 2018 01:49:24 -0400 (0:00:00.019) 0:01:14.638 ************ fatal: [ec2-xx-xx-xx-xx.compute-1.amazonaws.com]: FAILED! => { "changed": false, "failed": true, "msg": "Ensure that the openshift_clusterid is set and that all infrastructure has the required tags.\nFor dynamic provisioning when using multiple clusters in different zones, tag each node with Key=kubernetes.io/cluster/xxxx,Value=clusterid where xxxx and clusterid are unique per cluster. In versions prior to 3.6, this was Key=KubernetesCluster,Value=clusterid.\nhttps://github.com/openshift/openshift-docs/blob/master/install_config/persistent_storage/dynamically_provisioning_pvs.adoc#available-dynamically-provisioned-plug-ins\n" } PLAY RECAP *********************************************************************************************************************************************************************************** ec2-xx-xx-xx-xx.compute-1.amazonaws.com : ok=13 changed=0 unreachable=0 failed=1 localhost : ok=14 changed=2 unreachable=0 failed=0 Expected results: AWS provisioning related playbook should ensure that the openshift_clusterid is set and that all infrastructure has the required tags. Additional info:
1. Test result: Failed 2. Environment: #git describe openshift-ansible-3.11.0-0.11.0-106-gc01e5ef 3. Analysis: 1) find all references from the repo, with command: # grep -r openshift_clusterid 2) I can't find any code to define the variable of openshift_clusterid 3) but, when i reading this tip from the error message,I think this variable, openshift_clusterid, must be set with the cloudprovider. But we don't have a document to declare it, then will lead the customers to the wrong place. https://github.com/openshift/openshift-ansible/blob/master/roles/openshift_sanitize_inventory/tasks/main.yml#L35
The correct key is called openshift_aws_clusterid. Please make sure the key and value exist in your extra_vars file.
I ask my companion,he says that the 'clusterid', in title, it comes from the output message of ansible play-book: TASK [openshift_sanitize_inventory : Ensure clusterid is set along with the cloudprovider] So it's clear now. He filed this bug, because the word 'clusterid', in that ansible message, is confusing, and there is no sentence to declare: what is 'clusterid', in this document: https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws So, please, update the document to clarify the openshift_clusterid. Thanks!
openshift_clusterid added to README example https://github.com/openshift/openshift-ansible/pull/9635
fixed at: openshift-ansible-3.11.0-0.19.0-2-g0e60053
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:2652