Support custom_config for trove-taskmanager/conductor

This patch updates trove configuration tasks to apply custom_config to
trove-taskmanager/conductor.conf.

Currently only trove.conf is custom-configurable, and the file is to be
loaded by trove-api service only. Therefore, we cannot apply
custom_config to trove-taskmanager/conductor services.

Change-Id: I0a64c4f0df32eb87cd91ebd8eafb512575061413
Closes-Bug: #1706883
This commit is contained in:
Yotaro Konishi 2017-07-27 17:51:37 +09:00
parent 1ab1c835c4
commit 5190481c08
2 changed files with 18 additions and 10 deletions

View File

@ -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

View File

@ -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: