Skip to content

Commit

Permalink
Add a recurse example to file module docs (ansible#54926)
Browse files Browse the repository at this point in the history
Add recurse example to file module
must set state: directory to use recurse: yes
  • Loading branch information
acozine authored Apr 5, 2019
1 parent c5991b9 commit 3221833
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/ansible/modules/files/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
recurse:
description:
- Recursively set the specified file attributes on directory contents.
- This applies only to C(state=directory).
- This applies only when C(state) is set to C(directory).
type: bool
default: no
version_added: '1.1'
Expand Down Expand Up @@ -187,6 +187,15 @@
path: /etc/another_file
state: file
access_time: '{{ "%Y%m%d%H%M.%S" | strftime(stat_var.stat.atime) }}'
- name: Recursively change ownership of a directory
file:
path: /etc/foo
state: directory
recurse: yes
owner: foo
group: foo
'''
RETURN = r'''
Expand Down

0 comments on commit 3221833

Please sign in to comment.