Merge "Support custom_config for trove-taskmanager/conductor"

This commit is contained in:
Zuul 2018-03-25 04:26:07 +00:00 committed by Gerrit Code Review
commit 18114b057f
2 changed files with 18 additions and 10 deletions

View File

@ -25,7 +25,7 @@
service_name: "trove-conductor" service_name: "trove-conductor"
service: "{{ trove_services[service_name] }}" service: "{{ trove_services[service_name] }}"
config_json: "{{ trove_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" 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 }}" trove_conductor_container: "{{ check_trove_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
kolla_docker: kolla_docker:
action: "recreate_or_restart_container" action: "recreate_or_restart_container"
@ -38,7 +38,7 @@
- inventory_hostname in groups[service.group] - inventory_hostname in groups[service.group]
- service.enabled | bool - service.enabled | bool
- config_json.changed | bool - config_json.changed | bool
or conf_file.changed | bool or trove_conf.changed | bool
or trove_conductor_container.changed | bool or trove_conductor_container.changed | bool
- name: Restart trove-taskmanager container - name: Restart trove-taskmanager container
@ -46,7 +46,7 @@
service_name: "trove-taskmanager" service_name: "trove-taskmanager"
service: "{{ trove_services[service_name] }}" service: "{{ trove_services[service_name] }}"
config_json: "{{ trove_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" 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 }}" trove_taskmanager_container: "{{ check_trove_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
kolla_docker: kolla_docker:
action: "recreate_or_restart_container" action: "recreate_or_restart_container"
@ -59,5 +59,5 @@
- inventory_hostname in groups[service.group] - inventory_hostname in groups[service.group]
- service.enabled | bool - service.enabled | bool
- config_json.changed | bool - config_json.changed | bool
or conf_file.changed | bool or trove_conf.changed | bool
or trove_taskmanager_container.changed | bool or trove_taskmanager_container.changed | bool

View File

@ -27,20 +27,28 @@
- "Restart {{ item.key }} container" - "Restart {{ item.key }} container"
- name: Copying over trove conf files - name: Copying over trove conf files
template: vars:
src: "{{ item.key }}.conf.j2" 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" dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.conf"
mode: "0660" mode: "0660"
become: true become: true
register: trove_conf_file register: trove_confs
when: when:
- item.key in [ "trove-conductor", "trove-taskmanager" ] - item.key in services_need_confs
- inventory_hostname in groups[item.value.group] - inventory_hostname in groups[item.value.group]
- item.value.enabled | bool - item.value.enabled | bool
with_dict: "{{ trove_services }}" with_dict: "{{ trove_services }}"
notify: notify:
- Restart trove-conductor container - "Restart {{ item.key }} container"
- Restart trove-taskmanager container
- name: Copying over trove.conf - name: Copying over trove.conf
vars: vars: