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: I53545ede7b2f129bbbf3518ab517f6f37d78598e
This commit is contained in:
parent
51e347dcb9
commit
330b91efec
@ -81,6 +81,7 @@
|
|||||||
listen:
|
listen:
|
||||||
- "Restart zun services"
|
- "Restart zun services"
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
|
- "systemd service changed"
|
||||||
|
|
||||||
- name: Start services
|
- name: Start services
|
||||||
systemd:
|
systemd:
|
||||||
@ -96,3 +97,4 @@
|
|||||||
listen:
|
listen:
|
||||||
- "Restart zun services"
|
- "Restart zun services"
|
||||||
- "venv changed"
|
- "venv changed"
|
||||||
|
- "systemd service changed"
|
||||||
|
@ -24,7 +24,7 @@ filtered_zun_services: |-
|
|||||||
(('condition' not in value) or
|
(('condition' not in value) or
|
||||||
('condition' in value and value['condition']))
|
('condition' in value and value['condition']))
|
||||||
and not ('wsgi_app' in value and value['wsgi_app']) %}
|
and not ('wsgi_app' in value and value['wsgi_app']) %}
|
||||||
{% set _ = value.update({'enabled': 'yes', 'state': 'started'}) %}
|
{% set _ = value.update({'enabled': value['enabled'] | default(True), 'state': value['state'] | default('started')}) %}
|
||||||
{% set _ = value.update({'config_overrides': (zun_service_defaults | combine(value.init_config_overrides, recursive=True))}) %}
|
{% set _ = value.update({'config_overrides': (zun_service_defaults | combine(value.init_config_overrides, recursive=True))}) %}
|
||||||
{% set _ = value.pop('init_config_overrides') %}
|
{% set _ = value.pop('init_config_overrides') %}
|
||||||
{% set _ = services.append(value) %}
|
{% set _ = services.append(value) %}
|
||||||
|
Loading…
Reference in New Issue
Block a user