playbooks/test.yml

12 lines
304 B
YAML

---
- name: Create a file in /root directory
hosts: all
# become: yes # This is necessary to gain root privileges
tasks:
- name: Ensure test.txt exists in /root directory
file:
path: /root/test.txt
state: touch
owner: root
group: root
mode: '0644'