Files
jmrothst e1a12cf5c8 Add 'roles/ensure_log_rotation/' from commit 'a773ec408c77942fe88d5104ef1c3481ad154112'
git-subtree-dir: roles/ensure_log_rotation
git-subtree-mainline: 57d3ef9c28
git-subtree-split: a773ec408c
2026-05-10 21:35:40 -05:00

30 lines
921 B
YAML

---
# handlers file for ensure_log_rotation
- name: 'ensure_log_rotation.package_facts'
ansible.builtin.package_facts:
- name: 'ensure_log_rotation.service_facts'
ansible.builtin.service_facts:
- name: 'ensure_log_rotation.service_reload'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_log_rotation is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_log_rotation.service_restart'
when:
- ansible_facts["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'
...