mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
Fixes for mode=preserve (#39343)
* Fixes for mode=preserve * Document mode=preserve for template and copy * Make mode=preserve work with remote_src for copy * Make mode=preserve work for template * Integration tests for copy & template mode=preserve Fixes #39279 * Changed mode option in win_copy to hidden option as it doesn't reflect copy mode
This commit is contained in:
parent
33f358383a
commit
83c1cba511
9 changed files with 104 additions and 11 deletions
|
@ -95,6 +95,17 @@ options:
|
|||
type: bool
|
||||
default: 'no'
|
||||
version_added: "2.4"
|
||||
mode:
|
||||
description:
|
||||
- "Mode the file or directory should be. For those used to I(/usr/bin/chmod) remember that
|
||||
modes are actually octal numbers. You must either specify the leading zero so that
|
||||
Ansible's YAML parser knows it is an octal number (like C(0644) or C(01777)) or quote it
|
||||
(like C('644') or C('0644') so Ansible receives a string and can do its own conversion from
|
||||
string into number. Giving Ansible a number without following one of these rules will end
|
||||
up with a decimal number which will have unexpected results. As of version 1.8, the mode
|
||||
may be specified as a symbolic mode (for example, C(u+rwx) or C(u=rw,g=r,o=r)). As of
|
||||
version 2.6, the mode may also be the special string C(preserve). C(preserve) means that
|
||||
the file will be given the same permissions as the source file."
|
||||
notes:
|
||||
- For Windows you can use M(win_template) which uses '\\r\\n' as C(newline_sequence).
|
||||
- Including a string that uses a date in the template will result in the template being marked 'changed' each time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue