Update handlers
This commit is contained in:
		| @@ -4,4 +4,24 @@ | |||||||
|   ansible.builtin.package_facts: |   ansible.builtin.package_facts: | ||||||
| - name: 'ensure_log_rotation.service_facts' | - name: 'ensure_log_rotation.service_facts' | ||||||
|   ansible.builtin.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' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user