Merge "Allow nova to use cephfs cinder volumes without nova cephfs backend"

This commit is contained in:
Zuul 2018-08-27 07:42:50 +00:00 committed by Gerrit Code Review
commit 874cde1e35
3 changed files with 18 additions and 11 deletions

View File

@ -12,7 +12,7 @@
- include_tasks: external_ceph.yml - include_tasks: external_ceph.yml
when: when:
- not enable_ceph | bool and nova_backend == "rbd" - not enable_ceph | bool and (nova_backend == "rbd" or cinder_backend_ceph | bool)
- inventory_hostname in groups['compute'] - inventory_hostname in groups['compute']
- include_tasks: register.yml - include_tasks: register.yml

View File

@ -14,7 +14,9 @@
run_once: True run_once: True
register: nova_cephx_keyring_file register: nova_cephx_keyring_file
failed_when: not nova_cephx_keyring_file.stat.exists failed_when: not nova_cephx_keyring_file.stat.exists
when: external_ceph_cephx_enabled | bool when:
- nova_backend == "rbd"
- external_ceph_cephx_enabled | bool
- name: Check cinder keyring file - name: Check cinder keyring file
local_action: stat path="{{ node_custom_config }}/nova/ceph.client.cinder.keyring" local_action: stat path="{{ node_custom_config }}/nova/ceph.client.cinder.keyring"
@ -36,6 +38,7 @@
- nova-libvirt - nova-libvirt
when: when:
- inventory_hostname in groups['compute'] - inventory_hostname in groups['compute']
- nova_backend == "rbd"
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
notify: notify:
- Restart nova-compute container - Restart nova-compute container
@ -49,7 +52,9 @@
with_items: with_items:
- nova-compute - nova-compute
- nova-libvirt - nova-libvirt
when: inventory_hostname in groups['compute'] when:
- inventory_hostname in groups['compute']
- nova_backend == "rbd"
notify: notify:
- Restart nova-compute container - Restart nova-compute container
- Restart nova-libvirt container - Restart nova-libvirt container
@ -65,7 +70,7 @@
with_items: with_items:
- uuid: "{{ rbd_secret_uuid }}" - uuid: "{{ rbd_secret_uuid }}"
name: "client.nova secret" name: "client.nova secret"
enabled: true enabled: "{{ nova_backend == 'rbd' }}"
- uuid: "{{ cinder_rbd_secret_uuid }}" - uuid: "{{ cinder_rbd_secret_uuid }}"
name: "client.cinder secret" name: "client.cinder secret"
enabled: "{{ cinder_backend_ceph }}" enabled: "{{ cinder_backend_ceph }}"
@ -76,7 +81,9 @@
local_action: shell cat "{{ nova_cephx_keyring_file.stat.path }}" | grep -E 'key\s*=' | awk '{ print $3 }' local_action: shell cat "{{ nova_cephx_keyring_file.stat.path }}" | grep -E 'key\s*=' | awk '{ print $3 }'
run_once: True run_once: True
register: nova_cephx_raw_key register: nova_cephx_raw_key
when: external_ceph_cephx_enabled | bool when:
- nova_backend == "rbd"
- external_ceph_cephx_enabled | bool
- name: Extract cinder key from file - name: Extract cinder key from file
local_action: shell cat "{{ cinder_cephx_keyring_file.stat.path }}" | grep -E 'key\s*=' | awk '{ print $3 }' local_action: shell cat "{{ cinder_cephx_keyring_file.stat.path }}" | grep -E 'key\s*=' | awk '{ print $3 }'
@ -88,7 +95,7 @@
- name: Pushing secrets key for libvirt - name: Pushing secrets key for libvirt
copy: copy:
content: "{{ item.content }}" content: "{{ item.result.stdout }}"
dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ item.uuid }}.base64" dest: "{{ node_config_directory }}/nova-libvirt/secrets/{{ item.uuid }}.base64"
mode: "0600" mode: "0600"
when: when:
@ -97,10 +104,10 @@
- external_ceph_cephx_enabled | bool - external_ceph_cephx_enabled | bool
with_items: with_items:
- uuid: "{{ rbd_secret_uuid }}" - uuid: "{{ rbd_secret_uuid }}"
content: "{{ nova_cephx_raw_key.stdout }}" result: "{{ nova_cephx_raw_key }}"
enabled: true enabled: "{{ nova_backend == 'rbd' }}"
- uuid: "{{ cinder_rbd_secret_uuid }}" - uuid: "{{ cinder_rbd_secret_uuid }}"
content: "{{ cinder_cephx_raw_key.stdout }}" result: "{{ cinder_cephx_raw_key }}"
enabled: "{{ cinder_backend_ceph }}" enabled: "{{ cinder_backend_ceph }}"
notify: notify:
- Restart nova-libvirt container - Restart nova-libvirt container

View File

@ -12,13 +12,13 @@
"dest": "/etc/libvirt/qemu.conf", "dest": "/etc/libvirt/qemu.conf",
"owner": "root", "owner": "root",
"perm": "0600" "perm": "0600"
}{% if nova_backend == "rbd" %}, }{% if nova_backend == "rbd" or cinder_backend_ceph | bool %},
{ {
"source": "{{ container_config_directory }}/secrets", "source": "{{ container_config_directory }}/secrets",
"dest": "/etc/libvirt/secrets", "dest": "/etc/libvirt/secrets",
"owner": "root", "owner": "root",
"perm": "0600" "perm": "0600"
}, }{% endif %}{% if nova_backend == "rbd" %},
{ {
"source": "{{ container_config_directory }}/ceph.conf", "source": "{{ container_config_directory }}/ceph.conf",
"dest": "/etc/ceph/ceph.conf", "dest": "/etc/ceph/ceph.conf",