From 43c83b51cfcee320fc52218925e88d0fe1b05100 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 17 Jan 2019 14:33:11 +0000 Subject: [PATCH] Fix reconfigure of neutron ml2_conf.ini The neutron containers were not being restarted if only the ml2_conf.ini file is changed. This is due to the XenAPI ml2_conf.ini config task registering a variable of the same name as the task that generates ml2_conf.ini for other services. Since the XenAPI service is typically not running, the tasks show as not changed, and the handler skips restarting the container. This change adds a second variable for XenAPI to avoid this shadowing. Change-Id: I77819ed8defb8a7653e1e5aec92013b1d40fbf02 Closes-Bug: #1783268 --- ansible/roles/neutron/handlers/main.yml | 4 ++-- ansible/roles/neutron/tasks/config.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/roles/neutron/handlers/main.yml b/ansible/roles/neutron/handlers/main.yml index 0184532972..fb72818839 100644 --- a/ansible/roles/neutron/handlers/main.yml +++ b/ansible/roles/neutron/handlers/main.yml @@ -66,7 +66,7 @@ service: "{{ neutron_services[service_name] }}" config_json: "{{ neutron_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" neutron_conf: "{{ neutron_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" - neutron_ml2_conf: "{{ neutron_ml2_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" + neutron_ml2_xenapi_conf: "{{ neutron_ml2_xenapi_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" policy_json: "{{ policy_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" neutron_openvswitch_agent_xenapi_container: "{{ check_neutron_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" become: true @@ -84,7 +84,7 @@ - service.host_in_groups | bool - config_json | changed or neutron_conf | changed - or neutron_ml2_conf | changed + or neutron_ml2_xenapi_conf | changed or policy_json | changed or neutron_openvswitch_agent_xenapi_container | changed diff --git a/ansible/roles/neutron/tasks/config.yml b/ansible/roles/neutron/tasks/config.yml index c52b75934d..18d83980f9 100644 --- a/ansible/roles/neutron/tasks/config.yml +++ b/ansible/roles/neutron/tasks/config.yml @@ -166,7 +166,7 @@ - "{{ node_custom_config }}/neutron/{{ service_name }}/ml2_conf.ini" dest: "{{ node_config_directory }}/{{ service_name }}/ml2_conf.ini" mode: "0660" - register: neutron_ml2_confs + register: neutron_ml2_xenapi_confs when: - item.key in services_need_ml2_conf_ini - item.value.enabled | bool