ceph-ansible inventory generation references undefined variable: 'dict object' has no attribute 'ansible_hostname'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Fix Released
|
High
|
John Fulton |
Bug Description
Scaling out a splitstack environment with blacklisted nodes fails while running External deployment step 1:
[root@undercloud-0 stack]# tail -30 /var/lib/
2018-10-03 15:07:29,090 p=23844 u=mistral | skipping: [controller-1] => {"changed": false, "skip_reason": "Conditional result was False"}
2018-10-03 15:07:29,122 p=23844 u=mistral | skipping: [controller-0] => {"changed": false, "skip_reason": "Conditional result was False"}
2018-10-03 15:07:29,217 p=23844 u=mistral | skipping: [ceph-1] => {"changed": false, "skip_reason": "Conditional result was False"}
2018-10-03 15:07:29,263 p=23844 u=mistral | skipping: [ceph-0] => {"changed": false, "skip_reason": "Conditional result was False"}
2018-10-03 15:07:29,282 p=23844 u=mistral | skipping: [ceph-2] => {"changed": false, "skip_reason": "Conditional result was False"}
2018-10-03 15:07:36,258 p=23844 u=mistral | changed: [compute-2] => {"changed": true, "cmd": ["ntpdate", "-u", "clock.
2018-10-03 15:07:36,269 p=23844 u=mistral | PLAY [External deployment step 1] *******
2018-10-03 15:07:36,294 p=23844 u=mistral | TASK [set blacklisted_
2018-10-03 15:07:36,294 p=23844 u=mistral | Wednesday 03 October 2018 15:07:36 -0400 (0:00:07.326) 0:11:31.487 *****
2018-10-03 15:07:36,346 p=23844 u=mistral | ok: [undercloud] => {"ansible_facts": {"blacklisted_
2018-10-03 15:07:36,367 p=23844 u=mistral | TASK [create ceph-ansible temp dirs] *******
2018-10-03 15:07:36,368 p=23844 u=mistral | Wednesday 03 October 2018 15:07:36 -0400 (0:00:00.073) 0:11:31.560 *****
2018-10-03 15:07:36,582 p=23844 u=mistral | ok: [undercloud] => (item=/
2018-10-03 15:07:36,758 p=23844 u=mistral | ok: [undercloud] => (item=/
2018-10-03 15:07:36,924 p=23844 u=mistral | ok: [undercloud] => (item=/
2018-10-03 15:07:36,944 p=23844 u=mistral | TASK [generate inventory] *******
2018-10-03 15:07:36,944 p=23844 u=mistral | Wednesday 03 October 2018 15:07:36 -0400 (0:00:00.576) 0:11:32.136 *****
2018-10-03 15:07:38,740 p=23844 u=mistral | fatal: [undercloud]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'ansible_
2018-10-03 15:07:38,740 p=23844 u=mistral | NO MORE HOSTS LEFT *******
2018-10-03 15:07:38,741 p=23844 u=mistral | PLAY RECAP *******
2018-10-03 15:07:38,741 p=23844 u=mistral | ceph-0 : ok=124 changed=29 unreachable=0 failed=0
2018-10-03 15:07:38,742 p=23844 u=mistral | ceph-1 : ok=124 changed=29 unreachable=0 failed=0
2018-10-03 15:07:38,742 p=23844 u=mistral | ceph-2 : ok=124 changed=29 unreachable=0 failed=0
2018-10-03 15:07:38,742 p=23844 u=mistral | compute-2 : ok=136 changed=59 unreachable=0 failed=0
2018-10-03 15:07:38,742 p=23844 u=mistral | controller-0 : ok=190 changed=33 unreachable=0 failed=0
2018-10-03 15:07:38,742 p=23844 u=mistral | controller-1 : ok=190 changed=33 unreachable=0 failed=0
2018-10-03 15:07:38,742 p=23844 u=mistral | controller-2 : ok=190 changed=33 unreachable=0 failed=0
2018-10-03 15:07:38,743 p=23844 u=mistral | undercloud : ok=4 changed=0 unreachable=0 failed=1
2018-10-03 15:07:38,743 p=23844 u=mistral | Wednesday 03 October 2018 15:07:38 -0400 (0:00:01.798) 0:11:33.935 *****
2018-10-03 15:07:38,743 p=23844 u=mistral | =======
Steps to Reproduce:
1. Deploy splitstack environment with 3 controller + 2 computes + 3 ceph nodes
2. create blacklist.yaml:
parameter_defaults:
DeploymentSer
- compute-0
- compute-1
3. Set ComputeDeployed
4. Run overcloud deploy command with blacklist.yaml:
openstack overcloud deploy \
--timeout 100 \
--templates /usr/share/
--libvirt-type kvm \
--overcloud-
--disable-
-r /home/stack/
-e /usr/share/
-e /usr/share/
-e /usr/share/
-e /home/stack/
-e /home/stack/
-e /home/stack/
-e /usr/share/
-e /home/stack/
-e /home/stack/
-e /home/stack/
-e /home/stack/
-e /home/stack/
-e /usr/share/
-e /usr/share/
-e /home/stack/
-e /home/stack/
-e /home/stack/
--log-file overcloud_
Looks like this embedded ansible in tripleo heat templates:
https:/ /github. com/openstack/ tripleo- heat-templates/ blob/stable/ rocky/docker/ services/ ceph-ansible/ ceph-base. yaml#L379- L399
needs to not access hostvars. raw_get( host)[' ansible_ hostname' ] unless that variable is set.