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: I3dcb02cfd8c5057411488dfefdd0b5381231a972
This commit is contained in:
Dmitriy Rabotyagov 2023-04-10 15:54:50 +02:00 committed by Dmitriy Rabotyagov
parent 94b04bffe1
commit b6d826f675
2 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,7 @@
listen:
- "Restart designate services"
- "venv changed"
- "systemd service changed"
- name: Perform Designate pools update
command: "{{ designate_bin }}/designate-manage pool update --file /etc/designate/pools.yaml"
@ -46,3 +47,4 @@
listen:
- "Restart designate services"
- "venv changed"
- "systemd service changed"

View File

@ -29,7 +29,8 @@ filtered_designate_services: |-
{% set _ = value.update(
{
'service_key': key,
'enabled': 'yes',
'enabled': value['enabled'] | default(True),
'state': value['state'] | default('started'),
'config_overrides': value.init_config_overrides
}
)