Update handlers

This commit is contained in:
Jason Rothstein 2022-06-05 16:30:12 -05:00
parent 0b377009a5
commit 05a0b4ac68

View File

@ -1,2 +1,27 @@
---
# handlers file for ensure_selinux
# handlers file for ensure_selinux
- name: 'ensure_selinux.package_facts'
ansible.builtin.package_facts:
- name: 'ensure_selinux.service_facts'
ansible.builtin.service_facts:
- name: 'ensure_selinux.service_reload'
when:
- ansible_system == 'Linux'
- ansible_service_mgr == 'systemd'
- ensure_selinux is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_selinux.services'
when:
- ansible_system == 'Linux'
- ensure_selinux is defined
- ensure_selinux.service_list is defined
- ensure_selinux.service_list is iterable
- item.state == 'started'
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
loop: '{{ ensure_selinux.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'