From 30c2316e6c2f69ffad8f0e18907c52750d61f4b4 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 17 May 2021 07:55:45 +0000 Subject: [PATCH] Add variables for rabbitmq ssl configuration Change-Id: I4ca1b85b67a6f6fd4f951c1cb3c256ec959e7ee4 --- defaults/main.yml | 4 ++++ templates/blazar.conf.j2 | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1b7dca5..0da2db4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -120,6 +120,8 @@ blazar_oslomsg_rpc_port: "{{ oslomsg_rpc_port | default('5672') }}" blazar_oslomsg_rpc_use_ssl: "{{ oslomsg_rpc_use_ssl | default(False) }}" blazar_oslomsg_rpc_userid: blazar blazar_oslomsg_rpc_vhost: /blazar +blazar_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }}" +blazar_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}" # Notify blazar_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}" @@ -131,6 +133,8 @@ blazar_oslomsg_notify_use_ssl: "{{ oslomsg_notify_use_ssl | default(False) }}" blazar_oslomsg_notify_userid: "{{ blazar_oslomsg_rpc_userid }}" blazar_oslomsg_notify_vhost: "{{ blazar_oslomsg_rpc_vhost }}" blazar_oslomsg_notify_password: "{{ blazar_oslomsg_rpc_password }}" +blazar_oslomsg_notify_ssl_version: "{{ oslomsg_notify_ssl_version | default('TLSv1_2') }}" +blazar_oslomsg_notify_ssl_ca_file: "{{ oslomsg_notify_ssl_ca_file | default('') }}" blazar_role_name: admin blazar_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}" diff --git a/templates/blazar.conf.j2 b/templates/blazar.conf.j2 index db754b4..62a0e59 100644 --- a/templates/blazar.conf.j2 +++ b/templates/blazar.conf.j2 @@ -5,14 +5,14 @@ host=0.0.0.0 port={{ blazar_service_port }} # oslo.messaging default transport -transport_url = {{ blazar_oslomsg_rpc_transport }}://{% for host in blazar_oslomsg_rpc_servers.split(',') %}{{ blazar_oslomsg_rpc_userid }}:{{ blazar_oslomsg_rpc_password }}@{{ host }}:{{ blazar_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ blazar_oslomsg_rpc_vhost }}{% if (blazar_oslomsg_rpc_use_ssl | lower) | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} +transport_url = {{ blazar_oslomsg_rpc_transport }}://{% for host in blazar_oslomsg_rpc_servers.split(',') %}{{ blazar_oslomsg_rpc_userid }}:{{ blazar_oslomsg_rpc_password }}@{{ host }}:{{ blazar_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ blazar_oslomsg_rpc_vhost }}{% if blazar_oslomsg_rpc_use_ssl | bool %}?ssl=1&ssl_version={{ blazar_oslomsg_rpc_ssl_version }}&ssl_ca_file={{ blazar_oslomsg_rpc_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} [oslo_messaging_rabbit] ssl = {{ blazar_oslomsg_notify_use_ssl | bool }} [oslo_messaging_notifications] driver = {{ (blazar_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }} -transport_url = {{ blazar_oslomsg_notify_transport }}://{% for host in blazar_oslomsg_notify_servers.split(',') %}{{ blazar_oslomsg_notify_userid }}:{{ blazar_oslomsg_notify_password }}@{{ host }}:{{ blazar_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ blazar_oslomsg_notify_vhost }}{% if (blazar_oslomsg_notify_use_ssl | lower) | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} +transport_url = {{ blazar_oslomsg_notify_transport }}://{% for host in blazar_oslomsg_notify_servers.split(',') %}{{ blazar_oslomsg_notify_userid }}:{{ blazar_oslomsg_notify_password }}@{{ host }}:{{ blazar_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ blazar_oslomsg_notify_vhost }}{% if blazar_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ blazar_oslomsg_notify_ssl_version }}&ssl_ca_file={{ blazar_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} [manager]