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: I5ba33177a121d75e92a929e5bd81cfd4872ef406
This commit is contained in:
parent
7b326d50c7
commit
62977e30f6
@ -30,4 +30,4 @@
|
||||
listen:
|
||||
- "Restart trove services"
|
||||
- "venv changed"
|
||||
|
||||
- "systemd service changed"
|
||||
|
@ -23,7 +23,14 @@ filtered_trove_services: |-
|
||||
(('condition' not in value) or
|
||||
('condition' in value and value['condition'])) and
|
||||
not ('wsgi_app' in value and value['wsgi_app']) %}
|
||||
{% 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