ansible create basic file code example
Example: ansible create file
# Use file module
- name: Create a file
file:
path: /my/absolute/path/myfile
state: touch
owner: root
group: root
mode: '0664'
# Ad hoc command
ansible my_hosts -m file -a "path=/my/absolute/path/myfile state=touch"