Add variables for rabbitmq ssl configuration

Change-Id: I1de3f5225dfb580ac8e9616bc55436151cdabe76
This commit is contained in:
Jonathan Rosser 2021-05-17 09:23:40 +00:00
parent ff0dc5a9fa
commit a79b6b3968
2 changed files with 45 additions and 15 deletions

View File

@ -62,6 +62,8 @@ ceilometer_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}"
ceilometer_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}"
ceilometer_oslomsg_rpc_userid: ceilometer
ceilometer_oslomsg_rpc_vhost: /ceilometer
ceilometer_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
ceilometer_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
ceilometer_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -72,6 +74,8 @@ ceilometer_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }
ceilometer_oslomsg_notify_userid: "{{ ceilometer_oslomsg_rpc_userid }}"
ceilometer_oslomsg_notify_password: "{{ ceilometer_oslomsg_rpc_password }}"
ceilometer_oslomsg_notify_vhost: "{{ ceilometer_oslomsg_rpc_vhost }}"
ceilometer_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
ceilometer_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Cinder notifications
cinder_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -81,6 +85,8 @@ cinder_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
cinder_oslomsg_notify_userid: "{{ cinder_oslomsg_rpc_userid | default('cinder') }}"
cinder_oslomsg_notify_password: "{{ cinder_ceilometer_enabled | ternary(cinder_oslomsg_rpc_password, '') }}"
cinder_oslomsg_notify_vhost: "{{ cinder_oslomsg_rpc_vhost | default('/cinder') }}"
cinder_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
cinder_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Designate notifications
designate_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -90,6 +96,8 @@ designate_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}
designate_oslomsg_notify_userid: "{{ designate_oslomsg_rpc_userid | default('designate-rpc') }}"
designate_oslomsg_notify_password: "{{ designate_ceilometer_enabled | ternary(designate_oslomsg_rpc_password, '') }}"
designate_oslomsg_notify_vhost: "{{ designate_oslomsg_rpc_vhost | default('/designate') }}"
designate_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
designate_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Glance notifications
glance_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -99,6 +107,8 @@ glance_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
glance_oslomsg_notify_userid: "{{ glance_oslomsg_rpc_userid | default('glance') }}"
glance_oslomsg_notify_password: "{{ glance_ceilometer_enabled | ternary(glance_oslomsg_rpc_password, '') }}"
glance_oslomsg_notify_vhost: "{{ glance_oslomsg_rpc_vhost | default('/glance') }}"
glance_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
glance_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Heat notifications
heat_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -108,6 +118,8 @@ heat_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
heat_oslomsg_notify_userid: "{{ heat_oslomsg_rpc_userid | default('heat') }}"
heat_oslomsg_notify_password: "{{ heat_ceilometer_enabled | ternary(heat_oslomsg_rpc_password, '') }}"
heat_oslomsg_notify_vhost: "{{ heat_oslomsg_rpc_vhost | default('/heat') }}"
heat_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
heat_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Keystone notifications
keystone_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -117,6 +129,8 @@ keystone_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
keystone_oslomsg_notify_userid: "{{ keystone_oslomsg_rpc_userid | default('keystone') }}"
keystone_oslomsg_notify_password: "{{ keystone_ceilometer_enabled | ternary(keystone_oslomsg_rpc_password, '') }}"
keystone_oslomsg_notify_vhost: "{{ keystone_oslomsg_rpc_vhost | default('/keystone') }}"
keystone_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
keystone_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Neutron notifications
neutron_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -126,6 +140,8 @@ neutron_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
neutron_oslomsg_notify_userid: "{{ neutron_oslomsg_rpc_userid | default('neutron') }}"
neutron_oslomsg_notify_password: "{{ neutron_ceilometer_enabled | ternary(neutron_oslomsg_rpc_password, '') }}"
neutron_oslomsg_notify_vhost: "{{ neutron_oslomsg_rpc_vhost | default('/neutron') }}"
neutron_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
neutron_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Nova notifications
nova_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -135,6 +151,8 @@ nova_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
nova_oslomsg_notify_userid: "{{ nova_oslomsg_rpc_userid | default('nova') }}"
nova_oslomsg_notify_password: "{{ nova_ceilometer_enabled | ternary(nova_oslomsg_rpc_password, '') }}"
nova_oslomsg_notify_vhost: "{{ nova_oslomsg_rpc_vhost | default('/nova') }}"
nova_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
nova_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Octavia notifications
octavia_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -144,6 +162,8 @@ octavia_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
octavia_oslomsg_notify_userid: "{{ octavia_oslomsg_rpc_userid | default('octavia') }}"
octavia_oslomsg_notify_password: "{{ octavia_ceilometer_enabled | ternary(octavia_oslomsg_rpc_password, '') }}"
octavia_oslomsg_notify_vhost: "{{ octavia_oslomsg_rpc_vhost | default('/octavia') }}"
octavia_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
octavia_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Sahara notifications
sahara_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -153,6 +173,8 @@ sahara_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
sahara_oslomsg_notify_userid: "{{ sahara_oslomsg_rpc_userid | default('sahara') }}"
sahara_oslomsg_notify_password: "{{ sahara_ceilometer_enabled | ternary(sahara_oslomsg_rpc_password, '') }}"
sahara_oslomsg_notify_vhost: "{{ sahara_oslomsg_rpc_vhost | default('/sahara') }}"
sahara_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
sahara_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Swift notifications
swift_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -161,6 +183,8 @@ swift_oslomsg_notify_port: "{{ oslomsg_notify_port | default('5672') }}"
swift_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
swift_oslomsg_notify_userid: "swift"
swift_oslomsg_notify_vhost: "/swift"
swift_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
swift_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Trove notifications
trove_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
@ -170,6 +194,8 @@ trove_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}"
trove_oslomsg_notify_userid: "{{ trove_oslomsg_rpc_userid | default('trove') }}"
trove_oslomsg_notify_password: "{{ trove_ceilometer_enabled | ternary(trove_oslomsg_rpc_password, '') }}"
trove_oslomsg_notify_vhost: "{{ trove_oslomsg_rpc_vhost | default('/trove') }}"
trove_oslomsg_notify_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}"
trove_oslomsg_notify_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
## (Qdrouterd) info
# TODO(ansmith): Change structure when more backends will be supported

View File

@ -1,10 +1,14 @@
#{{ ansible_managed}}
{% macro _oslomsg_url(transport, userid, password, hosts, port, vhost, query='') %}
{% macro _oslomsg_url(transport, userid, password, hosts, port, vhost, use_ssl, ssl_version, ca_file) %}
{% set _url = [] %}
{% for host in hosts %}
{% set _ = _url.append(userid + ':' + password + '@' + hostvars[host]['ansible_host'] + ':' + port) %}
{% endfor %}
{{ transport }}://{{ _url | join(',') }}/{{ vhost }}?{{ query }}
{% if use_ssl | bool %}
{{ transport }}://{{ _url | join(',') }}/{{ vhost }}?ssl=1&ssl_version={{ ssl_version }}&ssl_ca_file={{ ca_file }}
{% else %}
{{ transport }}://{{ _url | join(',') }}/{{ vhost }}?ssl=0
{% endif %}
{% endmacro %}
[DEFAULT]
@ -16,7 +20,7 @@ auth_strategy = keystone
aodh_is_enabled = {{ ceilometer_aodh_enabled | bool }}
# RPC
transport_url = {{ _oslomsg_url(ceilometer_oslomsg_rpc_transport, ceilometer_oslomsg_rpc_userid, ceilometer_oslomsg_rpc_password, groups[ceilometer_oslomsg_rpc_host_group], ceilometer_oslomsg_rpc_port, ceilometer_oslomsg_rpc_vhost, query=(ceilometer_oslomsg_rpc_use_ssl | bool | ternary('ssl=1', ''))) }}
transport_url = {{ _oslomsg_url(ceilometer_oslomsg_rpc_transport, ceilometer_oslomsg_rpc_userid, ceilometer_oslomsg_rpc_password, groups[ceilometer_oslomsg_rpc_host_group], ceilometer_oslomsg_rpc_port, ceilometer_oslomsg_rpc_vhost, ceilometer_oslomsg_rpc_use_ssl, ceilometer_oslomsg_rpc_ssl_version, ceilometer_rpc_ssl_ca_file) }}
{% if ceilometer_gnocchi_enabled | bool %}
event_dispatchers = gnocchi
@ -46,61 +50,61 @@ store_events = {{ not ceilometer_gnocchi_enabled | bool }}
# Notification queues to listen on
# Ceilometer needs to connect to it's own notification vhost
messaging_urls = {{ _oslomsg_url(ceilometer_oslomsg_notify_transport, ceilometer_oslomsg_notify_userid, ceilometer_oslomsg_notify_password, groups[ceilometer_oslomsg_notify_host_group], ceilometer_oslomsg_notify_port, ceilometer_oslomsg_notify_vhost, query=(ceilometer_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(ceilometer_oslomsg_notify_transport, ceilometer_oslomsg_notify_userid, ceilometer_oslomsg_notify_password, groups[ceilometer_oslomsg_notify_host_group], ceilometer_oslomsg_notify_port, ceilometer_oslomsg_notify_vhost, ceilometer_oslomsg_notify_use_ssl, ceilometer_oslomsg_notify_ssl_version, ceilometer_oslomsg_notify_ssl_ca_file) }}
{% if cinder_ceilometer_enabled %}
# Cinder notifications
messaging_urls = {{ _oslomsg_url(cinder_oslomsg_notify_transport, cinder_oslomsg_notify_userid, cinder_oslomsg_notify_password, groups[cinder_oslomsg_notify_host_group], cinder_oslomsg_notify_port, cinder_oslomsg_notify_vhost, query=(cinder_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(cinder_oslomsg_notify_transport, cinder_oslomsg_notify_userid, cinder_oslomsg_notify_password, groups[cinder_oslomsg_notify_host_group], cinder_oslomsg_notify_port, cinder_oslomsg_notify_vhost, cinder_oslomsg_notify_use_ssl, cinder_oslomsg_notify_ssl_version, cinder_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if designate_ceilometer_enabled %}
# Designate notifications
messaging_urls = {{ _oslomsg_url(designate_oslomsg_notify_transport, designate_oslomsg_notify_userid, designate_oslomsg_notify_password, groups[designate_oslomsg_notify_host_group], designate_oslomsg_notify_port, designate_oslomsg_notify_vhost, query=(designate_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(designate_oslomsg_notify_transport, designate_oslomsg_notify_userid, designate_oslomsg_notify_password, groups[designate_oslomsg_notify_host_group], designate_oslomsg_notify_port, designate_oslomsg_notify_vhost, designate_oslomsg_notify_use_ssl, designate_oslomsg_notify_ssl_version, designate_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if glance_ceilometer_enabled %}
# Glance notifications
messaging_urls = {{ _oslomsg_url(glance_oslomsg_notify_transport, glance_oslomsg_notify_userid, glance_oslomsg_notify_password, groups[glance_oslomsg_notify_host_group], glance_oslomsg_notify_port, glance_oslomsg_notify_vhost, query=(glance_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(glance_oslomsg_notify_transport, glance_oslomsg_notify_userid, glance_oslomsg_notify_password, groups[glance_oslomsg_notify_host_group], glance_oslomsg_notify_port, glance_oslomsg_notify_vhost, glance_oslomsg_notify_use_ssl, glance_oslomsg_notify_ssl_version, glance_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if heat_ceilometer_enabled %}
# Heat notifications
messaging_urls = {{ _oslomsg_url(heat_oslomsg_notify_transport, heat_oslomsg_notify_userid, heat_oslomsg_notify_password, groups[heat_oslomsg_notify_host_group], heat_oslomsg_notify_port, heat_oslomsg_notify_vhost, query=(heat_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(heat_oslomsg_notify_transport, heat_oslomsg_notify_userid, heat_oslomsg_notify_password, groups[heat_oslomsg_notify_host_group], heat_oslomsg_notify_port, heat_oslomsg_notify_vhost, heat_oslomsg_notify_use_ssl, heat_oslomsg_notify_ssl_version, heat_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if keystone_ceilometer_enabled %}
# Keystone notifications
messaging_urls = {{ _oslomsg_url(keystone_oslomsg_notify_transport, keystone_oslomsg_notify_userid, keystone_oslomsg_notify_password, groups[keystone_oslomsg_notify_host_group], keystone_oslomsg_notify_port, keystone_oslomsg_notify_vhost, query=(keystone_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(keystone_oslomsg_notify_transport, keystone_oslomsg_notify_userid, keystone_oslomsg_notify_password, groups[keystone_oslomsg_notify_host_group], keystone_oslomsg_notify_port, keystone_oslomsg_notify_vhost, keystone_oslomsg_notify_use_ssl, keystone_oslomsg_notify_ssl_version, keystone_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if neutron_ceilometer_enabled %}
# Neutron notifications
messaging_urls = {{ _oslomsg_url(neutron_oslomsg_notify_transport, neutron_oslomsg_notify_userid, neutron_oslomsg_notify_password, groups[neutron_oslomsg_notify_host_group], neutron_oslomsg_notify_port, neutron_oslomsg_notify_vhost, query=(neutron_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(neutron_oslomsg_notify_transport, neutron_oslomsg_notify_userid, neutron_oslomsg_notify_password, groups[neutron_oslomsg_notify_host_group], neutron_oslomsg_notify_port, neutron_oslomsg_notify_vhost, neutron_oslomsg_notify_use_ssl, neutron_oslomsg_notify_ssl_version, neutron_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if nova_ceilometer_enabled %}
# Nova notifications
messaging_urls = {{ _oslomsg_url(nova_oslomsg_notify_transport, nova_oslomsg_notify_userid, nova_oslomsg_notify_password, groups[nova_oslomsg_notify_host_group], nova_oslomsg_notify_port, nova_oslomsg_notify_vhost, query=(nova_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(nova_oslomsg_notify_transport, nova_oslomsg_notify_userid, nova_oslomsg_notify_password, groups[nova_oslomsg_notify_host_group], nova_oslomsg_notify_port, nova_oslomsg_notify_vhost, nova_oslomsg_notify_use_ssl, nova_oslomsg_notify_ssl_version, nova_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if octavia_ceilometer_enabled %}
# Octavia notifications
messaging_urls = {{ _oslomsg_url(octavia_oslomsg_notify_transport, octavia_oslomsg_notify_userid, octavia_oslomsg_notify_password, groups[octavia_oslomsg_notify_host_group], octavia_oslomsg_notify_port, octavia_oslomsg_notify_vhost, query=(octavia_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(octavia_oslomsg_notify_transport, octavia_oslomsg_notify_userid, octavia_oslomsg_notify_password, groups[octavia_oslomsg_notify_host_group], octavia_oslomsg_notify_port, octavia_oslomsg_notify_vhost, octavia_oslomsg_notify_use_ssl, octavia_oslomsg_notify_ssl_version, octavia_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if sahara_ceilometer_enabled %}
# Sahara notifications
messaging_urls = {{ _oslomsg_url(sahara_oslomsg_notify_transport, sahara_oslomsg_notify_userid, sahara_oslomsg_notify_password, groups[sahara_oslomsg_notify_host_group], sahara_oslomsg_notify_port, sahara_oslomsg_notify_vhost, query=(sahara_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(sahara_oslomsg_notify_transport, sahara_oslomsg_notify_userid, sahara_oslomsg_notify_password, groups[sahara_oslomsg_notify_host_group], sahara_oslomsg_notify_port, sahara_oslomsg_notify_vhost, sahara_oslomsg_notify_use_ssl, sahara_oslomsg_notify_ssl_version, sahara_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if swift_ceilometer_enabled %}
# Ceilometer notifications
messaging_urls = {{ _oslomsg_url(swift_oslomsg_notify_transport, swift_oslomsg_notify_userid, swift_oslomsg_notify_password, groups[swift_oslomsg_notify_host_group], swift_oslomsg_notify_port, swift_oslomsg_notify_vhost, query=(swift_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(swift_oslomsg_notify_transport, swift_oslomsg_notify_userid, swift_oslomsg_notify_password, groups[swift_oslomsg_notify_host_group], swift_oslomsg_notify_port, swift_oslomsg_notify_vhost, swift_oslomsg_notify_use_ssl, swift_oslomsg_notify_ssl_version, swift_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% if trove_ceilometer_enabled %}
# Trove notifications
messaging_urls = {{ _oslomsg_url(trove_oslomsg_notify_transport, trove_oslomsg_notify_userid, trove_oslomsg_notify_password, groups[trove_oslomsg_notify_host_group], trove_oslomsg_notify_port, trove_oslomsg_notify_vhost, query=(trove_oslomsg_notify_use_ssl | bool | ternary('ssl=1', ''))) }}
messaging_urls = {{ _oslomsg_url(trove_oslomsg_notify_transport, trove_oslomsg_notify_userid, trove_oslomsg_notify_password, groups[trove_oslomsg_notify_host_group], trove_oslomsg_notify_port, trove_oslomsg_notify_vhost, trove_oslomsg_notify_use_ssl, trove_oslomsg_notify_ssl_version, trove_oslomsg_notify_ssl_ca_file) }}
{% endif %}
{% endif %}