Skip to content

Commit dd8068e

Browse files
committed
Add some ssl options
1 parent 17bd2dd commit dd8068e

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ rabbitmq_server_key : "files/rabbitmq_server_key.pem"
2323
rabbitmq_server_cert : "files/rabbitmq_server_cert.pem"
2424
rabbitmq_ssl : true
2525

26+
# SSL Configuration
27+
rabbitmq_copy_ssl_files : true
28+
rabbitmq_use_ssl_cn_as_login : false
29+
30+
# Authentication mechanisms (not set by default)
31+
# rabbitmq_auth_mechanisms : [ 'PLAIN', 'AMQPLAIN' ]
32+
2633
## Optional logging
2734
## none, error, warnings, info, debug
2835
# rabbitmq_log_level :

tasks/configuration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
group="rabbitmq"
88
mode=0750
99
state="directory"
10-
when: rabbitmq_ssl
10+
when: rabbitmq_ssl and rabbitmq_copy_ssl_files
1111

1212
- name: configuration | copy the ssl certificates
1313
copy:
@@ -24,7 +24,7 @@
2424
dest: "{{ rabbitmq_conf_ssl_options_keyfile }}"
2525
- src: "{{ rabbitmq_server_cert }}"
2626
dest: "{{ rabbitmq_conf_ssl_options_certfile }}"
27-
when: rabbitmq_ssl
27+
when: rabbitmq_ssl and rabbitmq_copy_ssl_files
2828

2929
- name: configuration | generate the configuration of rabbitmq
3030
template:

templates/rabbitmq.config.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
{tcp_listeners, []}{% if rabbitmq_ssl %},
2525
{% endif %}
2626
{% endif %}
27+
{% if rabbitmq_auth_mechanisms is defined %}
28+
{auth_mechanisms, [ {% for authmech in rabbitmq_auth_mechanisms %}'{{authmech}}'{% if not loop.last %},{% endif %}{% endfor %} ]},
29+
{% endif %}
30+
{% if rabbitmq_use_ssl_cn_as_login %}
31+
{ssl_cert_login_from, common_name},
32+
{% endif %}
2733
{% if rabbitmq_ssl %}
2834
{ssl_listeners, [{"{{ rabbitmq_conf_ssl_listeners_address }}", {{ rabbitmq_conf_ssl_listeners_port }}}]},
2935
{ssl_options, [

0 commit comments

Comments
 (0)