diff --git a/ansible/roles/trove/handlers/main.yml b/ansible/roles/trove/handlers/main.yml index 1dd8a9d543..8c973ddba9 100644 --- a/ansible/roles/trove/handlers/main.yml +++ b/ansible/roles/trove/handlers/main.yml @@ -25,7 +25,7 @@ service_name: "trove-conductor" service: "{{ trove_services[service_name] }}" config_json: "{{ trove_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - conf_file: "{{ trove_conf_file.results|selectattr('item.key', 'equalto', service_name)|first }}" + trove_conf: "{{ trove_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" trove_conductor_container: "{{ check_trove_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" kolla_docker: action: "recreate_or_restart_container" @@ -38,7 +38,7 @@ - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool - or conf_file.changed | bool + or trove_conf.changed | bool or trove_conductor_container.changed | bool - name: Restart trove-taskmanager container @@ -46,7 +46,7 @@ service_name: "trove-taskmanager" service: "{{ trove_services[service_name] }}" config_json: "{{ trove_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" - conf_file: "{{ trove_conf_file.results|selectattr('item.key', 'equalto', service_name)|first }}" + trove_conf: "{{ trove_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" trove_taskmanager_container: "{{ check_trove_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" kolla_docker: action: "recreate_or_restart_container" @@ -59,5 +59,5 @@ - inventory_hostname in groups[service.group] - service.enabled | bool - config_json.changed | bool - or conf_file.changed | bool + or trove_conf.changed | bool or trove_taskmanager_container.changed | bool diff --git a/ansible/roles/trove/tasks/config.yml b/ansible/roles/trove/tasks/config.yml index 56c8a2713e..25ed565d5b 100644 --- a/ansible/roles/trove/tasks/config.yml +++ b/ansible/roles/trove/tasks/config.yml @@ -27,20 +27,28 @@ - "Restart {{ item.key }} container" - name: Copying over trove conf files - template: - src: "{{ item.key }}.conf.j2" + vars: + services_need_confs: + - trove-conductor + - trove-taskmanager + merge_configs: + sources: + - "{{ role_path }}/templates/{{ item.key }}.conf.j2" + - "{{ node_custom_config }}/global.conf" + - "{{ node_custom_config }}/{{ item.key }}.conf" + - "{{ node_custom_config }}/trove/{{ item.key }}.conf" + - "{{ node_custom_config }}/trove/{{ inventory_hostname }}/{{ item.key }}.conf" dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.conf" mode: "0660" become: true - register: trove_conf_file + register: trove_confs when: - - item.key in [ "trove-conductor", "trove-taskmanager" ] + - item.key in services_need_confs - inventory_hostname in groups[item.value.group] - item.value.enabled | bool with_dict: "{{ trove_services }}" notify: - - Restart trove-conductor container - - Restart trove-taskmanager container + - "Restart {{ item.key }} container" - name: Copying over trove.conf vars: