Files
Ansible/Playbook/PB-Handlers.yml
T
2026-10-18 16:41:04 +02:00

35 lines
685 B
YAML

---
- name: "Create empty files"
hosts: ansible.debian
become: true
gather_facts: no
tasks:
- name: "Create empty file"
ansible.builtin.file:
path: /tmp/TEST1
state: touch
notify:
- Handler1
- name: "Create empty file"
ansible.builtin.file:
path: /tmp/TEST2
state: touch
notify:
- Handler3
- Handler2
handlers:
- name: "Handler1"
ansible.builtin.debug:
msg: " Le fichier TEST1 est créé"
- name: "Handler2"
ansible.builtin.debug:
msg: " Le fichier TEST2 est créé"
- name: "Handler3"
ansible.builtin.shell:
cmd: ls -l /tmp/TEST*