Bug 1585967

Summary: Playbooks failed for rhel_subscribe task error
Product: OpenShift Container Platform Reporter: Gaoyun Pei <gpei>
Component: InstallerAssignee: Michael Gugino <mgugino>
Status: CLOSED ERRATA QA Contact: Gaoyun Pei <gpei>
Severity: high Docs Contact:
Priority: high    
Version: 3.10.0CC: anli, aos-bugs, jokerman, jupierce, mmccomas, qitang, wsun
Target Milestone: ---   
Target Release: 3.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-30 19:17:19 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 Gaoyun Pei 2018-06-05 08:30:55 UTC
Description of problem:
Run etcd redeploy-certificates playbook against an ocp-3.10 cluster.

ansible-playbook -i host/310 -v /usr/share/ansible/openshift-ansible/playbooks/openshift-etcd/redeploy-certificates.yml


It fails on non-etcd host in role rhel_subscribe as below:

PLAY [Setup yum repositories for all hosts] *********************************************************************************************************************************

TASK [rhel_subscribe : fail] ************************************************************************************************************************************************
skipping: [ec2-52-90-247-129.compute-1.amazonaws.com] => {"changed": false, "skip_reason": "Conditional result was False", "skipped": true}
fatal: [ec2-34-207-246-134.compute-1.amazonaws.com]: FAILED! => {"failed": true, "msg": "The conditional check 'ansible_distribution == 'RedHat'' failed. The error was: error while evaluating conditional (ansible_distribution == 'RedHat'): 'ansible_distribution' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/rhel_subscribe/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- fail:\n  ^ here\n"}


Ansible inventory file and full log with "-v" could be found in attachment.



And the same error for some other cert redeployment playbook:

/usr/share/ansible/openshift-ansible/playbooks/openshift-etcd/redeploy-ca.yml
/usr/share/ansible/openshift-ansible/playbooks/openshift-hosted/redeploy-registry-certificates.yml
/usr/share/ansible/openshift-ansible/playbooks/openshift-hosted/redeploy-router-certificates.yml


Version-Release number of the following components:
openshift-ansible-3.10.0-0.58.0.git.0.d8f6377.el7.noarch


How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated

Expected results:

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 4 Gaoyun Pei 2018-06-06 07:52:36 UTC
With more standalone playbooks tested, found some more playbooks would fail at this task, so raise the Priority and Severity.

The following two playbooks would fail on non-master hosts.

/usr/share/ansible/openshift-ansible/playbooks/openshift-management/config.yml
/usr/share/ansible/openshift-ansible/playbooks/openshift-provisioners/config.yml


PLAY [Setup yum repositories for all hosts] *********************************************************************************************************************************

TASK [rhel_subscribe : fail] ************************************************************************************************************************************************
fatal: [ec2-52-90-131-235.compute-1.amazonaws.com]: FAILED! => {"failed": true, "msg": "The conditional check 'ansible_distribution == 'RedHat'' failed. The error was: error while evaluating conditional (ansible_distribution == 'RedHat'): 'ansible_distribution' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/rhel_subscribe/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- fail:\n  ^ here\n"}
skipping: [ec2-34-239-183-87.compute-1.amazonaws.com] => {"changed": false, "skip_reason": "Conditional result was False", "skipped": true}
fatal: [ec2-34-230-8-200.compute-1.amazonaws.com]: FAILED! => {"failed": true, "msg": "The conditional check 'ansible_distribution == 'RedHat'' failed. The error was: error while evaluating conditional (ansible_distribution == 'RedHat'): 'ansible_distribution' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/rhel_subscribe/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- fail:\n  ^ here\n"}

Comment 5 Scott Dodson 2018-06-06 15:09:28 UTC
*** Bug 1585593 has been marked as a duplicate of this bug. ***

Comment 6 Michael Gugino 2018-06-06 15:28:22 UTC
PR Created: https://github.com/openshift/openshift-ansible/pull/8655

Comment 7 Scott Dodson 2018-06-06 15:44:41 UTC
*** Bug 1588091 has been marked as a duplicate of this bug. ***

Comment 8 Wei Sun 2018-06-08 01:56:47 UTC
The PR has been merged to openshift-ansible-3.10.0-0.64.0,please check

Comment 9 Gaoyun Pei 2018-06-08 08:34:52 UTC
Tried the above playbooks with openshift-ansible-3.10.0-0.64.0.git.20.48df973.el7.noarch. The step is skipped.

PLAY [Setup yum repositories for all hosts] *********************************************************************************************************************************
skipping: no hosts matched

Comment 12 errata-xmlrpc 2018-07-30 19:17:19 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-2018:1816