Description of problem: Running ansible-playbook --user openshift -i /usr/share/ansible/openshift-ansible/playbooks/openstack/inventory.py -i inventory /usr/share/ansible/openshift-ansible/playbooks/openstack/openshift-cluster/provision.yml fails with errors if you have RHN repos enabled in all.yml. This *might* be addressed in upstream pull request: https://github.com/openshift/openshift-ansible/pull/10460 and this downstream BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1618395 Version-Release number of the following components: rpm -q openshift-ansible openshift-ansible-3.11.22-1.git.1.c4bb7a6.el7.noarch rpm -q ansible ansible-2.5.10-1.el7ae.noarch ansible --version ansible 2.5.10 config file = /home/cloud-user/ansible.cfg configured module search path = [u'/home/cloud-user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible python version = 2.7.5 (default, May 31 2018, 09:41:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] How reproducible: Every time. Steps to Reproduce: 1. in all.yml, register for RHN: rhsub_user: <rhn_user> rhsub_pass: <rhn_pass> rhsub_pool: <rhn_pool> 2. Run provision.yml Actual results: fatal: [infra-node-0.openshift.example.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openshift_version' is undefined\n\nThe error appears to hav e been in '/usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/rhel_repos.yml': line 25, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offe nding line appears to be:\n\n\n- name: Enable RHEL repositories\n ^ here\n"} Expected results: openshift_version variable is set before rhel registration attempted. Additional info: Please attach logs from ansible-playbook with the -vvv flag You can workaround this issue by passing this variable from the command line or the inventory: ansible-playbook --user openshift -i /usr/share/ansible/openshift-ansible/playbooks/openstack/inventory.py -i inventory /usr/share/ansible/openshift-ansible/playbooks/openstack/openshift-cluster/provision.yml -e openshift_version=3.11
I believe you're right about the PR that would fix this. I don't have an openstack environment to verify this against so assigning over the openstack team in case they want to verify it before it goes to QE. release-3.11 backport https://github.com/openshift/openshift-ansible/pull/10504
*** Bug 1642331 has been marked as a duplicate of this bug. ***
Please help check if this bug could be verified,thanks!
OCP QE also hit such similar issue when running playbooks/prerequisites.yml with openshift-ansible-3.11.44-1.git.0.11d174e.el7.noarch, maybe need some more fix. Set the following value in inventory file: rhsub_ak=openshift-qe-stage rhsub_orgid=711497 rhsub_pool=8a99f9815fe7bf9701600822f2f23ec4 # ansible-playbook -i /tmp/qe-inventory-host-file /usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml -v <--snip--> TASK [openshift_repos : Enable RHEL repositories] ***************************************************************************************************************************************************************** fatal: [host-8-251-179.host.centralci.eng.rdu2.redhat.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openshift_version' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/rhel_repos.yml': line 25, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Enable RHEL repositories\n ^ here\n"} fatal: [host-8-245-235.host.centralci.eng.rdu2.redhat.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openshift_version' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/rhel_repos.yml': line 25, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Enable RHEL repositories\n ^ here\n"} fatal: [host-8-251-140.host.centralci.eng.rdu2.redhat.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openshift_version' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/rhel_repos.yml': line 25, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Enable RHEL repositories\n ^ here\n"}
From my testing https://github.com/openshift/openshift-ansible/pull/10742 should fix this on 3.11.
In openshift-ansible-3.11.55-1 and later
Verified on # rpm -qa|grep -i openshift openshift-ansible-playbooks-3.11.75-1.git.0.95e8e2a.el7.noarch openshift-ansible-3.11.75-1.git.0.95e8e2a.el7.noarch openshift-ansible-docs-3.11.75-1.git.0.95e8e2a.el7.noarch openshift-ansible-roles-3.11.75-1.git.0.95e8e2a.el7.noarch atomic-openshift-clients-3.11.75-1.git.0.eb59351.el7.x86_64 TASK [openshift_repos : Enable RHEL repositories] ****************************************************************************************************************************************************************************************************************************** task path: /usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/rhel_repos.yml:25 Wednesday 30 January 2019 08:15:03 +0000 (0:00:18.219) 0:04:29.104 ***** changed: [infra-node-0.wjiang-ocp.example.com] => {"attempts": 1, "changed": true, "cmd": ["subscription-manager", "repos", "--enable=rhel-7-server-rpms", "--enable=rhel-7-server-extras-rpms", "--enable=rhel-7-server-ose-3.11-rpms"], "delta": "0:00:13.284237", "end": "2019-01-30 03:15:14.392958", "rc": 0, "start": "2019-01-30 03:15:01.108721", "stderr": "", "stderr_lines": [], "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.\nRepository 'rhel-7-server-extras-rpms' is enabled for this system.\nRepository 'rhel-7-server-ose-3.11-rpms' is enabled for this system.", "stdout_lines": ["Repository 'rhel-7-server-rpms' is enabled for this system.", "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "Repository 'rhel-7-server-ose-3.11-rpms' is enabled for this system."]} changed: [master-0.wjiang-ocp.example.com] => {"attempts": 1, "changed": true, "cmd": ["subscription-manager", "repos", "--enable=rhel-7-server-rpms", "--enable=rhel-7-server-extras-rpms", "--enable=rhel-7-server-ose-3.11-rpms"], "delta": "0:00:13.950057", "end": "2019-01-30 03:15:15.291960", "rc": 0, "start": "2019-01-30 03:15:01.341903", "stderr": "", "stderr_lines": [], "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.\nRepository 'rhel-7-server-extras-rpms' is enabled for this system.\nRepository 'rhel-7-server-ose-3.11-rpms' is enabled for this system.", "stdout_lines": ["Repository 'rhel-7-server-rpms' is enabled for this system.", "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "Repository 'rhel-7-server-ose-3.11-rpms' is enabled for this system."]} changed: [master-1.wjiang-ocp.example.com] => {"attempts": 1, "changed": true, "cmd": ["subscription-manager", "repos", "--enable=rhel-7-server-rpms", "--enable=rhel-7-server-extras-rpms", "--enable=rhel-7-server-ose-3.11-rpms"], "delta": "0:00:14.028675", "end": "2019-01-30 03:15:15.465426", "rc": 0, "start": "2019-01-30 03:15:01.436751", "stderr": "", "stderr_lines": [], "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.\nRepository 'rhel-7-server-extras-rpms' is enabled for this system.\nRepository 'rhel-7-server-ose-3.11-rpms' is enabled for this system.", "stdout_lines": ["Repository 'rhel-7-server-rpms' is enabled for this system.", "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "Repository 'rhel-7-server-ose-3.11-rpms' is enabled for this system."]} changed: [app-node-0.wjiang-ocp.example.com] => {"attempts": 1, "changed": true, "cmd": ["subscription-manager", "repos", "--enable=rhel-7-server-rpms", "--enable=rhel-7-server-extras-rpms", "--enable=rhel-7-server-ose-3.11-rpms"], "delta": "0:00:14.052732", "end": "2019-01-30 03:15:15.568383", "rc": 0, "start": "2019-01-30 03:15:01.515651", "stderr": "", "stderr_lines": [], "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.\nRepository 'rhel-7-server-extras-rpms' is enabled for this system.\nRepository 'rhel-7-server-ose-3.11-rpms' is enabled for this system.", "stdout_lines": ["Repository 'rhel-7-server-rpms' is enabled for this system.", "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "Repository 'rhel-7-server-ose-3.11-rpms' is enabled for this system."]} changed: [lb-0.wjiang-ocp.example.com] => {"attempts": 1, "changed": true, "cmd": ["subscription-manager", "repos", "--enable=rhel-7-server-rpms", "--enable=rhel-7-server-extras-rpms", "--enable=rhel-7-server-ose-3.11-rpms"], "delta": "0:00:14.061713", "end": "2019-01-30 03:15:15.690699", "rc": 0, "start": "2019-01-30 03:15:01.628986", "stderr": "", "stderr_lines": [], "stdout": "Repository 'rhel-7-server-rpms' is enabled for this system.\nRepository 'rhel-7-server-extras-rpms' is enabled for this system.\nRepository 'rhel-7-server-ose-3.11-rpms' is enabled for this system.", "stdout_lines": ["Repository 'rhel-7-server-rpms' is enabled for this system.", "Repository 'rhel-7-server-extras-rpms' is enabled for this system.", "Repository 'rhel-7-server-ose-3.11-rpms' is enabled for this system."]} TASK [openshift_repos : include_tasks] ***************************************************************************************************************************************************************************************************************************************** task path: /usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/main.yaml:45 Wednesday 30 January 2019 08:15:18 +0000 (0:00:14.703) 0:04:43.807 ***** skipping: [master-0.wjiang-ocp.example.com] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [master-1.wjiang-ocp.example.com] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [app-node-0.wjiang-ocp.example.com] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [infra-node-0.wjiang-ocp.example.com] => {"changed": false, "skip_reason": "Conditional result was False"} skipping: [lb-0.wjiang-ocp.example.com] => {"changed": false, "skip_reason": "Conditional result was False"} TASK [openshift_repos : Ensure clean repo cache in the event repos have been changed manually] ********************************************************************************************************************************************************************************* task path: /usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/main.yaml:52 Wednesday 30 January 2019 08:15:18 +0000 (0:00:00.335) 0:04:44.143 ***** changed: [master-0.wjiang-ocp.example.com] => { "msg": "First run of openshift_repos" } changed: [master-1.wjiang-ocp.example.com] => { "msg": "First run of openshift_repos" } changed: [app-node-0.wjiang-ocp.example.com] => { "msg": "First run of openshift_repos" } changed: [infra-node-0.wjiang-ocp.example.com] => { "msg": "First run of openshift_repos" } changed: [lb-0.wjiang-ocp.example.com] => { "msg": "First run of openshift_repos" } TASK [openshift_repos : Record that openshift_repos already ran] *************************************************************************************************************************************************************************************************************** task path: /usr/share/ansible/openshift-ansible/roles/openshift_repos/tasks/main.yaml:58 Wednesday 30 January 2019 08:15:19 +0000 (0:00:00.456) 0:04:44.599 ***** ok: [master-0.wjiang-ocp.example.com] => {"ansible_facts": {"r_openshift_repos_has_run": true}, "changed": false} ok: [master-1.wjiang-ocp.example.com] => {"ansible_facts": {"r_openshift_repos_has_run": true}, "changed": false} ok: [app-node-0.wjiang-ocp.example.com] => {"ansible_facts": {"r_openshift_repos_has_run": true}, "changed": false} ok: [infra-node-0.wjiang-ocp.example.com] => {"ansible_facts": {"r_openshift_repos_has_run": true}, "changed": false} ok: [lb-0.wjiang-ocp.example.com] => {"ansible_facts": {"r_openshift_repos_has_run": true}, "changed": false}
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-2019:0326
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days