ceph-config: ceph.conf rendering refactor

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 900c0f4492)
pull/5987/head
Guillaume Abrioux 2020-10-05 17:41:20 +02:00 committed by Dimitri Savineau
parent 3eed44907b
commit 76be9a4292
4 changed files with 25 additions and 93 deletions

View File

@ -76,8 +76,6 @@ dummy:
#ceph_dashboard_firewall_zone: public #ceph_dashboard_firewall_zone: public
#ceph_rgwloadbalancer_firewall_zone: public #ceph_rgwloadbalancer_firewall_zone: public
# Generate local ceph.conf in fetch directory
#ceph_conf_local: false
############ ############
# PACKAGES # # PACKAGES #

View File

@ -76,8 +76,6 @@ fetch_directory: ~/ceph-ansible-keys
#ceph_dashboard_firewall_zone: public #ceph_dashboard_firewall_zone: public
#ceph_rgwloadbalancer_firewall_zone: public #ceph_rgwloadbalancer_firewall_zone: public
# Generate local ceph.conf in fetch directory
#ceph_conf_local: false
############ ############
# PACKAGES # # PACKAGES #

View File

@ -89,84 +89,22 @@
- devices | default([]) | length > 0 - devices | default([]) | length > 0
- not (lvm_batch_report.stdout | default('{}') | from_json).changed | default(false) | bool - not (lvm_batch_report.stdout | default('{}') | from_json).changed | default(false) | bool
# ceph-common - name: create ceph conf directory
- name: config file operation for non-containerized scenarios
when: not containerized_deployment | bool
block:
- name: create ceph conf directory
file: file:
path: "/etc/ceph" path: "/etc/ceph"
state: directory state: directory
owner: "ceph" owner: "ceph"
group: "ceph" group: "ceph"
mode: "{{ ceph_directories_mode }}" mode: "{{ ceph_directories_mode }}"
when: not containerized_deployment | bool
- name: "generate ceph configuration file: {{ cluster }}.conf" - name: "generate {{ cluster }}.conf configuration file"
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 action: config_template
args: args:
src: "ceph.conf.j2" src: "ceph.conf.j2"
dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.conf" dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.conf"
owner: "root" owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
group: "root" group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
mode: "0644" mode: "0644"
config_overrides: "{{ ceph_conf_overrides }}" config_overrides: "{{ ceph_conf_overrides }}"
config_type: ini config_type: ini

View File

@ -68,8 +68,6 @@ ceph_iscsi_firewall_zone: public
ceph_dashboard_firewall_zone: public ceph_dashboard_firewall_zone: public
ceph_rgwloadbalancer_firewall_zone: public ceph_rgwloadbalancer_firewall_zone: public
# Generate local ceph.conf in fetch directory
ceph_conf_local: false
############ ############
# PACKAGES # # PACKAGES #