Ensure service is restarted on unit file changes
At the moment we don't restart services if systemd unit file is changed. We knowingly prevent systemd_service role handlers to execute by providing `state: started` as otherwise service will be restarted twice. With that now we ensure that role handlers will also listen for systemd unit changes. Change-Id: I78c9888f7f2b97bd901d9fcce636bc22b6411eb9
This commit is contained in:
parent
d179113919
commit
78e75642e7
@ -22,6 +22,7 @@
|
||||
with_items: "{{ filtered_swift_services }}"
|
||||
listen:
|
||||
- "venv changed"
|
||||
- "systemd service changed"
|
||||
|
||||
- name: Restart rsync service
|
||||
service:
|
||||
|
@ -22,7 +22,14 @@ filtered_swift_services: |-
|
||||
{% if (value['group'] in group_names) and
|
||||
(('service_en' not in value) or
|
||||
('service_en' in value and value['service_en'])) %}
|
||||
{% set _ = value.update({'service_key': key}) %}
|
||||
{% set _ = value.update(
|
||||
{
|
||||
'service_key': key,
|
||||
'enabled': value['enabled'] | default(True),
|
||||
'state': value['state'] | default('started')
|
||||
}
|
||||
)
|
||||
%}
|
||||
{% set _ = services.append(value) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user