Skip to content

Commit

Permalink
Optionally use the old rabbitmq setup tasks
Browse files Browse the repository at this point in the history
With the merge of https://review.openstack.org/559127 the roles
which do not yet have the oslomsg_rpc_all/oslomsg_notify_all
groups are failing with messages like:

'dict object' has no attribute 'oslomsg_rpc_all'
'dict object' has no attribute 'oslomsg_notify_all'

This patch puts the old ensure-rabbitmq.yml task include back
and activates it when these groups are not defined.

Change-Id: I90dcd122fbc96f7737363dd353b50a516122667a
  • Loading branch information
Jesse Pretorius committed May 17, 2018
1 parent 37161d5 commit d1d0d21
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test-install-cinder.yml
Expand Up @@ -21,13 +21,23 @@
any_errors_fatal: true
pre_tasks:

- include: ensure-rabbitmq.yml
vhost_name: "{{ cinder_rabbitmq_vhost }}"
user_name: "{{ cinder_rabbitmq_userid }}"
user_password: "{{ cinder_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ cinder_oslomsg_rpc_vhost }}"
rpc_user: "{{ cinder_oslomsg_rpc_userid }}"
rpc_password: "{{ cinder_oslomsg_rpc_password }}"
notify_vhost: "{{ cinder_oslomsg_notify_vhost }}"
notify_user: "{{ cinder_oslomsg_notify_userid }}"
notify_password: "{{ cinder_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ cinder_galera_database }}"
Expand Down
11 changes: 11 additions & 0 deletions test-install-glance.yml
Expand Up @@ -20,13 +20,24 @@
gather_facts: true
any_errors_fatal: true
pre_tasks:
- include: ensure-rabbitmq.yml
vhost_name: "{{ glance_rabbitmq_vhost }}"
user_name: "{{ glance_rabbitmq_userid }}"
user_password: "{{ glance_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ glance_oslomsg_rpc_vhost }}"
rpc_user: "{{ glance_oslomsg_rpc_userid }}"
rpc_password: "{{ glance_oslomsg_rpc_password }}"
notify_vhost: "{{ glance_oslomsg_notify_vhost }}"
notify_user: "{{ glance_oslomsg_notify_userid }}"
notify_password: "{{ glance_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ glance_galera_database }}"
db_password: "{{ glance_container_mysql_password }}"
Expand Down
11 changes: 11 additions & 0 deletions test-install-heat.yml
Expand Up @@ -20,13 +20,24 @@
gather_facts: true
any_errors_fatal: true
pre_tasks:
- include: ensure-rabbitmq.yml
vhost_name: "{{ heat_rabbitmq_vhost }}"
user_name: "{{ heat_rabbitmq_userid }}"
user_password: "{{ heat_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ heat_oslomsg_rpc_vhost }}"
rpc_user: "{{ heat_oslomsg_rpc_userid }}"
rpc_password: "{{ heat_oslomsg_rpc_password }}"
notify_vhost: "{{ heat_oslomsg_notify_vhost }}"
notify_user: "{{ heat_oslomsg_notify_userid }}"
notify_password: "{{ heat_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ heat_galera_database }}"
db_password: "{{ heat_container_mysql_password }}"
Expand Down
11 changes: 11 additions & 0 deletions test-install-ironic.yml
Expand Up @@ -20,13 +20,24 @@
gather_facts: true
any_errors_fatal: true
pre_tasks:
- include: ensure-rabbitmq.yml
vhost_name: "{{ ironic_rabbitmq_vhost }}"
user_name: "{{ ironic_rabbitmq_userid }}"
user_password: "{{ ironic_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ ironic_oslomsg_rpc_vhost }}"
rpc_user: "{{ ironic_oslomsg_rpc_userid }}"
rpc_password: "{{ ironic_oslomsg_rpc_password }}"
notify_vhost: "{{ ironic_oslomsg_notify_vhost }}"
notify_user: "{{ ironic_oslomsg_notify_userid }}"
notify_password: "{{ ironic_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ ironic_galera_database }}"
db_password: "{{ ironic_container_mysql_password }}"
Expand Down
12 changes: 12 additions & 0 deletions test-install-keystone.yml
Expand Up @@ -23,13 +23,25 @@
- name: Set keystone_messaging fact
set_fact:
keystone_messaging_enabled: "{{ groups['rabbitmq_all'] is defined }}"

- include: ensure-rabbitmq.yml
vhost_name: "{{ keystone_rabbitmq_vhost }}"
user_name: "{{ keystone_rabbitmq_userid }}"
user_password: "{{ keystone_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ keystone_oslomsg_rpc_vhost }}"
rpc_user: "{{ keystone_oslomsg_rpc_userid }}"
rpc_password: "{{ keystone_oslomsg_rpc_password }}"
notify_vhost: "{{ keystone_oslomsg_notify_vhost }}"
notify_user: "{{ keystone_oslomsg_notify_userid }}"
notify_password: "{{ keystone_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ keystone_galera_database }}"
db_password: "{{ keystone_container_mysql_password }}"
Expand Down
10 changes: 10 additions & 0 deletions test-install-neutron.yml
Expand Up @@ -78,13 +78,23 @@
name: "{{ required_packages[ansible_pkg_mgr] }}"
state: present

- include: ensure-rabbitmq.yml
vhost_name: "{{ neutron_rabbitmq_vhost }}"
user_name: "{{ neutron_rabbitmq_userid }}"
user_password: "{{ neutron_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ neutron_oslomsg_rpc_vhost }}"
rpc_user: "{{ neutron_oslomsg_rpc_userid }}"
rpc_password: "{{ neutron_oslomsg_rpc_password }}"
notify_vhost: "{{ neutron_oslomsg_notify_vhost }}"
notify_user: "{{ neutron_oslomsg_notify_userid }}"
notify_password: "{{ neutron_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ neutron_galera_database }}"
Expand Down
10 changes: 10 additions & 0 deletions test-install-nova.yml
Expand Up @@ -57,13 +57,23 @@
name: "{{ required_packages[ansible_pkg_mgr] }}"
state: present

- include: ensure-rabbitmq.yml
vhost_name: "{{ nova_rabbitmq_vhost }}"
user_name: "{{ nova_rabbitmq_userid }}"
user_password: "{{ nova_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ nova_oslomsg_rpc_vhost }}"
rpc_user: "{{ nova_oslomsg_rpc_userid }}"
rpc_password: "{{ nova_oslomsg_rpc_password }}"
notify_vhost: "{{ nova_oslomsg_notify_vhost }}"
notify_user: "{{ nova_oslomsg_notify_userid }}"
notify_password: "{{ nova_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ nova_galera_database }}"
Expand Down
11 changes: 11 additions & 0 deletions test-install-sahara.yml
Expand Up @@ -20,13 +20,24 @@
gather_facts: true
any_errors_fatal: true
pre_tasks:
- include: ensure-rabbitmq.yml
vhost_name: "{{ sahara_rabbitmq_vhost }}"
user_name: "{{ sahara_rabbitmq_userid }}"
user_password: "{{ sahara_rabbitmq_password }}"
when:
- "'oslomsg_rpc_all' not in groups"

- include: ensure-oslomsg.yml
rpc_vhost: "{{ sahara_oslomsg_rpc_vhost }}"
rpc_user: "{{ sahara_oslomsg_rpc_userid }}"
rpc_password: "{{ sahara_oslomsg_rpc_password }}"
notify_vhost: "{{ sahara_oslomsg_notify_vhost }}"
notify_user: "{{ sahara_oslomsg_notify_userid }}"
notify_password: "{{ sahara_oslomsg_notify_password }}"
when:
- "'oslomsg_rpc_all' in groups"
- "groups['oslomsg_rpc_all'] | length > 0"

- include: create-grant-db.yml
db_name: "{{ sahara_galera_database }}"
db_password: "{{ sahara_container_mysql_password }}"
Expand Down

0 comments on commit d1d0d21

Please sign in to comment.