From 12eebc31fbba5d4a6b18b977b3265d75b2e21fbf Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Mon, 23 Apr 2018 10:02:16 +0200 Subject: [PATCH] mon/client: honor key mode when copying it to other nodes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- roles/ceph-client/tasks/create_users_keys.yml | 3 +++ roles/ceph-mon/tasks/openstack_config.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/roles/ceph-client/tasks/create_users_keys.yml b/roles/ceph-client/tasks/create_users_keys.yml index eef870134..60e31138b 100644 --- a/roles/ceph-client/tasks/create_users_keys.yml +++ b/roles/ceph-client/tasks/create_users_keys.yml @@ -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: diff --git a/roles/ceph-mon/tasks/openstack_config.yml b/roles/ceph-mon/tasks/openstack_config.yml index 78cf13ff9..cfabd996c 100644 --- a/roles/ceph-mon/tasks/openstack_config.yml +++ b/roles/ceph-mon/tasks/openstack_config.yml @@ -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 }}" -- 2.47.3