From fe699897ed1fe0d69768a7c28512b796cbeed9aa Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Tue, 21 Jan 2020 15:30:16 +0100 Subject: [PATCH] common: add a default value for ceph_directories_mode Since this variable makes it possible to customize the mode for ceph directories, let's make it a bit more explicit by adding a default value in ceph-defaults. Signed-off-by: Guillaume Abrioux (cherry picked from commit 483adb5d790ea74db01154b7dacbbf2bef030acc) --- group_vars/all.yml.sample | 2 +- group_vars/rhcs.yml.sample | 2 +- roles/ceph-config/tasks/main.yml | 4 ++-- roles/ceph-defaults/defaults/main.yml | 2 +- roles/ceph-mds/tasks/common.yml | 2 +- roles/ceph-mgr/tasks/common.yml | 2 +- roles/ceph-mon/tasks/deploy_monitors.yml | 2 +- roles/ceph-nfs/tasks/pre_requisite_non_container.yml | 2 +- roles/ceph-osd/tasks/common.yml | 2 +- roles/ceph-rgw/tasks/common.yml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index b5f9765b1..7c0b126cc 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -106,7 +106,7 @@ dummy: #upgrade_ceph_packages: False #ceph_use_distro_backports: false # DEBIAN ONLY - +#ceph_directories_mode: "0755" ########### # INSTALL # diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index 47abf5680..eed965af7 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -106,7 +106,7 @@ fetch_directory: ~/ceph-ansible-keys #upgrade_ceph_packages: False #ceph_use_distro_backports: false # DEBIAN ONLY - +#ceph_directories_mode: "0755" ########### # INSTALL # diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index 20fa9832c..bd8714f99 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -97,7 +97,7 @@ state: directory owner: "ceph" group: "ceph" - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" - name: "generate ceph configuration file: {{ cluster }}.conf" action: config_template @@ -124,7 +124,7 @@ file: path: "{{ fetch_directory }}/{{ fsid }}/etc/ceph" state: directory - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" delegate_to: localhost when: ceph_conf_local | bool diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 19bf23954..75cf0da86 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -98,7 +98,7 @@ ntp_daemon_type: chronyd upgrade_ceph_packages: False ceph_use_distro_backports: false # DEBIAN ONLY - +ceph_directories_mode: "0755" ########### # INSTALL # diff --git a/roles/ceph-mds/tasks/common.yml b/roles/ceph-mds/tasks/common.yml index ddfc78f39..c9df2017d 100644 --- a/roles/ceph-mds/tasks/common.yml +++ b/roles/ceph-mds/tasks/common.yml @@ -5,7 +5,7 @@ state: directory owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment else 'ceph' }}" - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" with_items: - /var/lib/ceph/bootstrap-mds/ - /var/lib/ceph/mds/{{ cluster }}-{{ mds_name }} diff --git a/roles/ceph-mgr/tasks/common.yml b/roles/ceph-mgr/tasks/common.yml index b3cd93e00..ae4744034 100644 --- a/roles/ceph-mgr/tasks/common.yml +++ b/roles/ceph-mgr/tasks/common.yml @@ -5,7 +5,7 @@ state: directory owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment else 'ceph' }}" - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" - name: fetch ceph mgr keyring ceph_key: diff --git a/roles/ceph-mon/tasks/deploy_monitors.yml b/roles/ceph-mon/tasks/deploy_monitors.yml index 10c9357f3..5ede5f631 100644 --- a/roles/ceph-mon/tasks/deploy_monitors.yml +++ b/roles/ceph-mon/tasks/deploy_monitors.yml @@ -57,7 +57,7 @@ state: directory owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}" - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" # We don't do the recursion in the task above to avoid setting `mode` (which # defaults to 0755) on files. diff --git a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml index 134a7d002..69efda56b 100644 --- a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml +++ b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml @@ -31,7 +31,7 @@ state: directory owner: "ceph" group: "ceph" - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" with_items: - { name: "/var/lib/ceph/bootstrap-rgw", create: "{{ nfs_obj_gw }}" } - { name: "/var/lib/ceph/radosgw", create: "{{ nfs_obj_gw }}" } diff --git a/roles/ceph-osd/tasks/common.yml b/roles/ceph-osd/tasks/common.yml index 5bd7964a5..989830952 100644 --- a/roles/ceph-osd/tasks/common.yml +++ b/roles/ceph-osd/tasks/common.yml @@ -5,7 +5,7 @@ state: directory owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment else 'ceph' }}" - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" when: cephx | bool with_items: - /var/lib/ceph/bootstrap-osd/ diff --git a/roles/ceph-rgw/tasks/common.yml b/roles/ceph-rgw/tasks/common.yml index 5b06e086c..50e4a6f27 100644 --- a/roles/ceph-rgw/tasks/common.yml +++ b/roles/ceph-rgw/tasks/common.yml @@ -5,7 +5,7 @@ state: directory owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment else 'ceph' }}" - mode: "{{ ceph_directories_mode | default('0755') }}" + mode: "{{ ceph_directories_mode }}" with_items: "{{ rbd_client_admin_socket_path }}" - name: get keys from monitors