How to rewrite shell task in to file module task
For example
- name: Change permissions.
shell: "chown -R {{ project_user }}:{{ project_user }} {{ project_root }}"
How to rewrite above code with the help of file module ?
How to rewrite shell task in to file module task
For example
- name: Change permissions.
shell: "chown -R {{ project_user }}:{{ project_user }} {{ project_root }}"
How to rewrite above code with the help of file module ?
That's pretty simple:
- file:
path: "{{ project_root }}"
owner: "{{ project_user }}"
group: "{{ project_user }}"
recurse: true
Have a look at the examples: https://docs.ansible.com/ansible/file_module.html#id3