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: Ia9d1164e1e38201244a062be95f936b314c5c56b
This commit is contained in:
Dmitriy Rabotyagov 2023-04-10 16:05:42 +02:00 committed by Dmitriy Rabotyagov
parent c9553c4820
commit c4eb533c4f
2 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@
with_list: "{{ filtered_ironic_services }}"
listen:
- "venv changed"
- "systemd service changed"
- name: Restart tftpd
service:

View File

@ -254,8 +254,8 @@ filtered_ironic_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
}
)