Bug 1874530 - Running openshift_node_group.yml to scaleup a node fails with "The error was: 'openshift_is_atomic' is undefined"
Summary: Running openshift_node_group.yml to scaleup a node fails with "The error was:...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.11.0
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: ---
: 3.11.z
Assignee: Russell Teague
QA Contact: Gaoyun Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-01 14:44 UTC by Joel Rosental R.
Modified: 2023-12-15 19:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The first master was not getting the openshift_is_atomic var set during playbook initialization. Consequence: When a later playbook task used the missing fact to set the client binary fact it would fail on undefined. Fix: Changed the fact setting to include all masters instead of just new masters during scaleup. Result: Facts are set as expected and playbook completes.
Clone Of:
Environment:
Last Closed: 2020-09-16 07:46:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift openshift-ansible pull 12224 0 None closed Bug 1874530: release-3.11: Gather initialization facts for all masters 2021-01-15 00:30:30 UTC
Red Hat Product Errata RHBA-2020:3695 0 None None None 2020-09-16 07:46:59 UTC

Description Joel Rosental R. 2020-09-01 14:44:32 UTC
Description of problem:
While running the /usr/share/ansible/openshift-ansible/playbooks/openshift-master/openshift_node_group.yml playbook as part of the procedure to scale up a new node in an OCP 3.11 as stated in https://docs.openshift.com/container-platform/3.11/install_config/adding_hosts_to_existing_cluster.html#adding-cluster-hosts_adding-hosts-to-cluster the playbook fails with the following error:

fatal: [openshift-master-prod01.xyz]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'openshift_is_atomic' is undefined\n\nThe error appears to be in '/usr/share/ansible/openshift-ansible/play
books/init/basic_facts.yml': line 102, 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  - set_fact:\n    ^ here\
n"


Version-Release number of the following components:
$ rpm -q openshift-ansible
openshift-ansible-3.11.248-1.git.0.fd212c7.el7.noarch

$ rpm -q ansible
ansible-2.9.11-1.el7ae.noarch


How reproducible:

Always 

Steps to Reproduce:
1. ansible-playbook -i /patht/to/inventory /usr/share/ansible/openshift-ansible/playbooks/openshift-master/openshift_node_group.yml


Actual results:

fatal: [openshift-master-prod01.xyz]: FAILED! => {
    "msg": "The task includes an option with an undefined variable. The error was: 'openshift_is_atomic' is undefined\n\nThe error appears to be in '/usr/share/ansible/openshift-ansible/play
books/init/basic_facts.yml': line 102, 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  - set_fact:\n    ^ here\
n"

Expected results:

Playbook should finish successfully.

Additional info:
See attached inventory file with playbook execution log

Comment 4 Russell Teague 2020-09-01 19:33:18 UTC
Masters are not having facts set during initialization and therefore are failing on the 'openshift_is_atomic' var when attempting to set the 'openshift_client_binary' var.  Possible fix will be submitted shortly.

Comment 7 Gaoyun Pei 2020-09-09 06:35:02 UTC
Could reproduce this issue with openshift-ansible-3.11.248-1.git.0.fd212c7.el7.noarch.rpm

Add new_nodes/new_masters children group in inventory file.
[OSEv3:children]
masters
nodes
etcd
new_nodes
new_masters

[new_masters]
ec2-54-164-170-200.compute-1.amazonaws.com

[new_nodes]
ec2-54-164-170-200.compute-1.amazonaws.com openshift_node_group_name='node-config-master-crio'


Run playbooks/openshift-master/openshift_node_group.yml playbook, it failed as below:

TASK [set_fact] ****************************************************************
fatal: [ec2-54-152-77-223.compute-1.amazonaws.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openshift_is_atomic' is undefined\n\nThe error appears to have been in '/home/slave3/workspace/Run-Ansible-Playbooks-Nextge/private-openshift-ansible/playbooks/init/basic_facts.yml': line 102, 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  - set_fact:\n    ^ here\n"}


Tried again with openshift-ansible-3.11.284-1.git.0.6025b17.el7.noarch.rpm, passed.

PLAY [Initialize special first-master variables] *******************************

TASK [Gathering Facts] *********************************************************
ok: [ec2-54-152-77-223.compute-1.amazonaws.com]
TASK [set_fact] ****************************************************************
skipping: [ec2-54-152-77-223.compute-1.amazonaws.com] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [set_fact] ****************************************************************
ok: [ec2-54-152-77-223.compute-1.amazonaws.com] => {"ansible_facts": {"first_master_client_binary": "oc", "l_osm_default_node_selector": "node-role.kubernetes.io/compute=true", "openshift_client_binary": "oc"}, "changed": false}

Comment 9 errata-xmlrpc 2020-09-16 07:46:50 UTC
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 (OpenShift Container Platform 3.11.286 bug fix and enhancement 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/RHBA-2020:3695


Note You need to log in before you can comment on or make changes to this bug.