]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
facts: always set `docker_exec_cmd` stable-3.2 v3.2.59
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 4 Apr 2022 13:09:51 +0000 (15:09 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 5 Apr 2022 11:38:27 +0000 (13:38 +0200)
This ensures `docker_exec_cmd` is always set on the first monitor.
Otherwise, when running the playbook with `--limit`, it fails on tasks
calling `docker_exec_cmd` with a delegate_to on the first monitor since
it was not set.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2071676
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-facts/tasks/facts.yml
roles/ceph-osd/tasks/main.yml

index 0cb638b2f9e8fc178269b44bf03696bbe11f7152..8c367ba8f9a0ca53c1c254154ff65f3cead61bfe 100644 (file)
@@ -24,6 +24,8 @@
   set_fact:
     docker_exec_cmd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
+  delegate_facts: true
+  run_once: true
   when:
     - containerized_deployment
     - groups.get(mon_group_name, []) | length > 0
index 99fadec16303e7c6bf0499ebf158fc159480b237..9c0ee671659c1295175839198b4180a0f09d9586 100644 (file)
@@ -36,7 +36,7 @@
   include_tasks: common.yml
 
 - name: set noup flag
-  command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set noup"
+  command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd set noup"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: True
   changed_when: False
@@ -99,7 +99,7 @@
   include_tasks: start_osds.yml
 
 - name: unset noup flag
-  command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
+  command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd unset noup"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   changed_when: False
   when: