ansible/lib/ansible
David Shrewsbury 0ae4dac65a
Fix copy module file perms with remote_src (#69993)
When using 'remote_src: yes' and 'mode: preserve', the code handling
the file modes has to be handled on the remote node because it's
the one that has access to the source files. This means that the
copy module itself must handle this, rather than the copy action
plugin (which is where all that logic exists). The copy module
handles this when we copy a single file over. But when it is a
directory as the src parameter value, the mode of the files
beneath it are not considered. Subdirectories are copied with
shutil.copytree() which will preserve permissions automatically.
Individual files are copied with shutil.copyfile() which does NOT
preserve permissions. We need to add some calls to shutil.copymode()
to correct that.

Note: This *always* retains individial file permissions. Specifying
a 'mode' other than 'preserve' when giving a source directory for
the 'src' param does not make sense so will be ignored in that case
only.

Fixes #69783

* Add changelog and test
2020-06-11 15:18:59 -04:00
..
cli Plugin/module docs: parse return values, add collection names in them (version_added_collection), and format them nicely in ansible-doc (#69796) 2020-06-11 11:03:43 -07:00
collections collection routing (#67684) 2020-05-26 09:42:06 -07:00
compat Fix filedescriptor out of range in select() when running commands (#65058) 2020-05-14 11:46:34 -04:00
config config: singular ANSIBLE_COLLECTIONS_PATH (#70007) 2020-06-11 11:40:13 -07:00
errors various deprecation, display, warning, error fixes for collections redirection (#69822) 2020-06-05 00:28:40 -07:00
executor config: singular ANSIBLE_COLLECTIONS_PATH (#70007) 2020-06-11 11:40:13 -07:00
galaxy galaxy - preserve symlinks on build/install (#69959) 2020-06-11 06:46:42 +10:00
inventory return changed for group_by (#32057) 2020-06-03 12:46:40 -04:00
module_utils Fix up schema for collection deprecation (#69977) 2020-06-10 16:33:08 +10:00
modules Fix copy module file perms with remote_src (#69993) 2020-06-11 15:18:59 -04:00
parsing Plugin/module docs: parse return values, add collection names in them (version_added_collection), and format them nicely in ansible-doc (#69796) 2020-06-11 11:03:43 -07:00
playbook Raise Warning when import_playbook receives additional parameters (#64156) 2020-06-10 13:22:40 -04:00
plugins implemented 'prefix' for file based cache (#69872) 2020-06-11 10:40:25 -04:00
template Deprecation revisited (#69926) 2020-06-09 15:21:19 -07:00
utils Plugin/module docs: parse return values, add collection names in them (version_added_collection), and format them nicely in ansible-doc (#69796) 2020-06-11 11:03:43 -07:00
vars Deprecation revisited (#69926) 2020-06-09 15:21:19 -07:00
__init__.py
constants.py avoid constant checking controlpersist (#69910) 2020-06-09 11:59:38 -04:00
context.py
release.py