kolla-ansible/ansible/roles/manila/tasks/external_ceph.yml
Michal Arbet fdf2385f14 Add support for multiple ceph files
This patch is adding a feature for an option to copy different
ceph configuration files and corresponding keyrings for cinder,
glance, manila, gnocchi and nova services.

This is especially useful when the deployment uses availability
zones as below example.

  - Individual compute can read/write to individual ceph
    cluster in same AZ.
  - Cinder can write to several ceph clusters in several AZs.
  - Glance can use multistore and upload images to
    several ceph clusters in several AZs at once.

Change-Id: Ie4d8ab5a3df748137835cae1c943b9180cd10eb1
2023-06-14 10:18:11 +02:00

54 lines
1.6 KiB
YAML

---
- name: Ensuring manila service ceph config subdir exists
vars:
service: "{{ manila_services['manila-share'] }}"
file:
path: "{{ node_config_directory }}/manila-share/ceph"
state: "directory"
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
- name: Copy over multiple ceph configs for Manila
merge_configs:
sources:
- "{{ node_custom_config }}/manila/{{ item.cluster }}.conf"
- "{{ node_custom_config }}/manila/manila-share/{{ item.cluster }}.conf"
dest: "{{ node_config_directory }}/manila-share/ceph/{{ item.cluster }}.conf"
mode: "0660"
become: true
when:
- inventory_hostname in groups['manila-share']
- item.enabled | bool
with_items: "{{ manila_ceph_backends }}"
notify:
- Restart manila-share container
- name: Copy over ceph Manila keyrings
template:
src: "{{ node_custom_config }}/manila/{{ item.cluster }}.{{ ceph_manila_keyring }}"
dest: "{{ node_config_directory }}/manila-share/ceph/{{ item.cluster }}.{{ ceph_manila_keyring }}"
mode: "0660"
become: true
with_items: "{{ manila_ceph_backends }}"
when:
- inventory_hostname in groups['manila-share']
- item.enabled | bool
notify:
- Restart manila-share 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:
- "manila-share"