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: Ic56d5d1bd1ead8fd6bb642913370fa206799256f
This commit is contained in:
Dmitriy Rabotyagov 2023-04-10 15:29:52 +02:00
parent 7000e35a6c
commit ec2caff080
2 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,7 @@
listen:
- "Restart aodh services"
- "venv changed"
- "systemd service changed"
- name: Start services
service:
@ -42,3 +43,4 @@
listen:
- "Restart aodh services"
- "venv changed"
- "systemd service changed"

View File

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