Skip to content

Commit

Permalink
Merge "Properly detect RBD in use on Cinder backends" into stable/ocata
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Nov 9, 2017
2 parents 00ae261 + 42545f1 commit 22b87ce
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
12 changes: 12 additions & 0 deletions playbooks/common-playbooks/cinder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
tags:
- cinder
pre_tasks:
# Switch to glance api v2 if cinder uses RBD backends
- name: Set cinder RBD inuse fact
set_fact:
cinder_backends_rbd_inuse: "{{ True in groups['cinder_volume'] | map('extract', hostvars, 'cinder_backend_rbd_inuse') }}"
delegate_to: localhost
delegate_facts: True
when:
- "'cinder_all' in group_names"
- "inventory_hostname == ((groups['cinder_all'] | intersect(ansible_play_hosts)) | list)[0]"
- "hostvars['localhost']['cinder_backends_rbd_inuse'] is not defined"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
Expand Down
15 changes: 14 additions & 1 deletion playbooks/common-playbooks/nova.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
tags:
- nova
pre_tasks:
# Enable execution of ceph_client on the nova compute hosts if cinder RBD
# backends are used. This is necessary to ensure that volume-backed Nova
# instances can function when RBD is the volume backend.
- name: Set cinder RBD inuse fact
set_fact:
nova_cinder_rbd_inuse: "{{ True in groups['cinder_volume'] | map('extract', hostvars, 'cinder_backend_rbd_inuse') }}"
delegate_to: localhost
delegate_facts: True
when:
- "'nova_compute' in group_names"
- "inventory_hostname == ((groups['nova_compute'] | intersect(ansible_play_hosts)) | list)[0]"
- "hostvars['localhost']['nova_cinder_rbd_inuse'] is not defined"
tags:
- always

# In order to ensure that any container, software or
# config file changes which causes a container/service
Expand Down Expand Up @@ -122,7 +136,6 @@
nova_spicehtml5_git_repo: "{{ openstack_repo_git_url }}/spice-html5"
nova_spicehtml5_git_install_branch: "{{ spicehtml5_git_install_branch }}"
nova_management_address: "{{ management_address }}"
nova_cinder_rbd_inuse: "{{ hostvars['localhost']['cinder_backends_rbd_inuse'] }}"

- role: "openstack_openrc"
tags:
Expand Down
4 changes: 0 additions & 4 deletions playbooks/inventory/host_vars/localhost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@
# limitations under the License.

ansible_python_interpreter: /usr/bin/python

# cinder_backends_rbd_inuse: true if at least 1 cinder_backend on any
# cinder_volume host uses Ceph RBD
cinder_backends_rbd_inuse: "{{ True in groups['cinder_volume'] | map('extract', hostvars, 'cinder_backend_rbd_inuse') }}"

0 comments on commit 22b87ce

Please sign in to comment.