Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
639 B

#!/bin/bash -e
{% if rabbitmq_letsencrypt_cert is defined %}
{% if rabbitmq_letsencrypt_cert == True %}
{% set cert = inventory_hostname %}
{% elif rabbitmq_letsencrypt_cert is string %}
{% set cert = rabbitmq_letsencrypt_cert %}
{% endif %}
if [ $1 == "{{ cert }}" ]; then
cp /var/lib/dehydrated/certificates/certs/{{ cert }}/fullchain.pem /etc/rabbitmq/ssl/cert.pem
cp /var/lib/dehydrated/certificates/certs/{{ cert }}/privkey.pem /etc/rabbitmq/ssl/key.pem
chown :rabbitmq /etc/rabbitmq/ssl/key.pem
chmod 644 /etc/rabbitmq/ssl/cert.pem
chmod 640 /etc/rabbitmq/ssl/key.pem
systemctl restart rabbitmq-server
fi
{% endif %}