]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
main playbook: final play refactor
authorGuillaume Abrioux <gabrioux@ibm.com>
Fri, 4 Aug 2023 07:55:23 +0000 (09:55 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Wed, 14 Feb 2024 08:54:13 +0000 (09:54 +0100)
we can simply run this play on the first monitor rather than delegating
to it.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
site-container.yml.sample

index 4f67ff3cd7076fb0285df02b51a55543e102a0b0..b100262634dad667593dc0b5178e04fdd5d72c0c 100644 (file)
             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
 
     - 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