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: I5d491104173dc0217fac62618c13e8ac5a57233b
This commit is contained in:
Dmitriy Rabotyagov
2023年04月10日 15:52:49 +02:00
committed by Dmitriy Rabotyagov
parent 2c79d70378
commit 502bfbfda5

View File

@@ -25,6 +25,7 @@
listen:
- "Restart cloudkitty services"
- "venv changed"
- "systemd service changed"
- name:Start services
systemd:
@@ -38,3 +39,4 @@
listen:
- "Restart cloudkitty services"
- "venv changed"
- "systemd service changed"

View File

@@ -179,8 +179,8 @@
systemd_TasksAccounting:true
systemd_services:
- service_name:"{{ service_var.service_name }}"
enabled:yes
state:started
enabled:"{{ service_var.enabled | default(True) }}"
state:"{{ service_var.state | default('started') }}"
execstarts:"{{ service_var.execstarts }}"
execreloads:"{{ service_var.execreloads | default([]) }}"
config_overrides:"{{ service_var.init_config_overrides }}"
Reference in New Issue
openstack/openstack-ansible-os_cloudkitty
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.