diff --git a/defaults/main.yml b/defaults/main.yml index 85a60ba2..896f5573 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -393,6 +393,9 @@ nova_ceph_client_uuid: 517a4663-3927-44bc-9ea7-4a90e1cd4c66 # ceph be deployed on the nova compute hosts to enable volume backed instances. nova_cinder_rbd_inuse: False +# Used to determine if we need a Ceph client +nova_rbd_inuse: "(nova_libvirt_images_rbd_pool is defined) or (nova_cinder_rbd_inuse | bool)" + ## General Nova configuration # If ``nova_osapi_compute_workers`` is unset the system will use half the number of available VCPUS to # compute the number of api workers to use. diff --git a/tasks/main.yml b/tasks/main.yml index e4322ab6..501075c3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -232,9 +232,8 @@ openstack_service_venv_bin: "{{ nova_bin }}" when: - nova_virt_type != 'ironic' - - "nova_services['nova-compute']['group'] in group_names" - - "(nova_libvirt_images_rbd_pool is defined) or - (nova_cinder_rbd_inuse | bool)" + - nova_services['nova-compute']['group'] in group_names + - nova_rbd_inuse | bool tags: - ceph diff --git a/templates/nova.conf.j2 b/templates/nova.conf.j2 index dcd63cd4..5aa98cce 100644 --- a/templates/nova.conf.j2 +++ b/templates/nova.conf.j2 @@ -250,10 +250,12 @@ cpu_model_extra_flags = {{ nova_cpu_model_extra_flags | join(',') }} {% endif %} {% endif %} -{% if nova_libvirt_images_rbd_pool is defined %} +{% if nova_rbd_inuse %} # ceph rbd support rbd_user = {{ nova_ceph_client }} rbd_secret_uuid = {{ nova_ceph_client_uuid }} +{% endif %} +{% if nova_libvirt_images_rbd_pool is defined %} images_type = rbd images_rbd_pool = {{ nova_libvirt_images_rbd_pool }} images_rbd_ceph_conf = /etc/ceph/ceph.conf