main playbook: final play refactor

we can simply run this play on the first monitor rather than delegating
to it.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
pull/7474/head
Guillaume Abrioux 2023-08-04 09:55:23 +02:00
parent 58758bca28
commit 08d80633f4
1 changed files with 2 additions and 6 deletions

View File

@ -542,7 +542,7 @@
status: "Complete"
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
- hosts: mons
- hosts: mons[0]
gather_facts: false
become: True
any_errors_fatal: true
@ -561,15 +561,11 @@
- name: get ceph status from the first monitor
command: >
{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} -s
{{ container_binary }} exec ceph-mon-{{ hostvars[inventory_hostname]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} -s
register: ceph_status
changed_when: false
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
- name: "show ceph status for cluster {{ cluster }}"
debug:
msg: "{{ ceph_status.stdout_lines }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
run_once: true
when: not ceph_status.failed