Role shell

This commit is contained in:
2021-11-14 11:33:05 -06:00
parent d2346d4a65
commit bba5e273ae
2 changed files with 174 additions and 2 deletions

View File

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