Migrate setup of messaging vhost and user from role to playbook

The Keystone role previously migrated the messaging vhost and user setup to
a pre-task in the os-keystone-install.yml playbook. This review continues this
migration for all other roles where this is applicable.

Change-Id: I3016039692d8130654fe1bff422f24ef2afc196e
This commit is contained in:
Byron McCollum 2016-03-03 09:52:34 -06:00
parent c7f141dbab
commit 8f260135f8
8 changed files with 220 additions and 9 deletions

View File

@ -60,6 +60,31 @@
tags:
- aodh-logs
- aodh-log-dirs
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ aodh_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['aodh_api'][0]
tags:
- aodh-rabbitmq
- aodh-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ aodh_rabbitmq_userid }}"
password: "{{ aodh_rabbitmq_password }}"
vhost: "{{ aodh_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['aodh_api'][0]
tags:
- aodh-rabbitmq
- aodh-rabbitmq-user
roles:
- role: "os_aodh"
aodh_venv_tag: "{{ openstack_release }}"
@ -75,3 +100,8 @@
- "aodh-rsyslog-client"
vars:
is_metal: "{{ properties.is_metal|default(false) }}"
aodh_rabbitmq_userid: aodh
aodh_rabbitmq_vhost: /aodh
aodh_rabbitmq_servers: "{{ rabbitmq_servers }}"
aodh_rabbitmq_port: "{{ rabbitmq_port }}"
aodh_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"

View File

@ -71,6 +71,31 @@
when: is_metal | bool
tags:
- ceilometer-logs
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ ceilometer_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['ceilometer_api'][0]
tags:
- ceilometer-rabbitmq
- ceilometer-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ ceilometer_rabbitmq_userid }}"
password: "{{ ceilometer_rabbitmq_password }}"
vhost: "{{ ceilometer_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['ceilometer_api'][0]
tags:
- ceilometer-rabbitmq
- ceilometer-rabbitmq-user
roles:
- role: "os_ceilometer"
ceilometer_venv_tag: "{{ openstack_release }}"
@ -87,3 +112,8 @@
vars:
galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
ceilometer_rabbitmq_userid: ceilometer
ceilometer_rabbitmq_vhost: /ceilometer
ceilometer_rabbitmq_servers: "{{ rabbitmq_servers }}"
ceilometer_rabbitmq_port: "{{ rabbitmq_port }}"
ceilometer_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"

View File

@ -112,6 +112,31 @@
when: is_metal | bool
tags:
- cinder-logs
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ cinder_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['cinder_all'][0]
tags:
- cinder-rabbitmq
- cinder-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ cinder_rabbitmq_userid }}"
password: "{{ cinder_rabbitmq_password }}"
vhost: "{{ cinder_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['cinder_all'][0]
tags:
- cinder-rabbitmq
- cinder-rabbitmq-user
- name: Set cinder storage bridge (is_metal)
set_fact:
storage_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['container_networks']['storage_address']['bridge'] | replace('-', '_') }}"
@ -180,3 +205,8 @@
vars:
galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
cinder_rabbitmq_userid: cinder
cinder_rabbitmq_vhost: /cinder
cinder_rabbitmq_servers: "{{ rabbitmq_servers }}"
cinder_rabbitmq_port: "{{ rabbitmq_port }}"
cinder_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"

View File

@ -88,6 +88,31 @@
when: is_metal | bool
tags:
- glance-logs
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ glance_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['glance_all'][0]
tags:
- glance-rabbitmq
- glance-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ glance_rabbitmq_userid }}"
password: "{{ glance_rabbitmq_password }}"
vhost: "{{ glance_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['glance_all'][0]
tags:
- glance-rabbitmq
- glance-rabbitmq-user
roles:
- role: "os_glance"
glance_galera_address: "{{ galera_address }}"
@ -114,3 +139,8 @@
vars:
galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
glance_rabbitmq_userid: glance
glance_rabbitmq_vhost: /glance
glance_rabbitmq_servers: "{{ rabbitmq_servers }}"
glance_rabbitmq_port: "{{ rabbitmq_port }}"
glance_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"

View File

@ -71,6 +71,31 @@
when: is_metal | bool
tags:
- heat-logs
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ heat_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['heat_all'][0]
tags:
- heat-rabbitmq
- heat-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ heat_rabbitmq_userid }}"
password: "{{ heat_rabbitmq_password }}"
vhost: "{{ heat_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['heat_all'][0]
tags:
- heat-rabbitmq
- heat-rabbitmq-user
roles:
- role: "os_heat"
heat_venv_tag: "{{ openstack_release }}"
@ -91,5 +116,10 @@
vars:
galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
heat_rabbitmq_userid: heat
heat_rabbitmq_vhost: /heat
heat_rabbitmq_servers: "{{ rabbitmq_servers }}"
heat_rabbitmq_port: "{{ rabbitmq_port }}"
heat_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"
vars_files:
- defaults/repo_packages/openstack_services.yml

View File

@ -88,16 +88,17 @@
when: is_metal | bool
tags:
- keystone-reserved-port
- name: Keystone ensure Rabbitmq vhost
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ keystone_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when: inventory_hostname == groups['keystone_all'][0]
when:
- inventory_hostname == groups['keystone_all'][0]
tags:
- aodh-rabbitmq
- aodh-rabbitmq-vhost
- name: Keystone ensure rabbitmq user
- keystone-rabbitmq
- keystone-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ keystone_rabbitmq_userid }}"
password: "{{ keystone_rabbitmq_password }}"
@ -107,10 +108,11 @@
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when: inventory_hostname == groups['keystone_all'][0]
when:
- inventory_hostname == groups['keystone_all'][0]
tags:
- aodh-rabbitmq
- aodh-rabbitmq-user
- keystone-rabbitmq
- keystone-rabbitmq-user
- name: Keystone create DB for service
mysql_db:
login_user: "{{ galera_root_user }}"

View File

@ -90,7 +90,31 @@
when: is_metal | bool
tags:
- neutron-logs
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ neutron_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['neutron_all'][0]
tags:
- neutron-rabbitmq
- neutron-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ neutron_rabbitmq_userid }}"
password: "{{ neutron_rabbitmq_password }}"
vhost: "{{ neutron_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['neutron_all'][0]
tags:
- neutron-rabbitmq
- neutron-rabbitmq-user
- name: Create the neutron provider networks facts
provider_networks:
provider_networks: "{{ provider_networks }}"
@ -150,3 +174,8 @@
galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
bind_prefix: "{{ provider_network_bind_prefix|default('') }}"
neutron_rabbitmq_userid: neutron
neutron_rabbitmq_vhost: /neutron
neutron_rabbitmq_servers: "{{ rabbitmq_servers }}"
neutron_rabbitmq_port: "{{ rabbitmq_port }}"
neutron_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"

View File

@ -123,6 +123,31 @@
when: is_metal | bool
tags:
- nova-logs
- name: Ensure Rabbitmq vhost
rabbitmq_vhost:
name: "{{ nova_rabbitmq_vhost }}"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['nova_all'][0]
tags:
- nova-rabbitmq
- nova-rabbitmq-vhost
- name: Ensure rabbitmq user
rabbitmq_user:
user: "{{ nova_rabbitmq_userid }}"
password: "{{ nova_rabbitmq_password }}"
vhost: "{{ nova_rabbitmq_vhost }}"
configure_priv: ".*"
read_priv: ".*"
write_priv: ".*"
state: "present"
delegate_to: "{{ groups['rabbitmq_all'][0] }}"
when:
- inventory_hostname == groups['nova_all'][0]
tags:
- nova-rabbitmq
- nova-rabbitmq-user
- name: Set nova management bridge (is_metal)
set_fact:
management_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['management_bridge'] | replace('-', '_') }}"
@ -191,3 +216,8 @@
galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}"
glance_host: "{{ internal_lb_vip_address }}"
nova_rabbitmq_userid: nova
nova_rabbitmq_vhost: /nova
nova_rabbitmq_servers: "{{ rabbitmq_servers }}"
nova_rabbitmq_port: "{{ rabbitmq_port }}"
nova_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}"