From 96fb295bbc5c77c8ea139f523d1cc4e8b506f165 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Mon, 14 Oct 2024 20:04:21 +0200 Subject: [PATCH] Ensure that services that intended to stay disabled are not started This mainly affects neutron-rpc-server service, which intended to stay disabled/stopped. While we've introduced logic in vars, which is respected by systemd role it is not respected by the role handlers, which brings service back up running unconditionally. This actually breaks neutron behaviour after merging of [1], which relies on neutron-rpc-server being disabled. [1] https://review.opendev.org/c/openstack/openstack-ansible-os_neutron/+/927881 Change-Id: I28c928362ef009c1b49673005463b653d038faf9 --- handlers/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index ac2ff79e..9a64d740 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -16,7 +16,6 @@ - name: Stop services service: name: "{{ item.service_name }}" - enabled: yes state: "stopped" daemon_reload: yes with_items: "{{ filtered_neutron_services }}" @@ -103,8 +102,8 @@ - name: Start services service: name: "{{ item.service_name }}" - enabled: yes - state: "started" + enabled: "{{ item.enabled | default(True) }}" + state: "{{ item.state | default('started') }}" daemon_reload: yes with_items: "{{ filtered_neutron_services }}" register: _start