If it is advisable to create a listing utilizing Ansible, then you are able to do the next:
Create a Listing in Ansible
You’ll need the file
module, then to create a listing you merely specify the choice state=listing
:
- title: Creates a listing
file:
path: /src/www
state: listing
Notice that with state=listing
, all of the instant subdirectories will likely be created in the event that they don’t exist already.
Extending the file
module
- title: Creates a listing
file:
path: /src/www
state: listing
proprietor: www-data
group: www-data
mode: 0775
Create the Directories Recursively
- title: Creates listing
file:
path: /src/www
state: listing
proprietor: www-data
group: www-data
mode: 0775
recurse: sure
That is much like the recursive
argument used with mkdir -p