From b74e7e9a54cc95a00e3377c36ddc6533e966cff1 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Thu, 20 Dec 2018 16:01:40 +0100 Subject: rabbitmq-env: add config file for env variables definition --- defaults/main.yml | 2 ++ tasks/config.yml | 7 +++++++ templates/etc/rabbitmq/rabbitmq-env.conf.j2 | 6 ++++++ 3 files changed, 15 insertions(+) create mode 100644 templates/etc/rabbitmq/rabbitmq-env.conf.j2 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 %} -- cgit v1.2.3