Update handlers

This commit is contained in:
Jason Rothstein 2022-06-05 16:29:28 -05:00
parent fded4496c7
commit 51831e5ecb

View File

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