Bug 1348846

Summary: Ansible installer failed to install due to the error "One or more undefined variables: 'dict object' has no attribute 'etcd_hostname'""
Product: OpenShift Container Platform Reporter: Kenjiro Nakayama <knakayam>
Component: InstallerAssignee: Andrew Butcher <abutcher>
Status: CLOSED ERRATA QA Contact: Gaoyun Pei <gpei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, gpei, jokerman, mmccomas, vlaad
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-ansible-3.2.9-1.git.0.4f15c01.el7 Doc Type: If docs needed, set a value
Doc Text:
Previously, PyYAML installation may have failed early during the installation process preventing subsequent installation steps from functioning properly. This failure has now been marked as fatal ensuring that no additional steps are performed on hosts where PyYAML failed to install.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-06 14:53:24 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:
Attachments:
Description Flags
ansible installation log with -vvv
none
/etc/ansible/hosts none

Description Kenjiro Nakayama 2016-06-22 08:22:23 UTC
Description of problem:
===

- OSE 3.2 installation stops installation due to the error "One or more undefined variables: 'dict object' has no attribute 'etcd_hostname'"

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

env
===

[root@knakayam-ose32-master1 ~]# rpm -qa |grep ansible
openshift-ansible-3.0.94-1.git.0.67a822a.el7.noarch
openshift-ansible-playbooks-3.0.94-1.git.0.67a822a.el7.noarch
openshift-ansible-docs-3.0.94-1.git.0.67a822a.el7.noarch
openshift-ansible-filter-plugins-3.0.94-1.git.0.67a822a.el7.noarch
openshift-ansible-roles-3.0.94-1.git.0.67a822a.el7.noarch
ansible-1.9.4-1.el7aos.noarch
openshift-ansible-lookup-plugins-3.0.94-1.git.0.67a822a.el7.noarch

_NOTE_ I installed OSE3.2 without this issue before, but in this time I hit this issue.

How reproducible:


Steps to Reproduce:
1.  Run ansible installer ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/byo/config.yml -vvv |tee ansible.log

Actual results:

TASK: [etcd | Write etcd global config file] ********************************** 
<knakayam-ose32-master1.example.com> ESTABLISH CONNECTION FOR USER: root
<knakayam-ose32-master1.example.com> EXEC ssh -C -tt -v -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 knakayam-ose32-master1.example.com /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1466581059.4-119863494368818 && echo $HOME/.ansible/tmp/ansible-tmp-1466581059.4-119863494368818'
fatal: [knakayam-ose32-master1.example.com] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'dict object' has no attribute 'etcd_hostname'", 'failed': True}
fatal: [knakayam-ose32-master1.example.com] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'dict object' has no attribute 'etcd_hostname'", 'failed': True}

Expected results:

Install without any error

Additional info:

/etc/ansilbe/hosts and full ansible log are attached

Comment 1 Kenjiro Nakayama 2016-06-22 08:25:01 UTC
Created attachment 1170627 [details]
ansible installation log with -vvv

Comment 2 Kenjiro Nakayama 2016-06-22 08:25:28 UTC
Created attachment 1170628 [details]
/etc/ansible/hosts

Comment 3 Andrew Butcher 2016-06-28 20:28:10 UTC
Earlier in playbook execution, knakayam-ose32-master2.example.com failed to install PyYAML which caused subsequent tasks for the host to be skipped including setting etcd_hostname.

failed: [knakayam-ose32-master2.example.com] => {"changed": false, "failed": true, "rc": 0, "results": []}
msg: No Package matching 'PyYAML' found available, installed or updated

Comment 4 Andrew Butcher 2016-06-28 21:14:55 UTC
Proposed fix ensures that if there were any errors setting facts for etcd hosts the install would fail immediately rather than continue.

https://github.com/openshift/openshift-ansible/pull/2094

Comment 7 Gaoyun Pei 2016-06-30 07:55:50 UTC
Since PR https://github.com/openshift/openshift-ansible/pull/2094 is not included in openshift-ansible-3.2.8-1.git.0.211fa3f.el7, move this bug to ASSIGNED.

Comment 8 Scott Dodson 2016-06-30 13:54:46 UTC
https://github.com/openshift/openshift-ansible/pull/2107 for enterprise-3.2 branch

Comment 10 Gaoyun Pei 2016-07-04 02:18:14 UTC
PR https://github.com/openshift/openshift-ansible/pull/2107 has been merged into openshift-ansible-3.2.9-1.git.0.4f15c01.el7.noarch, move this bug to verified according to Comment 6

Comment 12 errata-xmlrpc 2016-07-06 14:53:24 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-2016:1386