diff --git a/playbooks/os-aodh-install.yml b/playbooks/os-aodh-install.yml index cec6581b82..6857ea4ccf 100644 --- a/playbooks/os-aodh-install.yml +++ b/playbooks/os-aodh-install.yml @@ -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 }}" diff --git a/playbooks/os-ceilometer-install.yml b/playbooks/os-ceilometer-install.yml index 88e5e85c23..6123684544 100644 --- a/playbooks/os-ceilometer-install.yml +++ b/playbooks/os-ceilometer-install.yml @@ -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 }}" diff --git a/playbooks/os-cinder-install.yml b/playbooks/os-cinder-install.yml index 622b4b93be..ebc66ed7cd 100644 --- a/playbooks/os-cinder-install.yml +++ b/playbooks/os-cinder-install.yml @@ -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 }}" diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index 3c0f7a9f44..e6427278a9 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-install.yml @@ -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 }}" diff --git a/playbooks/os-heat-install.yml b/playbooks/os-heat-install.yml index d539d67772..591563af02 100644 --- a/playbooks/os-heat-install.yml +++ b/playbooks/os-heat-install.yml @@ -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 diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index 027ada6321..c74432d772 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -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 }}" diff --git a/playbooks/os-neutron-install.yml b/playbooks/os-neutron-install.yml index ef1a37ce99..f776c2f02c 100644 --- a/playbooks/os-neutron-install.yml +++ b/playbooks/os-neutron-install.yml @@ -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 }}" diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index 68f5e00ec2..32b714b0b3 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -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 }}"