kolla-ansible/ansible/roles/nova/tasks/external-ceph.yml
Mathias Ewald ffafebf87c External Ceph - Implementation Nova
Introduced nova backend selection flag for Ceph and priority if
multiple backends are configured

Add mechanism to deploy arbitrary ceph.conf and keyring files into
nova-compute and nova-libvirt containers

Added documentation

Change-Id: Id010ca9cc2d914e5358ef79edeb600a28220dd4b
Implements: blueprint external-ceph
2016-07-27 20:25:00 +00:00

50 lines
1.5 KiB
YAML

---
- name: Ensuring config directory exists
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
with_items:
- "nova-compute"
- "nova-libvirt/secrets"
when: inventory_hostname in groups['compute']
- name: Find keyring files
local_action: find paths="{{ node_custom_config }}/nova/" patterns="^ceph\.client\..*?\.keyring$" use_regex=True
register: cephx_keyring_files
- name: Copy over ceph keyring file
copy:
src: "{{ cephx_keyring_files.files[0].path }}"
dest: "{{ node_config_directory }}/{{item}}/"
with_items:
- nova-compute
- nova-libvirt
when: inventory_hostname in groups['compute']
- name: Copy over ceph.conf
copy:
src: "{{ node_custom_config }}/nova/ceph.conf"
dest: "{{ node_config_directory }}/{{ item }}/"
with_items:
- nova-compute
- nova-libvirt
when: inventory_hostname in groups['compute']
- name: Pushing secrets xml for libvirt
template:
src: "secret.xml.j2"
dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ rbd_secret_uuid }}.xml"
mode: "0600"
when: inventory_hostname in groups['compute']
- name: Extract key from file
local_action: shell cat {{ cephx_keyring_files.files[0].path }} | grep -E 'key\s*=' | awk '{ print $3 }'
register: cephx_raw_key
- name: Pushing secrets key for libvirt
copy:
content: "{{ cephx_raw_key.stdout }}"
dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ rbd_secret_uuid }}.base64"
mode: "0600"
when: inventory_hostname in groups['compute']