Remove handler from chrony config

This seems to creating issues leading to steps skipped. Anyway
we do restart the service, so we can remove handler usage.

Change-Id: Ic25242f919f5a2bd23688d8e9dcdaac1989e61b8
This commit is contained in:
Rabi Mishra 2022-08-01 16:59:41 +05:30
parent 7ccf873c82
commit 7c8994b749
1 changed files with 7 additions and 13 deletions

View File

@ -7,20 +7,7 @@
group: root
mode: 0644
register: chrony_config
notify: Restart chronyd
- name: Ensure chronyd is running
service:
enabled: "{{ (chrony_service_state|default('started') in ['running', 'started']) |bool }}"
name: "{{ chrony_service_name }}"
state: "{{ chrony_service_state|default('started') }}"
when: chrony_manage_service|bool
# ansible sometimes ignores handlers when invoked elsewhere. Since we will
# likely want to restart chrony after a configuration update, let's do it here
# always. The handler will still trigger for upgrades/updates later as well.
# This won't have any effect if chrony_manage_service is set to false.
# See also https://github.com/ansible/ansible/issues/37512
- name: Force chronyd restart
service:
name: "{{ chrony_service_name }}"
@ -28,3 +15,10 @@
when:
- chrony_manage_service|bool
- chrony_config.changed
- name: Ensure chronyd is running
service:
enabled: "{{ (chrony_service_state|default('started') in ['running', 'started']) |bool }}"
name: "{{ chrony_service_name }}"
state: "{{ chrony_service_state|default('started') }}"
when: chrony_manage_service|bool