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

make file module more explicitly explicit with respect to recursion #825

Closed
biffhero opened this issue Aug 9, 2012 · 2 comments
Closed

Comments

@biffhero
Copy link

biffhero commented Aug 9, 2012

With this as the action...

  action: file path=/usr/ssn owner=ssn group=ssn state=directory

And with the user "ssn" already on the host, the entire /usr/ssn/* tree was set to user ssn, group ssn. There were directories there which were root.root which had to be restored. The expected behavior was that only /usr/ssn/ would be set to ssn.ssn. I suppose there might be an assumption going on here, where the "chown -R" makes sense in some cases, and not in others. I think this should be optional.

Thanks for a great module, it's way better than doing a system call.

Rob

@mpdehaan
Copy link
Contributor

recurse=yes|no seems useful, though change detection for changed=True/False would be hard in this case.

I'd be ok with not seeing anything recurse and the command module being needed for that if someone really wants to execute a -R

mpdehaan pushed a commit that referenced this issue Aug 11, 2012
This updates set_owner_if_different() and set_group_if_different()
to not implicitly recurse when setting ownership (whether user or
group).  It drops the os.system() call and replaces it with os.chown().
Resolves issue #825.

The recursion should be explicit.  A recurse=yes|no option should be
added to the file module.
@mpdehaan
Copy link
Contributor

closing per above

@ansible ansible locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants