More containers are restarted when combine with with_dict and notify
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kolla-ansible |
New
|
Undecided
|
Unassigned |
Bug Description
**Bug Report**
What happened:
When a container changed, such as we changes configurations in nova-api,
this will restart all nova containers, which is not the expected result
especially in production environment.
See logs at [1] pasted below.
What you expected to happen:
Only restart the one needs to be restarted
How to reproduce it (minimal and precise):
1. create or modify config file in "{{ node_custom_config }}/nova/
2. add or change some config
[DEFAULT]
reserved_
3. deploy/
**Environment**:
config tasks using with_dict and notify after https:/
e.g.
some tasks in tasks/config.yml
- name: Copying over extra CA certificates
become: true
copy:
src: "{{ node_config }}/certificates
dest: "{{ node_config_
mode: "0644"
when:
- item.value.enabled | bool
- inventory_hostname in groups[
- kolla_copy_
with_dict: "{{ nova_services }}"
notify:
- "Restart {{ item.key }} container"
- name: Copying over nova.conf
become: true
vars:
service_name: "{{ item.key }}"
merge_configs:
sources:
- "{{ role_path }}/templates/
- "{{ node_custom_config }}/global.conf"
- "{{ node_custom_config }}/nova.conf"
- "{{ node_custom_config }}/nova/{{ item.key }}.conf"
- "{{ node_custom_config }}/nova/{{ inventory_hostname }}/nova.conf"
dest: "{{ node_config_
mode: "0660"
when:
- inventory_hostname in groups[
- item.value.enabled | bool
- item.key in nova_services_
with_dict: "{{ nova_services }}"
notify:
- "Restart {{ item.key }} container"
[1] ansible logs
TASK [nova : Copying over nova.conf] *****
skipping: [control1] ...
skipping: [control2] ...
...
ok: [control3] ...
...
changed: [control1] ...
...
RUNNING HANDLER [nova : Restart placement-api container] *****
changed: [control1]
RUNNING HANDLER [nova : Restart nova-api container] *****
changed: [control1]
RUNNING HANDLER [nova : Restart nova-scheduler container] *****
changed: [control1]
RUNNING HANDLER [nova : Restart nova-conductor container] *****
changed: [control1]
RUNNING HANDLER [nova : Restart nova-consoleauth container] *****
changed: [control1]
RUNNING HANDLER [nova : Restart nova-novncproxy container] *****
changed: [control1]
Add ansible logs