mgr: improve mgr keyring creation

Delegating on remote node isn't necessary here since we are already
iterating over the right nodes.

Closes: #4518

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 161170524d)
pull/4597/head
Guillaume Abrioux 2019-10-10 21:25:10 +02:00 committed by Dimitri Savineau
parent 9c0547068e
commit 5568692340
1 changed files with 1 additions and 3 deletions

View File

@ -51,7 +51,7 @@
- name: set_fact _mgr_keys
set_fact:
_mgr_keys: "{{ _mgr_keys | default([{ 'name': 'client.admin', 'path': '/etc/ceph/' + cluster + '.client.admin.keyring', 'copy_key': copy_admin_key, 'hostname': hostvars[item]['ansible_hostname'] }]) + [{ 'name': 'mgr.' + hostvars[item]['ansible_hostname'], 'path': '/var/lib/ceph/mgr/' + cluster + '-' + hostvars[item]['ansible_hostname'] + '/keyring', 'copy_key': true, 'hostname': hostvars[item]['ansible_hostname'] }] }}"
_mgr_keys: "{{ _mgr_keys | default([{ 'name': 'client.admin', 'path': '/etc/ceph/' + cluster + '.client.admin.keyring', 'copy_key': copy_admin_key }]) + [{ 'name': 'mgr.' + hostvars[item]['ansible_hostname'], 'path': '/var/lib/ceph/mgr/' + cluster + '-' + hostvars[item]['ansible_hostname'] + '/keyring', 'copy_key': true }] }}"
with_items: "{{ groups.get(mgr_group_name, []) }}"
- name: get keys from monitors
@ -72,8 +72,6 @@
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
mode: "{{ ceph_keyring_permissions }}"
with_items: "{{ _mgr_keys.results }}"
delegate_to: "{{ item.item.hostname }}"
run_once: true
when:
- cephx | bool
- item.item.copy_key | bool