mon/client: honor key mode when copying it to other nodes

The last mon creates the keys with a particular mode, while copying them
to the other mons (first and second) we must re-use the mode that was
set.

The same applies for the client node, the slurp preserves the initial
'item' so we can get the mode for the copy.

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/2532/head v3.1.0beta8
Sébastien Han 2018-04-23 10:02:16 +02:00 committed by Guillaume Abrioux
parent 71efa2eaf4
commit 12eebc31fb
2 changed files with 6 additions and 0 deletions

View File

@ -92,6 +92,9 @@
copy:
dest: "{{ item.source }}"
content: "{{ item.content | b64decode }}"
mode: "{{ item.item.mode }}"
owner: "{{ ceph_uid }}"
group: "{{ ceph_uid }}"
with_items:
- "{{ slurp_client_keys.results }}"
when:

View File

@ -44,6 +44,9 @@
copy:
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.{{ item.1.name }}.keyring"
dest: "/etc/ceph/{{ cluster }}.{{ item.1.name }}.keyring"
owner: "{{ ceph_uid }}"
group: "{{ ceph_uid }}"
mode: "{{ item.1.mode|default(omit) }}"
with_nested:
- "{{ groups[mon_group_name] }}"
- "{{ openstack_keys }}"