diff options
author | Larry Smith Jr <mrlesmithjr@gmail.com> | 2018-12-20 14:59:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 14:59:02 -0500 |
commit | f5ef298d23b154e0dbf2a8c0718498a878dea0f8 (patch) | |
tree | 2df8edd2420fcb7a15d58c430e08104608173583 | |
parent | ba3197ed9f9a1ddbb2acb9735449fac47c559e18 (diff) | |
parent | b74e7e9a54cc95a00e3377c36ddc6533e966cff1 (diff) | |
download | ansible-rabbitmq-f5ef298d23b154e0dbf2a8c0718498a878dea0f8.tar.gz ansible-rabbitmq-f5ef298d23b154e0dbf2a8c0718498a878dea0f8.tar.zst ansible-rabbitmq-f5ef298d23b154e0dbf2a8c0718498a878dea0f8.zip |
Merge pull request #24 from paulrbr-fl/rabbitmq-config-env
rabbitmq-env: add config file for env variables definition
-rw-r--r-- | defaults/main.yml | 2 | ||||
-rw-r--r-- | tasks/config.yml | 7 | ||||
-rw-r--r-- | templates/etc/rabbitmq/rabbitmq-env.conf.j2 | 6 |
3 files changed, 15 insertions, 0 deletions
diff --git a/defaults/main.yml b/defaults/main.yml index e874af1..f8dd8f9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml | |||
@@ -16,6 +16,8 @@ rabbitmq_config_ha: false | |||
16 | 16 | ||
17 | rabbitmq_config_service: false | 17 | rabbitmq_config_service: false |
18 | rabbitmq_config_file: etc/rabbitmq/rabbitmq.config.j2 | 18 | rabbitmq_config_file: etc/rabbitmq/rabbitmq.config.j2 |
19 | rabbitmq_config_env_file: etc/rabbitmq/rabbitmq-env.conf.j2 | ||
20 | rabbitmq_env_config: {} | ||
19 | 21 | ||
20 | # rabbitmq_debian_repo: deb http://www.rabbitmq.com/debian/ testing main | 22 | # rabbitmq_debian_repo: deb http://www.rabbitmq.com/debian/ testing main |
21 | #other repos | 23 | #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 @@ | |||
5 | dest: "/etc/rabbitmq/rabbitmq.config" | 5 | dest: "/etc/rabbitmq/rabbitmq.config" |
6 | become: true | 6 | become: true |
7 | notify: "restart rabbitmq-server" | 7 | notify: "restart rabbitmq-server" |
8 | |||
9 | - name: config | Configuring RabbitMQ environemnt | ||
10 | template: | ||
11 | src: "{{ rabbitmq_config_env_file }}" | ||
12 | dest: "/etc/rabbitmq/rabbitmq-env.conf" | ||
13 | become: true | ||
14 | 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 @@ | |||
1 | # {{ ansible_managed }} | ||
2 | # Note that the variables do not have the RABBITMQ_ prefix. | ||
3 | # | ||
4 | {% for key,value in rabbitmq_env_config.iteritems() %} | ||
5 | {{ key }}={{ value }} | ||
6 | {% endfor %} | ||