Only setup rabbitmq when the inventory group is present

With the merge of https://review.openstack.org/569061 the
roles which do not have the rabbitmq_all group are failing
with messages like:

'dict object' has no attribute 'rabbitmq_all'

This patch ensures that the tasks are only activated if the
inventory group is present and populated.

Change-Id: I8f9004147753bb7f8121e344379417a6d6e2e807
This commit is contained in:
Jesse Pretorius 2018-05-30 13:17:27 +01:00
parent f8be590791
commit b869d59953
8 changed files with 16 additions and 1 deletions

View File

@ -26,6 +26,8 @@
user_name: "{{ cinder_rabbitmq_userid }}"
user_password: "{{ cinder_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml

View File

@ -25,6 +25,8 @@
user_name: "{{ glance_rabbitmq_userid }}"
user_password: "{{ glance_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml

View File

@ -25,6 +25,8 @@
user_name: "{{ heat_rabbitmq_userid }}"
user_password: "{{ heat_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml
@ -45,4 +47,3 @@
- role: "{{ heat_rolename | default('os_heat') }}"
vars_files:
- test-vars.yml

View File

@ -25,6 +25,8 @@
user_name: "{{ ironic_rabbitmq_userid }}"
user_password: "{{ ironic_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml

View File

@ -29,6 +29,8 @@
user_name: "{{ keystone_rabbitmq_userid }}"
user_password: "{{ keystone_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml

View File

@ -83,6 +83,8 @@
user_name: "{{ neutron_rabbitmq_userid }}"
user_password: "{{ neutron_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml

View File

@ -62,6 +62,8 @@
user_name: "{{ nova_rabbitmq_userid }}"
user_password: "{{ nova_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml

View File

@ -25,6 +25,8 @@
user_name: "{{ sahara_rabbitmq_userid }}"
user_password: "{{ sahara_rabbitmq_password }}"
when:
- "'rabbitmq_all' in groups"
- "groups['rabbitmq_all'] | length > 0"
- "'oslomsg_rpc_all' not in groups"
- include: ensure-oslomsg.yml