]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
handler: fix call to container_exec_cmd in handler_osds
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 17 Jan 2020 14:50:40 +0000 (15:50 +0100)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Mon, 20 Jan 2020 14:25:56 +0000 (09:25 -0500)
When unsetting the noup flag, we must call container_exec_cmd from the
delegated node (first mon member)
Also, adding a `run_once: true` because this task needs to be run only 1
time.

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

index 390b84b2ceb1b0b272769b7a16344a49982bdc37..c5fce6c5c805578f202bca5b4869cf4fdd89219e 100644 (file)
@@ -6,6 +6,7 @@
 - name: unset noup flag
   command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
   delegate_to: "{{ groups[mon_group_name][0] }}"
+  run_once: true
   changed_when: False
 
 # This does not just restart OSDs but everything else too. Unfortunately
index 8112a8e2139cbc3c16443196efba540305aa0d30..aaff416fceadf3a045840e2e6c920f696192a004 100644 (file)
@@ -1,6 +1,14 @@
 ---
 - name: keyring related tasks
   block:
+    - name: set_fact container_exec_cmd
+      set_fact:
+        container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
+      with_items: "{{ groups.get(mon_group_name, []) }}"
+      delegate_to: "{{ item }}"
+      delegate_facts: true
+      run_once: true
+
     - name: get keys from monitors
       command: "{{ hostvars[groups.get(mon_group_name)[0]]['container_exec_cmd'] }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
       register: _rgw_keys
index 79ac50fcebf7c2b3aac78a4162610eacfba58f1f..d62944526b4388f7222d81220a3a3c695c793993 100644 (file)
@@ -3,6 +3,15 @@
   set_fact:
     add_osd: "{{ groups[osd_group_name] | length != ansible_play_hosts_all | length }}"
 
+- name: set_fact container_exec_cmd
+  set_fact:
+    container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[item]['ansible_hostname'] }}"
+  with_items: "{{ groups.get(mon_group_name, []) }}"
+  delegate_to: "{{ item }}"
+  delegate_facts: true
+  run_once: true
+  when: containerized_deployment | bool
+
 - name: include_tasks system_tuning.yml
   include_tasks: system_tuning.yml