4c221be86e
Consistently use template instead of copy. This has the added advantage of allowing variables inside ceph conf files and keyrings. Closes-Bug: 1959565 Signed-off-by: Imran Hussain <ih@imranh.co.uk> Change-Id: Ibd0ff2641a54267ff06d3c89a26915a455dff1c1
63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
---
|
|
- name: Copying over ceph.conf for Cinder
|
|
vars:
|
|
services_need_config:
|
|
- "cinder-volume"
|
|
- "cinder-backup"
|
|
merge_configs:
|
|
sources:
|
|
- "{{ node_custom_config }}/cinder/ceph.conf"
|
|
- "{{ node_custom_config }}/cinder/{{ item.key }}/ceph.conf"
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/ceph.conf"
|
|
mode: "0660"
|
|
become: true
|
|
when:
|
|
- item.value.enabled | bool
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.key in services_need_config
|
|
with_dict: "{{ cinder_services }}"
|
|
notify:
|
|
- Restart {{ item.key }} container
|
|
|
|
- name: Copy over Ceph keyring files for cinder-volume
|
|
template:
|
|
src: "{{ node_custom_config }}/cinder/cinder-volume/{{ ceph_cinder_keyring }}"
|
|
dest: "{{ node_config_directory }}/cinder-volume/"
|
|
mode: "0660"
|
|
become: true
|
|
when:
|
|
- external_ceph_cephx_enabled | bool
|
|
- inventory_hostname in groups['cinder-volume']
|
|
- cinder_services['cinder-volume'].enabled | bool
|
|
notify:
|
|
- Restart cinder-volume container
|
|
|
|
- name: Copy over Ceph keyring files for cinder-backup
|
|
template:
|
|
src: "{{ node_custom_config }}/cinder/{{ item }}"
|
|
dest: "{{ node_config_directory }}/cinder-backup/"
|
|
mode: "0660"
|
|
become: true
|
|
register: cinder_backup_ceph_keyring
|
|
with_items:
|
|
- "cinder-backup/{{ ceph_cinder_keyring }}"
|
|
- "cinder-backup/{{ ceph_cinder_backup_keyring }}"
|
|
when:
|
|
- external_ceph_cephx_enabled | bool
|
|
- inventory_hostname in groups['cinder-backup']
|
|
- cinder_services['cinder-backup'].enabled | bool
|
|
notify:
|
|
- Restart cinder-backup container
|
|
|
|
- name: Ensuring config directory has correct owner and permission
|
|
become: true
|
|
file:
|
|
path: "{{ node_config_directory }}/{{ item }}"
|
|
recurse: yes
|
|
owner: "{{ config_owner_user }}"
|
|
group: "{{ config_owner_group }}"
|
|
when: inventory_hostname in groups[item]
|
|
with_items:
|
|
- "cinder-volume"
|
|
- "cinder-backup"
|