Merge "Make Rabbitmq config files overridable"

This commit is contained in:
Zuul 2019-01-08 10:34:54 +00:00 committed by Gerrit Code Review
commit beee4f7c96
2 changed files with 53 additions and 10 deletions

View File

@ -52,5 +52,7 @@
- inventory_hostname != groups[service.group]|first
- service.enabled | bool
- config_json.changed | bool
or rabbitmq_confs.changed | bool
or rabbitmq_env_conf.changed | bool
or rabbitmq_config.changed | bool
or rabbitmq_definitions.changed | bool
or rabbitmq_container.changed | bool

View File

@ -27,22 +27,63 @@
- Restart rabbitmq container (first node)
- Restart rabbitmq container (rest of nodes)
- name: Copying over rabbitmq configs
- name: Copying over rabbitmq-env.conf
become: true
vars:
service: "{{ rabbitmq_services['rabbitmq'] }}"
template:
src: "{{ item }}.j2"
dest: "{{ node_config_directory }}/{{ project_name }}/{{ item }}"
src: "{{ item }}"
dest: "{{ node_config_directory }}/{{ project_name }}/rabbitmq-env.conf"
mode: "0770"
become: true
register: rabbitmq_confs
with_first_found:
- "{{ node_custom_config }}/rabbitmq/{{ inventory_hostname }}/rabbitmq-env.conf"
- "{{ node_custom_config }}/rabbitmq/rabbitmq-env.conf"
- "rabbitmq-env.conf.j2"
register: rabbitmq_env_conf
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify:
- Restart rabbitmq container (first node)
- Restart rabbitmq container (rest of nodes)
- name: Copying over rabbitmq.conf
become: true
vars:
service: "{{ rabbitmq_services['rabbitmq'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/{{ project_name }}/rabbitmq.conf"
mode: "0770"
with_first_found:
- "{{ node_custom_config }}/rabbitmq/{{ inventory_hostname }}/rabbitmq.conf"
- "{{ node_custom_config }}/rabbitmq/rabbitmq.conf"
- "rabbitmq.conf.j2"
register: rabbitmq_config
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
notify:
- Restart rabbitmq container (first node)
- Restart rabbitmq container (rest of nodes)
- name: Copying over definitions.json
become: true
vars:
service: "{{ rabbitmq_services['rabbitmq'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/{{ project_name }}/definitions.json"
mode: "0770"
with_first_found:
- "{{ node_custom_config }}/rabbitmq/{{ inventory_hostname }}/definitions.json"
- "{{ node_custom_config }}/rabbitmq/definitions.json"
- "definitions.json.j2"
register: rabbitmq_definitions
when:
- inventory_hostname in groups[service.group]
- service.enabled | bool
with_items:
- "rabbitmq-env.conf"
- "rabbitmq.conf"
- "definitions.json"
notify:
- Restart rabbitmq container (first node)
- Restart rabbitmq container (rest of nodes)