]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
crash: fix --limit deployments (containers) v4.0.56
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 25 May 2021 13:06:41 +0000 (15:06 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 26 May 2021 16:51:48 +0000 (18:51 +0200)
ceph-crash deployments is broken when ceph-ansible playbook is called
with --limit in containerized contexts since we don't set
`container_exec_cmd` on the first monitor.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1964835
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 10ed26f14dc38211d4c77cbeeeb681d215a351b7)

roles/ceph-crash/tasks/main.yml

index e2e0806ceaf36c994d506491055db17f54b6820d..97f126c71873b8ac62ae47a89a708c22b35f364f 100644 (file)
       delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
       run_once: True
 
+    - name: enforce container_binary on first monitor
+      import_role:
+        name: ceph-facts
+        tasks_from: container_binary.yml
+      delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
+      delegate_facts: true
+
+    - name: set_fact container_exec_cmd
+      set_fact:
+        container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] if not rolling_update | bool else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_facts']['hostname'] }}"
+      delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
+      delegate_facts: true
+      when:
+        - containerized_deployment | bool
+
     - name: get keys from monitors
       command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} auth get client.crash"
       register: _crash_keys