]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-config: ceph.conf rendering refactor
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 5 Oct 2020 15:41:20 +0000 (17:41 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 15 Dec 2020 16:30:42 +0000 (17:30 +0100)
This commit cleans up the `main.yml` task file of `ceph-config`.
It drops the local ceph.conf generation.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 900c0f44925ec0c6c1acb16433044ac40717e00e)

group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-config/tasks/main.yml
roles/ceph-defaults/defaults/main.yml

index 7c0b126ccc51ab7830542184ded3ce7a0ce25837..abd851805b6e011202883f56aadf675cff5dd503 100644 (file)
@@ -74,8 +74,6 @@ dummy:
 #ceph_dashboard_firewall_zone: public
 #ceph_rgwloadbalancer_firewall_zone: public
 
-# Generate local ceph.conf in fetch directory
-#ceph_conf_local: false
 
 ############
 # PACKAGES #
index eed965af7279465359ee1511dc1799de48acd7d9..4f3ae4be0a6b69acffba4314e2684ac2920527b9 100644 (file)
@@ -74,8 +74,6 @@ fetch_directory: ~/ceph-ansible-keys
 #ceph_dashboard_firewall_zone: public
 #ceph_rgwloadbalancer_firewall_zone: public
 
-# Generate local ceph.conf in fetch directory
-#ceph_conf_local: false
 
 ############
 # PACKAGES #
index bd8714f991af94b9cc68a28d1b5a5708ef713f3c..ef16fc317ec1004c5ed53b815f0f7a8ae1b56e31 100644 (file)
     when:
       - devices | default([]) | length > 0
 
-# ceph-common
-- name: config file operation for non-containerized scenarios
+- name: create ceph conf directory
+  file:
+    path: "/etc/ceph"
+    state: directory
+    owner: "ceph"
+    group: "ceph"
+    mode: "{{ ceph_directories_mode }}"
   when: not containerized_deployment | bool
-  block:
-  - name: create ceph conf directory
-    file:
-      path: "/etc/ceph"
-      state: directory
-      owner: "ceph"
-      group: "ceph"
-      mode: "{{ ceph_directories_mode }}"
-
-  - name: "generate ceph configuration file: {{ cluster }}.conf"
-    action: config_template
-    args:
-      src: ceph.conf.j2
-      dest: /etc/ceph/{{ cluster }}.conf
-      owner: "ceph"
-      group: "ceph"
-      mode: "0644"
-      config_overrides: "{{ ceph_conf_overrides }}"
-      config_type: ini
-    notify:
-      - restart ceph mons
-      - restart ceph osds
-      - restart ceph mdss
-      - restart ceph rgws
-      - restart ceph mgrs
-      - restart ceph rbdmirrors
-      - restart ceph rbd-target-api-gw
-
-  - name: "ensure fetch directory exists"
-    run_once: true
-    become: false
-    file:
-      path: "{{ fetch_directory }}/{{ fsid }}/etc/ceph"
-      state: directory
-      mode: "{{ ceph_directories_mode }}"
-    delegate_to: localhost
-    when: ceph_conf_local | bool
-
-  - name: "generate {{ cluster }}.conf configuration file locally"
-    config_template:
-    become: false
-    run_once: true
-    delegate_to: localhost
-    args:
-      src: "ceph.conf.j2"
-      dest: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.conf"
-      config_overrides: "{{ ceph_conf_overrides }}"
-      config_type: ini
-    when:
-      - inventory_hostname in groups.get(mon_group_name, [])
-      - ceph_conf_local | bool
-
-- name: config file operations for containerized scenarios
-  when: containerized_deployment | bool
-  block:
-  - name: create a local fetch directory if it does not exist
-    file:
-      path: "{{ fetch_directory }}"
-      state: directory
-    delegate_to: localhost
-    changed_when: false
-    become: false
-    run_once: true
-    when:
-      - (cephx or generate_fsid) | bool
-      - ((inventory_hostname in groups.get(mon_group_name, [])) or
-        (groups.get(nfs_group_name, []) | length > 0) and inventory_hostname == groups.get(nfs_group_name, [])[0])
 
-  - name: "generate {{ cluster }}.conf configuration file"
-    action: config_template
-    args:
-      src: "ceph.conf.j2"
-      dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.conf"
-      owner: "root"
-      group: "root"
-      mode: "0644"
-      config_overrides: "{{ ceph_conf_overrides }}"
-      config_type: ini
-    notify:
-      - restart ceph mons
-      - restart ceph osds
-      - restart ceph mdss
-      - restart ceph rgws
-      - restart ceph mgrs
-      - restart ceph rbdmirrors
-      - restart ceph rbd-target-api-gw
+- name: "generate {{ cluster }}.conf configuration file"
+  action: config_template
+  args:
+    src: "ceph.conf.j2"
+    dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.conf"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    mode: "0644"
+    config_overrides: "{{ ceph_conf_overrides }}"
+    config_type: ini
+  notify:
+    - restart ceph mons
+    - restart ceph osds
+    - restart ceph mdss
+    - restart ceph rgws
+    - restart ceph mgrs
+    - restart ceph rbdmirrors
+    - restart ceph rbd-target-api-gw
index 75cf0da867e759b693f348ee33db83de1e680bb8..d36af80cdb993a36fb8aabd3c4c1a647707a4bc2 100644 (file)
@@ -66,8 +66,6 @@ ceph_iscsi_firewall_zone: public
 ceph_dashboard_firewall_zone: public
 ceph_rgwloadbalancer_firewall_zone: public
 
-# Generate local ceph.conf in fetch directory
-ceph_conf_local: false
 
 ############
 # PACKAGES #