delegate_facts does not work with container connection plugin

Bug #1721912 reported by Logan V
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Won't Fix
High
Unassigned

Bug Description

http://logs.openstack.org/92/507092/2/check/gate-openstack-ansible-openstack-ansible-ceph-ubuntu-xenial/ce71081/console.html#_2017-10-06_00_51_31_111103

The delegate_facts that occurs here does not actually assign the facts to the ceph-mon container, because even though the fact is delegated to the container's inventory_hostname, you can see from the task output that it is being delegated to the container's ansible_host instead, so the facts are never mapped back to the inventory_hostname.

Revision history for this message
Logan V (loganv) wrote :

The facts seem to be stored in the host "{{ item }}" ... see the cache:

# ls -1 /etc/openstack_deploy/ansible_facts/\{\{\ item\ \}\}
/etc/openstack_deploy/ansible_facts/{{ item }}

^ this contains the facts collected by this delegate_facts task
https://github.com/openstack/openstack-ansible/blob/91dea65c3d52698003f11a92d4fb52e6e0d8a94b/playbooks/ceph-install.yml#L174-L183

Changed in openstack-ansible:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Jimmy McCrory (jimmy-mccrory) wrote :
Download full text (4.2 KiB)

I haven't been able to reproduce this. It seems to be working as expected after testing on an AIO.

Created a test playbook that would delegate from a glance hosts to all nova hosts:

---
- name: delegate test
  hosts: glance_all[0]
  gather_facts: no
  tasks:
    - name: gather facts from nova hosts
      setup:
      delegate_to: "{{item}}"
      delegate_facts: True
      with_items: "{{ groups['nova_all'] }}"

    - name: lookup addresses of nova hosts
      debug:
        msg: "{{ hostvars[item]['ansible_default_ipv4']['address'] }}"
      with_items: "{{ groups['nova_all'] }}"

---
PLAY [delegate test] ****************************************************************************************************************************************************************************************************************

TASK [gather facts from nova hosts] *************************************************************************************************************************************************************************************************
Thursday 12 October 2017 22:59:48 -0700 (0:00:00.072) 0:00:00.072 ******
ok: [aio1_glance_container-00ccb9df -> 172.29.237.71] => (item=aio1_nova_api_placement_container-3e578422)
ok: [aio1_glance_container-00ccb9df -> 172.29.237.206] => (item=aio1_nova_scheduler_container-58739fbc)
ok: [aio1_glance_container-00ccb9df -> 172.29.237.93] => (item=aio1_nova_conductor_container-3b70bff7)
ok: [aio1_glance_container-00ccb9df -> 172.29.236.100] => (item=aio1)
ok: [aio1_glance_container-00ccb9df -> 172.29.236.149] => (item=aio1_nova_console_container-08aca723)
ok: [aio1_glance_container-00ccb9df -> 172.29.236.154] => (item=aio1_nova_api_os_compute_container-6a8eb7e8)
ok: [aio1_glance_container-00ccb9df -> 172.29.236.235] => (item=aio1_nova_api_metadata_container-b23e815c)

TASK [lookup addresses of nova hosts] ***********************************************************************************************************************************************************************************************
Thursday 12 October 2017 22:59:52 -0700 (0:00:03.957) 0:00:04.029 ******
ok: [aio1_glance_container-00ccb9df] => (item=aio1_nova_api_placement_container-3e578422) => {
    "item": "aio1_nova_api_placement_container-3e578422",
    "msg": "10.255.255.84"
}
ok: [aio1_glance_container-00ccb9df] => (item=aio1_nova_scheduler_container-58739fbc) => {
    "item": "aio1_nova_scheduler_container-58739fbc",
    "msg": "10.255.255.204"
}
ok: [aio1_glance_container-00ccb9df] => (item=aio1_nova_conductor_container-3b70bff7) => {
    "item": "aio1_nova_conductor_container-3b70bff7",
    "msg": "10.255.255.27"
}
ok: [aio1_glance_container-00ccb9df] => (item=aio1) => {
    "item": "aio1",
    "msg": "192.168.1.32"
}
ok: [aio1_glance_container-00ccb9df] => (item=aio1_nova_console_container-08aca723) => {
    "item": "aio1_nova_console_container-08aca723",
    "msg": "10.255.255.26"
}
ok: [aio1_glance_container-00ccb9df] => (item=aio1_nova_api_os_compute_container-6a8eb7e8) => {
    "item": "aio1_nova_api_os_compute_container-6a8eb7e8",
    "msg": "10.255.255.54"
}
ok: [aio1_glance_container-00ccb9df] => (item=aio1_nova_api_m...

Read more...

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

I used the same playbook as jimmy, with the exception that I added gather_facts: yes.
Same result, no issue.

Revision history for this message
Logan V (loganv) wrote :

I was seeing it on Ocata. I wonder if we're missing a necessary backport. Let me do some more testing on various branches and see if I can get a useful repro instruction together :)

Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :

I tried in Ocata, same issue as Logan.

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Sorry, I guess that's pretty much stale, going to close this.

Changed in openstack-ansible:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.