From 1724dfd683d2d2d9c1d0e1a37f31123a922fda03 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 20 Sep 2019 09:59:31 +0100 Subject: [PATCH] fix(service): stop old service only if name is different to new service * Fix #119 --- openvpn/service.sls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openvpn/service.sls b/openvpn/service.sls index 1048657..726a6c9 100644 --- a/openvpn/service.sls +++ b/openvpn/service.sls @@ -21,10 +21,13 @@ For an successful upgrade we need to make sure the old services are deactivated. This affects at least Debian. #} +{% set obsolete_service_name = map.service ~ '@' ~ name %} +{% if obsolete_service_name != service_name %} obsolete_openvpn_{{ name }}_service: service.dead: - - name: {{ map.service ~ '@' ~ name }} + - name: {{ obsolete_service_name }} - enable: False +{% endif %} {% else %} {% set service_name = map.service ~ '_' ~ name %} {% endif %}