Skip to content

Commit

Permalink
crash: fix --limit deployments (containers)
Browse files Browse the repository at this point in the history
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 10ed26f)
  • Loading branch information
guits committed May 26, 2021
1 parent a391dad commit d2bd096
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions roles/ceph-crash/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
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
Expand Down

0 comments on commit d2bd096

Please sign in to comment.