Configure backends from API host

The tasks to configure cinder backends require that the API be
available. Since the API service should be installed after the volume
service, run these tasks against an API host instead of a volume host.

Change-Id: I6f39b4da6d4d8a3768f157c73970fe0177885ff3
This commit is contained in:
Jimmy McCrory 2017-12-19 09:36:36 -08:00
parent 198acc08aa
commit 6c976e5077
2 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@
- name: Create singular cinder_backends variable for all hosts
set_fact:
_cinder_backends: "{{ (_cinder_backends | default(cinder_backends | default({}))) | combine(hostvars[item]['cinder_backends'] | default({})) }}"
with_items: "{{ groups['cinder_volume'] }}"
with_items: "{{ groups[cinder_services['cinder-volume']['group']] }}"
- name: Add in cinder devices types
shell: |

View File

@ -94,9 +94,9 @@
- include: cinder_backends.yml
static: no
when:
- "groups['cinder_volume'] | length > 0"
- "cinder_services['cinder-volume']['group'] in group_names"
- "inventory_hostname == ((groups['cinder_volume'] | intersect(ansible_play_hosts)) | list)[0]"
- "groups[cinder_services['cinder-volume']['group']] | length > 0"
- "cinder_services['cinder-api']['group'] in group_names"
- "inventory_hostname == ((groups[cinder_services['cinder-api']['group']] | intersect(ansible_play_hosts)) | list)[0]"
tags:
- cinder-config