Ansible: Changing permissions of files inside a directory in .yml file

Question:

Suppose there’s a directory /dir/tools.
tools contains a bunch of scripts, say, a.sh, b.sh, c.sh.

I need to set the permissions of a.sh, b.sh, and c.sh to 0775.

I’ve currently done it in the following manner:

Btw, ‘file: path=/dir/tools owner=abc group=abc mode=0775’ sets the permission of tools directory but not of the files inside it.

Is there a better way of achieving this?

Answer:

Try:

Leave a Reply