ensure_git/handlers/main.yml
2022-06-05 16:29:28 -05:00

28 lines
792 B
YAML

---
# 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'