From 75b36283fac8e32c2b99f318cbeb309b3036f89d Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Wed, 20 Jul 2016 11:13:02 -0400 Subject: [PATCH] Support multiple rabbitmq clusters The rabbitmq-install play now supports a variable inventory host group defined with *rabbitmq_host_group*. This allows deployers to use the play to create multiple RabbitMQ clusters using for example: Typical infra cluster: openstack-ansible rabbitmq-install.yml Second cluster for telemetry: openstack-ansible -e "rabbitmq_host_group=telemetry_rabbitmq_all" rabbitmq-install.yml Many vars were moved from group-specific group_vars to the "all" group as the ceilometer role/play requires the RabbitMQ details and telemetry enabled state for all services that can potentially be monitored by ceilometer. By default, the "telemetry cluster" and the "RPC" cluster are the same, but deployers that wish to create multiple clusters are able to override the *_rabbitmq_telemetry_* vars when choosing to run separate clusters. Use case is more fully explained here: http://trumant.github.io/openstack-ansible-multiple-rabbitmq-clusters.html Change-Id: I737711085fc0e50c4c5a0ee7c2037927574f8448 Depends-On: Ib23c8829468bbb4ddae67e08a092240f54a6c729 Depends-On: Ifad921525897c5887f6ad6871c6d72c595d79fa6 Depends-On: I7cc5a5dac4299bd3d1bc810ea886f3888abaa2da Depends-On: Ib3ee5b409dbc2fc2dc8d25990d4962ec49e21131 Depends-On: I397b56423d9ef6757bada27c92b7c9f0d5126cc9 Depends-On: I98cb273cbd8948072ef6e7fc5a15834093d70099 Depends-On: I89363b64ff3f41ee65d72ec51cb8062fc7bf08b0 Implements: blueprint multi-rabbitmq-clusters --- .../common-tasks/rabbitmq-vhost-user.yml | 4 +- playbooks/inventory/group_vars/all.yml | 153 ++++++++++++++++-- playbooks/inventory/group_vars/cinder_all.yml | 3 - playbooks/inventory/group_vars/glance_all.yml | 3 - playbooks/inventory/group_vars/heat_all.yml | 3 - .../inventory/group_vars/keystone_all.yml | 3 - .../inventory/group_vars/neutron_all.yml | 9 -- playbooks/inventory/group_vars/nova_all.yml | 3 - playbooks/os-aodh-install.yml | 3 +- playbooks/os-ceilometer-install.yml | 6 +- playbooks/os-cinder-install.yml | 18 ++- playbooks/os-glance-install.yml | 20 ++- playbooks/os-heat-install.yml | 20 ++- playbooks/os-ironic-install.yml | 3 +- playbooks/os-keystone-install.yml | 20 ++- playbooks/os-neutron-install.yml | 15 +- playbooks/os-nova-install.yml | 20 ++- playbooks/rabbitmq-install.yml | 6 +- 18 files changed, 234 insertions(+), 78 deletions(-) diff --git a/playbooks/common-tasks/rabbitmq-vhost-user.yml b/playbooks/common-tasks/rabbitmq-vhost-user.yml index d9202e58ce..357f9ba7ab 100644 --- a/playbooks/common-tasks/rabbitmq-vhost-user.yml +++ b/playbooks/common-tasks/rabbitmq-vhost-user.yml @@ -22,7 +22,7 @@ rabbitmq_vhost: name: "{{ vhost }}" state: "present" - delegate_to: "{{ groups['rabbitmq_all'][0] }}" + delegate_to: "{{ groups[_rabbitmq_host_group][0] }}" - name: Ensure rabbitmq user rabbitmq_user: @@ -33,4 +33,4 @@ read_priv: ".*" write_priv: ".*" state: "present" - delegate_to: "{{ groups['rabbitmq_all'][0] }}" + delegate_to: "{{ groups[_rabbitmq_host_group][0] }}" diff --git a/playbooks/inventory/group_vars/all.yml b/playbooks/inventory/group_vars/all.yml index eb974a3068..2a406307dd 100644 --- a/playbooks/inventory/group_vars/all.yml +++ b/playbooks/inventory/group_vars/all.yml @@ -67,11 +67,11 @@ galera_address: "{{ internal_lb_vip_address }}" galera_root_user: "root" ## RabbitMQ +rabbitmq_host_group: "rabbitmq_all" rabbitmq_port: "{{ (rabbitmq_use_ssl | bool) | ternary(5671, 5672) }}" -rabbitmq_servers: "{% for host in groups['rabbitmq_all'] %}{{ hostvars[host]['ansible_ssh_host'] }}{% if not loop.last %},{% endif %}{% endfor %}" -# TODO(odyssey4me) -# The new transport_url configuration option is not working with SSL enabled. Revisit this ASAP. -rabbitmq_use_ssl: false + +rabbitmq_use_ssl: True +rabbitmq_servers: "{% for host in groups[rabbitmq_host_group] %}{{ hostvars[host]['ansible_ssh_host'] }}{% if not loop.last %},{% endif %}{% endfor %}" ## Enable external SSL handling for general OpenStack services openstack_external_ssl: true @@ -106,15 +106,22 @@ aodh_galera_user: aodh aodh_galera_database: aodh aodh_galera_address: "{{ internal_lb_vip_address }}" aodh_connection_string: "mysql+pymysql://{{ aodh_galera_user }}:{{ aodh_container_db_password }}@{{ aodh_galera_address }}/{{ aodh_galera_database }}?charset=utf8" +aodh_rabbitmq_host_group: "{{ rabbitmq_host_group }}" ## Ceilometer ceilometer_service_user_name: ceilometer ceilometer_service_tenant_name: service + +# These are here rather than in ceilometer_all because +# both the os_ceilometer and os_swift roles require them ceilometer_rabbitmq_userid: ceilometer ceilometer_rabbitmq_vhost: /ceilometer -ceilometer_rabbitmq_host_group: "rabbitmq_all" ceilometer_rabbitmq_port: "{{ rabbitmq_port }}" +ceilometer_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +ceilometer_rabbitmq_servers: "{{ rabbitmq_servers }}" +ceilometer_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + ## Cinder # If there are Swift hosts in the environment, then enable cinder backups to it @@ -134,10 +141,29 @@ cinder_backends_rbd_inuse: > endfor %}{{ _var.rbd_inuse }} cinder_ceph_client: cinder + +# These are here rather than in cinder_all because +# both the os_ceilometer and os_cinder roles require them + +# RPC cinder_rabbitmq_userid: cinder cinder_rabbitmq_vhost: /cinder -cinder_rabbitmq_host_group: "rabbitmq_all" cinder_rabbitmq_port: "{{ rabbitmq_port }}" +cinder_rabbitmq_servers: "{{ rabbitmq_servers }}" +cinder_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +cinder_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +cinder_rabbitmq_telemetry_userid: "{{ cinder_rabbitmq_userid }}" +cinder_rabbitmq_telemetry_password: "{{ cinder_rabbitmq_password }}" +cinder_rabbitmq_telemetry_vhost: "{{ cinder_rabbitmq_vhost }}" +cinder_rabbitmq_telemetry_port: "{{ cinder_rabbitmq_port }}" +cinder_rabbitmq_telemetry_servers: "{{ cinder_rabbitmq_servers }}" +cinder_rabbitmq_telemetry_use_ssl: "{{ cinder_rabbitmq_use_ssl }}" +cinder_rabbitmq_telemetry_host_group: "{{ cinder_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +cinder_ceilometer_enabled: "{{ (groups['cinder_all'] is defined) and (groups['cinder_all'] | length > 0) and (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" ## Glance glance_service_port: 9292 @@ -153,16 +179,57 @@ glance_service_adminuri: "{{ glance_service_adminuri_proto }}://{{ internal_lb_v glance_service_adminurl: "{{ glance_service_adminuri }}" glance_api_servers: "{{ glance_service_internaluri }}" glance_service_user_name: glance + +# These are here rather than in glance_all because +# both the os_ceilometer and os_glance roles require them + +# RPC glance_rabbitmq_userid: glance glance_rabbitmq_vhost: /glance -glance_rabbitmq_host_group: "rabbitmq_all" glance_rabbitmq_port: "{{ rabbitmq_port }}" +glance_rabbitmq_servers: "{{ rabbitmq_servers }}" +glance_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +glance_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +glance_rabbitmq_telemetry_userid: "{{ glance_rabbitmq_userid }}" +glance_rabbitmq_telemetry_password: "{{ glance_rabbitmq_password }}" +glance_rabbitmq_telemetry_vhost: "{{ glance_rabbitmq_vhost }}" +glance_rabbitmq_telemetry_port: "{{ glance_rabbitmq_port }}" +glance_rabbitmq_telemetry_servers: "{{ glance_rabbitmq_servers }}" +glance_rabbitmq_telemetry_use_ssl: "{{ glance_rabbitmq_use_ssl }}" +glance_rabbitmq_telemetry_host_group: "{{ glance_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +glance_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" ## Heat + +# These are here rather than in heat_all because +# both the os_ceilometer and os_heat roles require them + +# RPC heat_rabbitmq_userid: heat heat_rabbitmq_vhost: /heat -heat_rabbitmq_host_group: "rabbitmq_all" heat_rabbitmq_port: "{{ rabbitmq_port }}" +heat_rabbitmq_servers: "{{ rabbitmq_servers }}" +heat_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +heat_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +heat_rabbitmq_telemetry_userid: "{{ heat_rabbitmq_userid }}" +heat_rabbitmq_telemetry_password: "{{ heat_rabbitmq_password }}" +heat_rabbitmq_telemetry_vhost: "{{ heat_rabbitmq_vhost }}" +heat_rabbitmq_telemetry_port: "{{ heat_rabbitmq_port }}" +heat_rabbitmq_telemetry_servers: "{{ heat_rabbitmq_servers }}" +heat_rabbitmq_telemetry_use_ssl: "{{ heat_rabbitmq_use_ssl }}" +heat_rabbitmq_telemetry_host_group: "{{ heat_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +heat_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" + +## Ironic +ironic_rabbitmq_host_group: "{{ rabbitmq_host_group }}" ## Keystone keystone_admin_user_name: admin @@ -171,10 +238,29 @@ keystone_admin_port: 35357 keystone_service_port: 5000 keystone_service_proto: http keystone_service_region: "{{ service_region }}" + +# These are here rather than in keystone_all because +# both the os_ceilometer and os_keystone roles require them + +# RPC keystone_rabbitmq_userid: keystone keystone_rabbitmq_vhost: /keystone -keystone_rabbitmq_host_group: "rabbitmq_all" keystone_rabbitmq_port: "{{ rabbitmq_port }}" +keystone_rabbitmq_servers: "{{ rabbitmq_servers }}" +keystone_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +keystone_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +keystone_rabbitmq_telemetry_userid: "{{ keystone_rabbitmq_userid }}" +keystone_rabbitmq_telemetry_password: "{{ keystone_rabbitmq_password }}" +keystone_rabbitmq_telemetry_vhost: "{{ keystone_rabbitmq_vhost }}" +keystone_rabbitmq_telemetry_port: "{{ keystone_rabbitmq_port }}" +keystone_rabbitmq_telemetry_servers: "{{ keystone_rabbitmq_servers }}" +keystone_rabbitmq_telemetry_use_ssl: "{{ keystone_rabbitmq_use_ssl }}" +keystone_rabbitmq_telemetry_host_group: "{{ keystone_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +keystone_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" keystone_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(keystone_service_proto) }}" keystone_service_adminuri_insecure: "{% if keystone_service_adminuri_proto == 'https' and (keystone_user_ssl_cert is not defined or haproxy_user_ssl_cert is not defined) | bool %}true{% else %}false{% endif %}" @@ -195,10 +281,30 @@ neutron_service_adminurl: "{{ neutron_service_adminuri }}" neutron_service_user_name: neutron neutron_service_project_name: service neutron_service_region: "{{ service_region }}" + +# These are here rather than in neutron_all because +# both the os_ceilometer and os_neutron roles require them + +# RPC neutron_rabbitmq_userid: neutron neutron_rabbitmq_vhost: /neutron -neutron_rabbitmq_host_group: "rabbitmq_all" neutron_rabbitmq_port: "{{ rabbitmq_port }}" +neutron_rabbitmq_servers: "{{ rabbitmq_servers }}" +neutron_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +neutron_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +neutron_rabbitmq_telemetry_userid: "{{ neutron_rabbitmq_userid }}" +neutron_rabbitmq_telemetry_password: "{{ neutron_rabbitmq_password }}" +neutron_rabbitmq_telemetry_vhost: "{{ neutron_rabbitmq_vhost }}" +neutron_rabbitmq_telemetry_port: "{{ neutron_rabbitmq_port }}" +neutron_rabbitmq_telemetry_servers: "{{ neutron_rabbitmq_servers }}" +neutron_rabbitmq_telemetry_use_ssl: "{{ neutron_rabbitmq_use_ssl }}" +neutron_rabbitmq_telemetry_host_group: "{{ neutron_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +neutron_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" + neutron_plugin_type: ml2.lxb ## Nova @@ -213,16 +319,35 @@ nova_service_user_name: nova nova_service_project_name: service nova_service_project_domain_id: default nova_service_user_domain_id: default -nova_rabbitmq_userid: nova -nova_rabbitmq_vhost: /nova -nova_rabbitmq_host_group: "rabbitmq_all" -nova_rabbitmq_port: "{{ rabbitmq_port }}" nova_keystone_auth_plugin: password nova_console_type: spice nova_novncproxy_port: 6080 nova_spice_html5proxy_base_port: 6082 nova_console_port: "{% if nova_console_type == 'spice' %}{{ nova_spice_html5proxy_base_port }}{% else %}{{ nova_novncproxy_port }}{% endif %}" +# These are here rather than in nova_all because +# both the os_ceilometer and os_nova roles require them + +# RPC +nova_rabbitmq_userid: nova +nova_rabbitmq_vhost: /nova +nova_rabbitmq_port: "{{ rabbitmq_port }}" +nova_rabbitmq_servers: "{{ rabbitmq_servers }}" +nova_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" +nova_rabbitmq_host_group: "{{ rabbitmq_host_group }}" + +# Telemetry notifications +nova_rabbitmq_telemetry_userid: "{{ nova_rabbitmq_userid }}" +nova_rabbitmq_telemetry_password: "{{ nova_rabbitmq_password }}" +nova_rabbitmq_telemetry_vhost: "{{ nova_rabbitmq_vhost }}" +nova_rabbitmq_telemetry_port: "{{ nova_rabbitmq_port }}" +nova_rabbitmq_telemetry_servers: "{{ nova_rabbitmq_servers }}" +nova_rabbitmq_telemetry_use_ssl: "{{ nova_rabbitmq_use_ssl }}" +nova_rabbitmq_telemetry_host_group: "{{ nova_rabbitmq_host_group }}" + +# If there are any Ceilometer hosts in the environment, then enable its usage +nova_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" + ## Swift swift_system_user_name: swift diff --git a/playbooks/inventory/group_vars/cinder_all.yml b/playbooks/inventory/group_vars/cinder_all.yml index 57ceb0966f..2fb8ca7be8 100644 --- a/playbooks/inventory/group_vars/cinder_all.yml +++ b/playbooks/inventory/group_vars/cinder_all.yml @@ -25,8 +25,5 @@ cinder_service_in_ldap: "{{ service_ldap_backend_enabled }}" cinder_glance_api_servers: "{{ glance_api_servers }}" cinder_glance_api_version: "{{ (cinder_backends_rbd_inuse|bool and glance_default_store == 'rbd') | ternary('2','1') }}" -# If there are any Ceilometer hosts in the environment, then enable its usage -cinder_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" - # Ensure that the package state matches the global setting cinder_package_state: "{{ package_state }}" diff --git a/playbooks/inventory/group_vars/glance_all.yml b/playbooks/inventory/group_vars/glance_all.yml index 3de9f9cf4d..279223cd86 100644 --- a/playbooks/inventory/group_vars/glance_all.yml +++ b/playbooks/inventory/group_vars/glance_all.yml @@ -16,9 +16,6 @@ glance_service_region: "{{ service_region }}" glance_service_in_ldap: "{{ service_ldap_backend_enabled }}" -# If there are any Ceilometer hosts in the environment, then enable its usage -glance_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" - # If there are Swift hosts in the environment, then use it as the default Glance store glance_default_store: "{{ ((groups['swift_all'] is defined) and (groups['swift_all'] | length > 0)) | ternary('swift', 'file') }}" diff --git a/playbooks/inventory/group_vars/heat_all.yml b/playbooks/inventory/group_vars/heat_all.yml index 3423fbdc9a..adff6a8c98 100644 --- a/playbooks/inventory/group_vars/heat_all.yml +++ b/playbooks/inventory/group_vars/heat_all.yml @@ -16,8 +16,5 @@ heat_service_region: "{{ service_region }}" heat_service_in_ldap: "{{ service_ldap_backend_enabled }}" -# If there are any Ceilometer hosts in the environment, then enable its usage -heat_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" - # Ensure that the package state matches the global setting heat_package_state: "{{ package_state }}" diff --git a/playbooks/inventory/group_vars/keystone_all.yml b/playbooks/inventory/group_vars/keystone_all.yml index ff220bcfe0..97478cbc41 100644 --- a/playbooks/inventory/group_vars/keystone_all.yml +++ b/playbooks/inventory/group_vars/keystone_all.yml @@ -19,8 +19,5 @@ keystone_cache_backend_argument: "url:{% for host in groups['memcached'] %}{{ ho keystone_memcached_servers: "{% for host in groups['keystone_all'] %}{{ hostvars[host]['container_address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}" keystone_service_in_ldap: "{{ service_ldap_backend_enabled }}" -# If there are any Ceilometer hosts in the environment, then enable its usage -keystone_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" - # Ensure that the package state matches the global setting keystone_package_state: "{{ package_state }}" diff --git a/playbooks/inventory/group_vars/neutron_all.yml b/playbooks/inventory/group_vars/neutron_all.yml index d54aab95aa..a8ad6ce445 100644 --- a/playbooks/inventory/group_vars/neutron_all.yml +++ b/playbooks/inventory/group_vars/neutron_all.yml @@ -20,14 +20,5 @@ neutron_galera_user: neutron neutron_galera_database: neutron neutron_galera_address: "{{ galera_address }}" -neutron_rabbitmq_userid: neutron -neutron_rabbitmq_vhost: /neutron -neutron_rabbitmq_port: "{{ rabbitmq_port }}" -neutron_rabbitmq_servers: "{{ rabbitmq_servers }}" -neutron_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" - -# If there are any Ceilometer hosts in the environment, then enable its usage -neutron_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" - # Ensure that the package state matches the global setting neutron_package_state: "{{ package_state }}" diff --git a/playbooks/inventory/group_vars/nova_all.yml b/playbooks/inventory/group_vars/nova_all.yml index ce9e744240..9931ef6208 100644 --- a/playbooks/inventory/group_vars/nova_all.yml +++ b/playbooks/inventory/group_vars/nova_all.yml @@ -19,8 +19,5 @@ nova_dhcp_domain: "{{ dhcp_domain }}" nova_service_in_ldap: "{{ service_ldap_backend_enabled }}" nova_glance_api_servers: "{{ glance_api_servers }}" -# If there are any Ceilometer hosts in the environment, then enable its usage -nova_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}" - # Ensure that the package state matches the global setting nova_package_state: "{{ package_state }}" diff --git a/playbooks/os-aodh-install.yml b/playbooks/os-aodh-install.yml index 86f415f90a..ee5cd54b9a 100644 --- a/playbooks/os-aodh-install.yml +++ b/playbooks/os-aodh-install.yml @@ -28,9 +28,10 @@ user: "{{ aodh_rabbitmq_userid }}" password: "{{ aodh_rabbitmq_password }}" vhost: "{{ aodh_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ aodh_rabbitmq_host_group }}" when: - inventory_hostname == groups['aodh_api'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[aodh_rabbitmq_host_group] | length > 0 - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: diff --git a/playbooks/os-ceilometer-install.yml b/playbooks/os-ceilometer-install.yml index 21d5306747..08e149ff4e 100644 --- a/playbooks/os-ceilometer-install.yml +++ b/playbooks/os-ceilometer-install.yml @@ -28,9 +28,10 @@ user: "{{ ceilometer_rabbitmq_userid }}" password: "{{ ceilometer_rabbitmq_password }}" vhost: "{{ ceilometer_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ ceilometer_rabbitmq_host_group }}" when: - inventory_hostname == groups['ceilometer_api'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[ceilometer_rabbitmq_host_group] | length > 0 - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: @@ -52,7 +53,4 @@ - "ceilometer-rsyslog-client" vars: is_metal: "{{ properties.is_metal|default(false) }}" - ceilometer_rabbitmq_servers: "{{ rabbitmq_servers }}" - ceilometer_rabbitmq_port: "{{ rabbitmq_port }}" - ceilometer_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}" diff --git a/playbooks/os-cinder-install.yml b/playbooks/os-cinder-install.yml index 680889caf3..d3d876ac8f 100644 --- a/playbooks/os-cinder-install.yml +++ b/playbooks/os-cinder-install.yml @@ -40,9 +40,22 @@ user: "{{ cinder_rabbitmq_userid }}" password: "{{ cinder_rabbitmq_password }}" vhost: "{{ cinder_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ cinder_rabbitmq_host_group }}" when: - inventory_hostname == groups['cinder_all'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[cinder_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + vars: + user: "{{ cinder_rabbitmq_telemetry_userid }}" + password: "{{ cinder_rabbitmq_telemetry_password }}" + vhost: "{{ cinder_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ cinder_rabbitmq_telemetry_host_group }}" + when: + - cinder_ceilometer_enabled | bool + - inventory_hostname == groups['cinder_all'][0] + - groups[cinder_rabbitmq_telemetry_host_group] is defined + - groups[cinder_rabbitmq_telemetry_host_group] | length > 0 + - groups[cinder_rabbitmq_telemetry_host_group] != groups[cinder_rabbitmq_host_group] - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: @@ -152,7 +165,4 @@ cinder_galera_user: cinder cinder_galera_database: cinder cinder_galera_address: "{{ galera_address }}" - cinder_rabbitmq_servers: "{{ rabbitmq_servers }}" - cinder_rabbitmq_port: "{{ rabbitmq_port }}" - cinder_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}" diff --git a/playbooks/os-glance-install.yml b/playbooks/os-glance-install.yml index c749d63ec9..304161e95f 100644 --- a/playbooks/os-glance-install.yml +++ b/playbooks/os-glance-install.yml @@ -35,9 +35,22 @@ user: "{{ glance_rabbitmq_userid }}" password: "{{ glance_rabbitmq_password }}" vhost: "{{ glance_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ glance_rabbitmq_host_group }}" when: - inventory_hostname == groups['glance_all'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[glance_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + vars: + user: "{{ glance_rabbitmq_telemetry_userid }}" + password: "{{ glance_rabbitmq_telemetry_password }}" + vhost: "{{ glance_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ glance_rabbitmq_telemetry_host_group }}" + when: + - glance_ceilometer_enabled | bool + - inventory_hostname == groups['glance_all'][0] + - groups[glance_rabbitmq_telemetry_host_group] is defined + - groups[glance_rabbitmq_telemetry_host_group] | length > 0 + - groups[glance_rabbitmq_telemetry_host_group] != groups[glance_rabbitmq_host_group] - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: @@ -80,9 +93,4 @@ glance_galera_user: glance glance_galera_database: glance glance_galera_address: "{{ galera_address }}" - 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 }}" pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}" diff --git a/playbooks/os-heat-install.yml b/playbooks/os-heat-install.yml index a5c65d9cd2..9ffe025727 100644 --- a/playbooks/os-heat-install.yml +++ b/playbooks/os-heat-install.yml @@ -28,9 +28,22 @@ user: "{{ heat_rabbitmq_userid }}" password: "{{ heat_rabbitmq_password }}" vhost: "{{ heat_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ heat_rabbitmq_host_group }}" when: - inventory_hostname == groups['heat_all'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[heat_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + vars: + user: "{{ heat_rabbitmq_telemetry_userid }}" + password: "{{ heat_rabbitmq_telemetry_password }}" + vhost: "{{ heat_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ heat_rabbitmq_telemetry_host_group }}" + when: + - heat_ceilometer_enabled | bool + - inventory_hostname == groups['heat_all'][0] + - groups[heat_rabbitmq_telemetry_host_group] is defined + - groups[heat_rabbitmq_telemetry_host_group] | length > 0 + - groups[heat_rabbitmq_telemetry_host_group] != groups[heat_rabbitmq_host_group] - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: @@ -65,11 +78,6 @@ heat_galera_user: heat heat_galera_database: heat heat_galera_address: "{{ galera_address }}" - 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 }}" pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}" vars_files: - defaults/repo_packages/openstack_services.yml diff --git a/playbooks/os-ironic-install.yml b/playbooks/os-ironic-install.yml index 35d60876d9..a717768a26 100644 --- a/playbooks/os-ironic-install.yml +++ b/playbooks/os-ironic-install.yml @@ -27,9 +27,10 @@ user: "{{ ironic_rabbitmq_userid }}" password: "{{ ironic_rabbitmq_password }}" vhost: "{{ ironic_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ ironic_rabbitmq_host_group }}" when: - inventory_hostname == groups['ironic_all'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[ironic_rabbitmq_host_group] | length > 0 - include: common-tasks/mysql-db-user.yml vars: user_name: "{{ ironic_galera_user }}" diff --git a/playbooks/os-keystone-install.yml b/playbooks/os-keystone-install.yml index 620322161b..c023ec7347 100644 --- a/playbooks/os-keystone-install.yml +++ b/playbooks/os-keystone-install.yml @@ -28,9 +28,22 @@ user: "{{ keystone_rabbitmq_userid }}" password: "{{ keystone_rabbitmq_password }}" vhost: "{{ keystone_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ keystone_rabbitmq_host_group }}" when: - inventory_hostname == groups['keystone_all'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[keystone_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + vars: + user: "{{ keystone_rabbitmq_telemetry_userid }}" + password: "{{ keystone_rabbitmq_telemetry_password }}" + vhost: "{{ keystone_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ keystone_rabbitmq_telemetry_host_group }}" + when: + - keystone_ceilometer_enabled | bool + - inventory_hostname == groups['keystone_all'][0] + - groups[keystone_rabbitmq_telemetry_host_group] is defined + - groups[keystone_rabbitmq_telemetry_host_group] | length > 0 + - groups[keystone_rabbitmq_telemetry_host_group] != groups[keystone_rabbitmq_host_group] - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: @@ -85,9 +98,4 @@ keystone_galera_user: keystone keystone_galera_database: keystone keystone_galera_address: "{{ galera_address }}" - keystone_rabbitmq_userid: keystone - keystone_rabbitmq_vhost: /keystone - keystone_rabbitmq_servers: "{{ rabbitmq_servers }}" - keystone_rabbitmq_port: "{{ rabbitmq_port }}" - keystone_rabbitmq_use_ssl: "{{ rabbitmq_use_ssl }}" pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}" diff --git a/playbooks/os-neutron-install.yml b/playbooks/os-neutron-install.yml index 062379fe36..1cddfbcd01 100644 --- a/playbooks/os-neutron-install.yml +++ b/playbooks/os-neutron-install.yml @@ -38,9 +38,22 @@ user: "{{ neutron_rabbitmq_userid }}" password: "{{ neutron_rabbitmq_password }}" vhost: "{{ neutron_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ neutron_rabbitmq_host_group }}" when: - inventory_hostname == groups['neutron_all'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[neutron_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + vars: + user: "{{ neutron_rabbitmq_telemetry_userid }}" + password: "{{ neutron_rabbitmq_telemetry_password }}" + vhost: "{{ neutron_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ neutron_rabbitmq_telemetry_host_group }}" + when: + - neutron_ceilometer_enabled | bool + - inventory_hostname == groups['neutron_all'][0] + - groups[neutron_rabbitmq_telemetry_host_group] is defined + - groups[neutron_rabbitmq_telemetry_host_group] | length > 0 + - groups[neutron_rabbitmq_telemetry_host_group] != groups[neutron_rabbitmq_host_group] - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: diff --git a/playbooks/os-nova-install.yml b/playbooks/os-nova-install.yml index 97c13abe59..ca45125001 100644 --- a/playbooks/os-nova-install.yml +++ b/playbooks/os-nova-install.yml @@ -28,9 +28,22 @@ user: "{{ nova_rabbitmq_userid }}" password: "{{ nova_rabbitmq_password }}" vhost: "{{ nova_rabbitmq_vhost }}" + _rabbitmq_host_group: "{{ nova_rabbitmq_host_group }}" when: - inventory_hostname == groups['nova_all'][0] - - groups['rabbitmq_all'] | length > 0 + - groups[nova_rabbitmq_host_group] | length > 0 + - include: common-tasks/rabbitmq-vhost-user.yml + vars: + user: "{{ nova_rabbitmq_telemetry_userid }}" + password: "{{ nova_rabbitmq_telemetry_password }}" + vhost: "{{ nova_rabbitmq_telemetry_vhost }}" + _rabbitmq_host_group: "{{ nova_rabbitmq_telemetry_host_group }}" + when: + - nova_ceilometer_enabled | bool + - inventory_hostname == groups['nova_all'][0] + - groups[nova_rabbitmq_telemetry_host_group] is defined + - groups[nova_rabbitmq_telemetry_host_group] | length > 0 + - groups[nova_rabbitmq_telemetry_host_group] != groups[nova_rabbitmq_host_group] - include: common-tasks/os-log-dir-setup.yml vars: log_dirs: @@ -178,9 +191,4 @@ nova_galera_address: "{{ galera_address }}" nova_api_galera_address: "{{ galera_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 }}" pip_lock_to_internal_repo: "{{ (pip_links | length) >= 1 }}" diff --git a/playbooks/rabbitmq-install.yml b/playbooks/rabbitmq-install.yml index a358b3348c..bf2765c226 100644 --- a/playbooks/rabbitmq-install.yml +++ b/playbooks/rabbitmq-install.yml @@ -14,7 +14,7 @@ # limitations under the License. - name: Create and configure rabbitmq container - hosts: rabbitmq_all + hosts: "{{ rabbitmq_host_group | default('rabbitmq_all') }}" gather_facts: "{{ gather_facts | default(True) }}" max_fail_percentage: 0 user: root @@ -31,7 +31,7 @@ # NOTE(mancdaz): rabbitmq cannot be upgraded in serial, so when # rabbitmq_upgrade=True, serial is set to 0, else it is 1 for installs - name: Install rabbitmq server - hosts: rabbitmq_all + hosts: "{{ rabbitmq_host_group | default('rabbitmq_all') }}" serial: "{{ rabbitmq_upgrade|default(false) | bool | ternary(0, 1)}}" max_fail_percentage: 20 user: root @@ -49,7 +49,7 @@ - "rsyslog-client" - name: Ensure rabbitmq user for monitoring GUI - hosts: rabbitmq_all[0] + hosts: "{{ rabbitmq_host_group | default('rabbitmq_all') }}[0]" user: root tasks: - name: Create rabbitmq user for monitoring GUI