From: Paul Bonaud Date: Thu, 20 Dec 2018 15:01:40 +0000 (+0100) Subject: rabbitmq-env: add config file for env variables definition X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=b74e7e9a54cc95a00e3377c36ddc6533e966cff1;p=github%2Ffretlink%2Fansible-rabbitmq.git rabbitmq-env: add config file for env variables definition --- diff --git a/defaults/main.yml b/defaults/main.yml index f3d2c20..2932de7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,6 +16,8 @@ rabbitmq_config_ha: false rabbitmq_config_service: false rabbitmq_config_file: etc/rabbitmq/rabbitmq.config.j2 +rabbitmq_config_env_file: etc/rabbitmq/rabbitmq-env.conf.j2 +rabbitmq_env_config: {} # rabbitmq_debian_repo: deb http://www.rabbitmq.com/debian/ testing main #other repos diff --git a/tasks/config.yml b/tasks/config.yml index 091cca1..ea1b3c8 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -5,3 +5,10 @@ dest: "/etc/rabbitmq/rabbitmq.config" become: true notify: "restart rabbitmq-server" + +- name: config | Configuring RabbitMQ environemnt + template: + src: "{{ rabbitmq_config_env_file }}" + dest: "/etc/rabbitmq/rabbitmq-env.conf" + become: true + notify: "restart rabbitmq-server" diff --git a/templates/etc/rabbitmq/rabbitmq-env.conf.j2 b/templates/etc/rabbitmq/rabbitmq-env.conf.j2 new file mode 100644 index 0000000..8eff6f3 --- /dev/null +++ b/templates/etc/rabbitmq/rabbitmq-env.conf.j2 @@ -0,0 +1,6 @@ +# {{ ansible_managed }} +# Note that the variables do not have the RABBITMQ_ prefix. +# +{% for key,value in rabbitmq_env_config.iteritems() %} +{{ key }}={{ value }} +{% endfor %}