Create a playbook named create_file.yml with the following content:
vim first-playbook.yml---
- name: Create a file on all remote servers
hosts: all
tasks:
- name: Create an empty file
file:
path: /tmp/ansible_test_file
state: touchExecute the playbook using the following command:
ansible-playbook -i first-playbook.yml