Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a recurse example to file module docs #54926

Merged
merged 2 commits into from
Apr 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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