From 60e0628004d579028b65dafc71650af2844d071b Mon Sep 17 00:00:00 2001 From: Logan V Date: Thu, 13 Jul 2017 08:33:50 -0500 Subject: [PATCH] Include ceph_client role if needed Moves the ceph_client role execution inside the os_cinder role instead of executing it at the playbook level. Change-Id: I620552d7de367d89a99d1622a4e0c89e78336e86 --- defaults/main.yml | 2 ++ tasks/main.yml | 12 ++++++++++++ tests/ansible-role-requirements.yml | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index ba38bf39..90f9b756 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -225,6 +225,8 @@ cinder_quota_backup_gigabytes: 1000 # cinder_backend_lvm_inuse: True if current host has an lvm backend cinder_backend_lvm_inuse: '{{ (cinder_backends|default("")|to_json).find("lvm") != -1 }}' +# cinder_backend_rbd_inuse: True if the current host has an rbd backend +cinder_backend_rbd_inuse: '{{ (cinder_backends|default("")|to_json).find("cinder.volume.drivers.rbd.RBDDriver") != -1 }}' ## Policy vars # Provide a list of access controls to update the default policy.json with. These changes will be merged diff --git a/tasks/main.yml b/tasks/main.yml index 1cf71ac3..b8b843c3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -72,6 +72,18 @@ tags: - cinder-config +- name: Include ceph_client role + include_role: + name: ceph_client + vars: + openstack_service_system_user: "{{ cinder_system_user_name }}" + openstack_service_venv_bin: "{{ cinder_bin }}" + when: + - "'cinder_volume' in group_names" + - "cinder_backend_rbd_inuse | bool" + tags: + - ceph + - name: Flush handlers meta: flush_handlers diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index a87662a0..7711426d 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -46,6 +46,10 @@ src: https://git.openstack.org/openstack/openstack-ansible-openstack_hosts scm: git version: master +- name: ceph_client + src: https://git.openstack.org/openstack/openstack-ansible-ceph_client + scm: git + version: master - name: os_previous_cinder src: https://git.openstack.org/openstack/openstack-ansible-os_cinder scm: git