mirror of https://github.com/ceph/ceph-ansible.git
ceph-mon: Don't set monitor directory mode recursively
After rolling updates performed with
`infrastructure-playbooks/rolling_updates.yml`, files located in
`/var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}` had mode 0755 (including
the keyring), making them world-readable.
This commit separates the task that configured permissions recursively on
`/var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}` into two separate tasks:
1. Set the ownership and mode of the directory itself;
2. Recursively set ownership in the directory, but don't modify the mode.
Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 0d76826bbb
)
pull/5995/head
parent
a1ff05b26e
commit
4a7186697e
|
@ -51,13 +51,25 @@
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: containerized_deployment | bool
|
when: containerized_deployment | bool
|
||||||
|
|
||||||
- name: create (and fix ownership of) monitor directory
|
- name: create monitor directory
|
||||||
file:
|
file:
|
||||||
path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}
|
path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||||
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||||
mode: "{{ ceph_directories_mode | default('0755') }}"
|
mode: "{{ ceph_directories_mode | default('0755') }}"
|
||||||
|
|
||||||
|
# We don't do the recursion in the task above to avoid setting `mode` (which
|
||||||
|
# defaults to 0755) on files.
|
||||||
|
#
|
||||||
|
# This is only needed when upgrading from older versions of Ceph that used to
|
||||||
|
# run as `root` (https://github.com/ceph/ceph-ansible/issues/1635).
|
||||||
|
- name: recursively fix ownership of monitor directory
|
||||||
|
file:
|
||||||
|
path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}
|
||||||
|
state: directory
|
||||||
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||||
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||||
recurse: true
|
recurse: true
|
||||||
|
|
||||||
- name: create custom admin keyring
|
- name: create custom admin keyring
|
||||||
|
|
Loading…
Reference in New Issue