Bug 1759835

Summary: "openshift-ansible/playbooks/redeploy-certificates.yml" fails with default "openshift_metrics_install_metrics" values
Product: OpenShift Container Platform Reporter: Pedro Amoedo <pamoedom>
Component: InstallerAssignee: Russell Teague <rteague>
Installer sub component: openshift-ansible QA Contact: Gaoyun Pei <gpei>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: aprajapa, jrosenta, rbost
Version: 3.11.0   
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: openshift_metrics_server_install had incomplet default value. Consequence: Redeploy certificates playbook would fail due to a missing value for openshift_metrics_server_install Fix: Update openshift_metrics_server_install defaults in all locations Result: Redeploy certificates playbook completes successfully, whether openshift-metrics is installed or not.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-18 14:52:10 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:

Description Pedro Amoedo 2019-10-09 08:53:01 UTC
Description of problem:

When running openshift-ansible/playbooks/redeploy-certificates.yml without setting values for "openshift_metrics_server_install" nor for "openshift_metrics_server_install", the playbook fails with the following error:

~~~
    "msg": "The conditional check 'openshift_metrics_server_install | bool' failed. The error was: error while evaluating conditional (openshift_metrics_server_install | bool): 'openshift_metrics_server_install' is undefined\n\nThe error appears to have been in '/home/quicklab/openshift-ansible/playbooks/metrics-server/private/redeploy-certificates.yml': line 13, 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: Create temp directory for all our templates\n    ^ here\n"
}
~~~

Version-Release number of the following components:

$ rpm -q openshift-ansible
openshift-ansible-3.11.146-1.git.0.fcedb45.el7.noarch

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

$ ansible --version
ansible 2.6.19
  config file = /home/quicklab/ansible.cfg
  configured module search path = [u'/home/quicklab/.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, Jun 11 2019, 14:33:56) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

How reproducible:

Steps to Reproduce:
1. Install latest 3.11.146 cluster with default metrics values (false)
2. Modify "openshift_master_cluster_public_hostname"
3. Run "openshift-ansible/playbooks/redeploy-certificates.yml"

Actual results:

TASK [Create temp directory for all our templates] *******************************************************************************************************************************************
task path: /home/quicklab/openshift-ansible/playbooks/metrics-server/private/redeploy-certificates.yml:13
fatal: [10.74.178.88]: FAILED! => {
    "msg": "The conditional check 'openshift_metrics_server_install | bool' failed. The error was: error while evaluating conditional (openshift_metrics_server_install | bool): 'openshift_metrics_server_install' is undefined\n\nThe error appears to have been in '/home/quicklab/openshift-ansible/playbooks/metrics-server/private/redeploy-certificates.yml': line 13, 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: Create temp directory for all our templates\n    ^ here\n"
}

Expected results:

The workaround is to just set the following variables within the inventory or to pass them to the ansible-playbook command with "-e"

openshift_metrics_install_metrics=false
openshift_metrics_server_install=false (this second variable also fails when the first is fixed)

Additional info:

Verbose ansible-playbook (-vvv) logs are also attached.

Comment 4 Gaoyun Pei 2019-11-06 10:01:20 UTC
Could reproduce this issue with openshift-ansible-3.11.146-1.git.0.fcedb45.el7.noarch.rpm

TASK [Create temp directory for all our templates] *****************************
fatal: [ci-vm-10-0-149-71.hosted.upshift.rdu2.redhat.com]: FAILED! => {"msg": "The conditional check 'openshift_metrics_server_install | bool' failed. The error was: error while evaluating conditional (openshift_metrics_server_install | bool): 'openshift_metrics_server_install' is undefined\n\nThe error appears to have been in '/home/slave3/workspace/Run-Ansible-Playbooks-Nextge/private-openshift-ansible/playbooks/metrics-server/private/redeploy-certificates.yml': line 13, 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: Create temp directory for all our templates\n    ^ here\n"}

Verify this bug with using openshift-ansible-3.11.154-1.git.0.7a11cbe.el7.noarch.rpm, no such error happened.

Comment 6 errata-xmlrpc 2019-11-18 14:52:10 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:3817