Skip to content

Commit

Permalink
fix(service): stop old service only if name is different to new service
Browse files Browse the repository at this point in the history
  • Loading branch information
myii authored and alxwr committed Sep 25, 2019
1 parent e94c9ba commit 1724dfd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openvpn/service.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 1724dfd

Please sign in to comment.