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.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_heat/+/879963
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/880470
Change-Id: I5561693e490700bc572e196e36e8ef0fa4df1ec5
This commit is contained in:
Dmitriy Rabotyagov 2023-04-11 12:45:57 +02:00 committed by Dmitriy Rabotyagov
parent 6deed3ff81
commit 5025cd3ea1
2 changed files with 3 additions and 2 deletions

View File

@ -20,3 +20,4 @@
when: inventory_hostname in groups[item.group]
listen:
- "venv changed"
- "systemd service changed"

View File

@ -22,8 +22,8 @@ filtered_sahara_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
}
)