Bug 1662730

Summary: While running playbook to check certificate expiry, it is failing with error- "'openshift_is_atomic' is undefined"
Product: OpenShift Container Platform Reporter: Niket Chavan <nchavan>
Component: InstallerAssignee: Scott Dodson <sdodson>
Installer sub component: openshift-ansible QA Contact: Gaoyun Pei <gpei>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: adeshpan, mirollin
Version: 3.10.0Keywords: Reopened
Target Milestone: ---   
Target Release: 3.10.z   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
An undefined variable error on 'openshift_is_atomic' has been corrected in the certificate expiry check playbooks.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-14 02:15:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1655183    
Bug Blocks:    

Description Niket Chavan 2019-01-01 07:23:04 UTC
Description of problem:

While running the playbook to check certificate expiry, the ~/playbooks/openshift-checks/certificate_expiry/default.yaml  playbook is failing with error;
"msg": "The conditional check 'not openshift_is_atomic | bool' failed. The error was: error while evaluating conditional (not openshift_is_atomic | bool): 'openshift_is_atomic' is undefined

Below is the verbose output while running the playbook;

~]# ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/openshift-checks/certificate_expiry/default.yaml -vvv
ansible-playbook 2.4.6.0
  config file = /home/nchavan/ocp3.10/ansible.cfg
  configured module search path = [u'/root/.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-playbook
  python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Using /home/nchavan/ocp3.10/ansible.cfg as config file
[DEPRECATION WARNING]: DEFAULT_SUDO_USER option, In favor of become which is a generic framework . This feature will be removed in version 2.8. Deprecation 
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
Parsed /home/nchavan/ocp3.10/inventory inventory source with ini plugin

PLAYBOOK: default.yaml ***************************************************************************************************************************************
1 plays in /usr/share/ansible/openshift-ansible/playbooks/openshift-checks/certificate_expiry/default.yaml

PLAY [Check cert expirys] ************************************************************************************************************************************
META: ran handlers

TASK [openshift_certificate_expiry : Ensure python dateutil library is present] ******************************************************************************
task path: /usr/share/ansible/openshift-ansible/roles/openshift_certificate_expiry/tasks/main.yml:2
fatal: [master1.example.com]: FAILED! => {
    "failed": true, 
    "msg": "The conditional check 'not openshift_is_atomic | bool' failed. The error was: error while evaluating conditional (not openshift_is_atomic | bool): 'openshift_is_atomic' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_certificate_expiry/tasks/main.yml': line 2, 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: Ensure python dateutil library is present\n  ^ here\n"
}



Version-Release number of selected component (if applicable):

~]# rpm -q openshift-ansible
openshift-ansible-3.10.83-1.git.0.12699eb.el7.noarch
~]# 

~]# oc version
oc v3.10.83
kubernetes v1.10.0+b81c8f8
features: Basic-Auth GSSAPI Kerberos SPNEGO
~]#


~]# ansible --version
ansible 2.4.6.0
  config file = /home/nchavan/ocp3.10/ansible.cfg
  configured module search path = [u'/root/.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, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
~]# 



Steps to Reproduce:
1.  Just run the playbook for checking the certificate expiration - /usr/share/ansible/openshift-ansible/playbooks/openshift-checks/certificate_expiry/default.yaml  , it will fail immediately with above mentioned error. 


Actual results:
The playbook is failing with error;
"msg": "The conditional check 'not openshift_is_atomic | bool' failed. The error was: error while evaluating conditional (not openshift_is_atomic | bool): 'openshift_is_atomic' is undefined


Expected results:
The playbook should run without errors.


Additional info:

Few bugzillas found with same error but while executing different playbooks and/or performing different functions;

https://bugzilla.redhat.com/show_bug.cgi?id=1581388
https://bugzilla.redhat.com/show_bug.cgi?id=1582190
https://bugzilla.redhat.com/show_bug.cgi?id=1624284

Comment 1 Scott Dodson 2019-01-03 14:42:55 UTC

*** This bug has been marked as a duplicate of bug 1655183 ***

Comment 2 Scott Dodson 2019-02-12 20:12:08 UTC
This was fixed in 3.10 via https://github.com/openshift/openshift-ansible/pull/11049/commits which is merged into openshift-ansible-3.10.106-1

Comment 3 Gaoyun Pei 2019-02-13 07:48:39 UTC
QE could reproduce this issue with openshift-ansible-3.10.101-1.git.0.5f32198.el7.noarch.rpm

Fixed on openshift-ansible-3.10.113-1.git.0.7534c41.el7.noarch.rpm, no such error happened.

Comment 5 errata-xmlrpc 2019-03-14 02:15:34 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, 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:0405