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: I4eec982a682bfff121f9658c6d4eb3d1db8cb94f
This commit is contained in:
parent
b8865bde4c
commit
ab4b4a1d25
@ -27,6 +27,7 @@
|
|||||||
listen:
|
listen:
|
||||||
- "Restart manila services"
|
- "Restart manila services"
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
|
- "systemd service changed"
|
||||||
|
|
||||||
- name: Start services
|
- name: Start services
|
||||||
service:
|
service:
|
||||||
@ -42,3 +43,4 @@
|
|||||||
listen:
|
listen:
|
||||||
- "Restart manila services"
|
- "Restart manila services"
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
|
- "systemd service changed"
|
||||||
|
@ -31,7 +31,13 @@ filtered_manila_services: |-
|
|||||||
(('condition' not in value) or
|
(('condition' not in value) or
|
||||||
('condition' in value and value['condition'])) and
|
('condition' in value and value['condition'])) and
|
||||||
not ('wsgi_app' in value and value['wsgi_app']) %}
|
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) %}
|
{% set _ = services.append(value) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user