Description of problem: My Customer is reporting the following: "we don't always have an oo_master group when we are running the plays, playbooks/init/cluster_facts.yml shouldn't error out." We suspect the new 'Gather master facts' task should have a check for the existence of the oo_masters group. https://github.com/openshift/openshift-ansible/compare/openshift-ansible-3.11.317-1...openshift-ansible-3.11.318-1#diff-f7299f83c4344765f127597a90ab3ddcbcd76b9bbbaf9ce095cc1644d4f01d0a Without it I get this error when building a base image for a node : [0;32m amazon-ebs: fatal: [xxx.xxx.xxx.xxx]: FAILED! => {"msg": "The conditional check 'inventory_hostname in groups['oo_masters']' failed. The error was: error while evaluating conditional (inventory_hostname in groups['oo_masters']): Unable to look up a name or access an attribute in template string ({% if inventory_hostname in groups['oo_masters'] %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': argument of type 'AnsibleUndefined' is not iterable\n\nThe error appears to be in '/home/jenkins_slave/openshift-ansible/playbooks/init/cluster_facts.yml': line 42, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Gather Master facts\n ^ here\n"}[0m There's a step earlier in the same play that looks like it checks if a group exists at all, Gather Master facts maybe needs a when condition like this one? # oo_first_master group might not be present due to provisioning plays # for existing clusters, openshift_portal_net will be force-set by # basic_facts.yml from value in existing master configs. - name: set_fact openshift_portal_net if present on masters set_fact: openshift_portal_net: "{{ hostvars[groups.oo_first_master.0].openshift_portal_net }}" when: - "'oo_first_master' in groups" - "groups.oo_first_master | length > 0" - "'openshift_portal_net' in hostvars[groups.oo_first_master.0]" Version-Release number of selected component (if applicable): OCP 3.11.318 How reproducible: 100% Steps to Reproduce: 1. 2. 3. Actual results: The play errors with: [0;32m amazon-ebs: fatal: [xxx.xxx.xxx.xxx]: FAILED! => {"msg": "The conditional check 'inventory_hostname in groups['oo_masters']' failed. The error was: error while evaluating conditional (inventory_hostname in groups['oo_masters']): Unable to look up a name or access an attribute in template string ({% if inventory_hostname in groups['oo_masters'] %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': argument of type 'AnsibleUndefined' is not iterable\n\nThe error appears to be in '/home/jenkins_slave/openshift-ansible/playbooks/init/cluster_facts.yml': line 42, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Gather Master facts\n ^ here\n"}[0m Expected results: Complete without errors Additional info:
andbartl This is not related to the Assisted-Installer component, and I'm not sure to what component it should be moved.
Any time the openshift-ansible playbooks are run, the inventory should be an accurate representation of the cluster being built. That aside, there have been use cases built over the years where that is not always the case but things still worked. This particular issue has already been fixed because it was identified in a CI job that also runs installer components out of order. https://github.com/openshift/openshift-ansible/pull/12270 In build: openshift-ansible-3.11.319-1
Verified this bug with openshift-ansible-3.11.321-1.git.0.a6d3b1c.el7.noarch.rpm. Fresh install completed successfully, no regression issue found.
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 (Moderate: OpenShift Container Platform 3.11.343 security and bug fix update), 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/RHSA-2020:5363