handler: fix call to container_exec_cmd in handler_osds

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>
(cherry picked from commit 22865cde9c)
pull/4965/head
Guillaume Abrioux 2020-01-17 15:50:40 +01:00 committed by Dimitri Savineau
parent 8d311a537d
commit 1462423059
3 changed files with 18 additions and 0 deletions

View File

@ -6,6 +6,7 @@
- name: unset noup flag - name: unset noup flag
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup" command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
changed_when: False changed_when: False
# This does not just restart OSDs but everything else too. Unfortunately # This does not just restart OSDs but everything else too. Unfortunately

View File

@ -1,6 +1,14 @@
--- ---
- name: keyring related tasks - name: keyring related tasks
block: 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 - name: get keys from monitors
command: "{{ hostvars[groups.get(mon_group_name)[0]]['container_exec_cmd'] }} ceph --cluster {{ cluster }} auth get {{ item.name }}" command: "{{ hostvars[groups.get(mon_group_name)[0]]['container_exec_cmd'] }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
register: _rgw_keys register: _rgw_keys

View File

@ -3,6 +3,15 @@
set_fact: set_fact:
add_osd: "{{ groups[osd_group_name] | length != ansible_play_hosts_all | length }}" 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 - name: include_tasks system_tuning.yml
include_tasks: system_tuning.yml include_tasks: system_tuning.yml