From 1197ca362d2319bead8df77d132302871ce85dd3 Mon Sep 17 00:00:00 2001 From: Javeria Khan Date: Mon, 16 Nov 2015 07:24:00 -0800 Subject: [PATCH] Update neutron service handler to restart only enabled services UpgradeImpact: The neutron_service_names variable has been removed from playbooks/roles/os_neutron/defaults/main.yml Closes-Bug: #1516655 Change-Id: Id7265ff687f672256b8014d177e21337eb172230 Signed-off-by: Javeria Khan --- defaults/main.yml | 3 --- handlers/main.yml | 7 ++++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4fa7f589..59dc6c03 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -334,9 +334,6 @@ neutron_pip_packages: neutron_plumgrid_pip_packages: - networking-plumgrid -## Service Names -neutron_service_names: "{{ neutron_services.items()|selectattr('1.service_en')|map(attribute='0')|list }}" - ## Tunable overrides neutron_neutron_conf_overrides: {} neutron_ml2_conf_ini_overrides: {} diff --git a/handlers/main.yml b/handlers/main.yml index 99f3b87e..57539823 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -15,8 +15,9 @@ - name: Restart neutron services service: - name: "{{ item }}" + name: "{{ item.value.service_name }}" state: restarted - pattern: "{{ item }}" - with_items: neutron_service_names + pattern: "{{ item.value.service_name }}" + with_dict: neutron_services failed_when: false + when: item.value.service_en | bool