Update handlers

This commit is contained in:
Jason Rothstein 2022-06-05 16:29:33 -05:00
parent 30ef8ff18c
commit 07ea5cf6af

View File

@ -4,4 +4,24 @@
ansible.builtin.package_facts:
- name: 'ensure_log_rotation.service_facts'
ansible.builtin.service_facts:
- name: 'ensure_log_rotation.service_reload'
when:
- ansible_system == 'Linux'
- ansible_service_mgr == 'systemd'
- ensure_log_rotation is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_log_rotation.services'
when:
- ansible_system == 'Linux'
- ensure_log_rotation is defined
- ensure_log_rotation.service_list is defined
- ensure_log_rotation.service_list is iterable
- item.state == 'started'
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
loop: '{{ ensure_log_rotation.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'