]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
facts: enforce container_exec_cmd fact on mons
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 11 Aug 2020 12:00:36 +0000 (14:00 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 19 Aug 2020 16:30:23 +0000 (18:30 +0200)
when running the playbook with `--limit` option, if for some reason
handlers get triggered, it will fail because `container_exec_cmd` isn't
set on monitors.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-facts/tasks/facts.yml

index 2dcd351317137b7427c02a1144662619d5e52003..602daa1cebdb3fc7be31d272e442c286644a0017 100644 (file)
     - name: set_fact container_exec_cmd
       set_fact:
         container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] if not rolling_update else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}"
+      delegate_to: "{{ item }}"
+      delegate_facts: True
+      run_once: True
+      with_items: "{{ groups.get(mon_group_name, []) }}"
       when:
         - containerized_deployment | bool