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: I4273d2fbcbff3028e693e3274093c1afebdcfca2
This commit is contained in:
parent
b6e904213e
commit
94690a06da
@ -70,6 +70,7 @@
|
|||||||
- "Restart nova services"
|
- "Restart nova services"
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
- "cert installed"
|
- "cert installed"
|
||||||
|
- "systemd service changed"
|
||||||
|
|
||||||
- name: Start services
|
- name: Start services
|
||||||
service:
|
service:
|
||||||
@ -86,3 +87,4 @@
|
|||||||
- "Restart nova services"
|
- "Restart nova services"
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
- "cert installed"
|
- "cert installed"
|
||||||
|
- "systemd service changed"
|
||||||
|
@ -41,7 +41,14 @@ filtered_nova_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