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: tags:
- aodh-logs - aodh-logs
- aodh-log-dirs - 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: roles:
- role: "os_aodh" - role: "os_aodh"
aodh_venv_tag: "{{ openstack_release }}" aodh_venv_tag: "{{ openstack_release }}"
@ -75,3 +100,8 @@
- "aodh-rsyslog-client" - "aodh-rsyslog-client"
vars: vars:
is_metal: "{{ properties.is_metal|default(false) }}" 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 when: is_metal | bool
tags: tags:
- ceilometer-logs - 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: roles:
- role: "os_ceilometer" - role: "os_ceilometer"
ceilometer_venv_tag: "{{ openstack_release }}" ceilometer_venv_tag: "{{ openstack_release }}"
@ -87,3 +112,8 @@
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}" 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 when: is_metal | bool
tags: tags:
- cinder-logs - 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) - name: Set cinder storage bridge (is_metal)
set_fact: set_fact:
storage_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['container_networks']['storage_address']['bridge'] | replace('-', '_') }}" storage_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['container_networks']['storage_address']['bridge'] | replace('-', '_') }}"
@ -180,3 +205,8 @@
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}" 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 when: is_metal | bool
tags: tags:
- glance-logs - 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: roles:
- role: "os_glance" - role: "os_glance"
glance_galera_address: "{{ galera_address }}" glance_galera_address: "{{ galera_address }}"
@ -114,3 +139,8 @@
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}" 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 when: is_metal | bool
tags: tags:
- heat-logs - 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: roles:
- role: "os_heat" - role: "os_heat"
heat_venv_tag: "{{ openstack_release }}" heat_venv_tag: "{{ openstack_release }}"
@ -91,5 +116,10 @@
vars: vars:
galera_address: "{{ internal_lb_vip_address }}" galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}" 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: vars_files:
- defaults/repo_packages/openstack_services.yml - defaults/repo_packages/openstack_services.yml

View File

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

View File

@ -90,7 +90,31 @@
when: is_metal | bool when: is_metal | bool
tags: tags:
- neutron-logs - 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 - name: Create the neutron provider networks facts
provider_networks: provider_networks:
provider_networks: "{{ provider_networks }}" provider_networks: "{{ provider_networks }}"
@ -150,3 +174,8 @@
galera_address: "{{ internal_lb_vip_address }}" galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"
bind_prefix: "{{ provider_network_bind_prefix|default('') }}" 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 when: is_metal | bool
tags: tags:
- nova-logs - 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) - name: Set nova management bridge (is_metal)
set_fact: set_fact:
management_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['management_bridge'] | replace('-', '_') }}" management_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['management_bridge'] | replace('-', '_') }}"
@ -191,3 +216,8 @@
galera_address: "{{ internal_lb_vip_address }}" galera_address: "{{ internal_lb_vip_address }}"
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"
glance_host: "{{ internal_lb_vip_address }}" 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 }}"