From f74983089728a27f3dc806408ccc523ade06c5d4 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 15 May 2018 12:20:08 +0200 Subject: [PATCH] mon: refactor of mgr key fetching There is no need to stat for created mgr keyrings since they are created anyway when deploying a ceph cluster > jewel. In case of a jewel deployment we won't enter that block. Signed-off-by: Guillaume Abrioux --- roles/ceph-mon/tasks/docker/main.yml | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index 1e84410b3..88273f42a 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -106,27 +106,16 @@ - not containerized_deployment_with_kv with_items: "{{ groups.get(mgr_group_name, []) }}" - - name: stat for ceph mgr key(s) - stat: - path: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring" - with_items: "{{ groups.get(mgr_group_name, []) }}" - changed_when: false - become: false - failed_when: false - register: stat_mgr_keys - check_mode: no + - name: fetch ceph mgr key(s) + fetch: + src: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring" + dest: "{{ fetch_directory }}/{{ fsid }}/{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring" + flat: yes + with_items: + - "{{ groups.get(mgr_group_name, []) }}" when: - "{{ groups.get(mgr_group_name, []) | length > 0 }}" - - name: fetch ceph mgr key(s) - fetch: - src: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item.item]['ansible_hostname'] }}.keyring" - dest: "{{ fetch_directory }}/{{ fsid }}/{{ item.stat.path }}" - flat: yes - with_items: - - "{{ stat_mgr_keys.results }}" - when: - - item.stat.exists == true when: - not rolling_update - inventory_hostname == groups[mon_group_name]|last