1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins
patchback[bot] 768512645d
with_filetree:: use splitext for compatibility with template: (#2285) (#2322)
* with_filetree: use splitext for compatibility with template

The example code given deploys files with their .j2 extensions intact, which is probably not what you want.

* Explain how templates interact with splitext|first

* Update plugins/lookup/filetree.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Don't encourage setting the mode of symlinks

On ext4, maybe most filesystems, symlinks always have the artificial mode of 0777, and `chmod $mode $symlink` *writes through* the symlink to its target file.

An effect of this is that if you deploy a file and a symlink to it (e.g. this common situation: /etc/nginx/sites-available/default and /etc/nginx/sites-enabled/default -> ../sites-available/default) then `with_filetree` will forever first deploy the file with the right mode, then corrupt its mode to 0777, and every redeploy will see a change to fix, forever in a loop.

Probably `file:` should refuse `mode:` on `state: link`s, but in the meantime, avoid recommending it in `filetree`

* Use `follow: false` instead of just the mode.

This should be more cross-compatible.

https://github.com/ansible-collections/community.general/pull/2285#discussion_r616571873

* Update plugins/lookup/filetree.py

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 8db59ff02d)

Co-authored-by: Nick <nick@kousu.ca>
2021-04-21 13:03:11 +00:00
..
action Bump version to 2.0.0 (#1369) 2020-11-26 14:26:36 +01:00
become Add support for sudo su - using password auth (#2054) (#2097) 2021-03-24 17:48:53 +01:00
cache fixed Python 3 keys() usage (#1861) (#1891) 2021-02-24 19:36:37 +01:00
callback Callback plugin: Azure Log Analytics (#2091) (#2133) 2021-03-30 12:37:52 +02:00
connection funcd connection plugin is now usable/loadable (#2235) (#2241) 2021-04-14 10:00:39 +02:00
doc_fragments fixed documentation for oneview modules (#2092) (#2093) 2021-03-24 16:41:03 +01:00
filter Add path_join compatibility shim (#2172) (#2206) 2021-04-08 08:31:35 +02:00
inventory Proxmox inv fix agent string parsing (#2245) (#2255) 2021-04-17 10:43:59 +02:00
lookup with_filetree:: use splitext for compatibility with template: (#2285) (#2322) 2021-04-21 13:03:11 +00:00
module_utils xenserver_guest - fixed validations (#2243) (#2253) 2021-04-17 09:51:16 +02:00
modules More renames. (#2307) (#2316) 2021-04-21 13:23:38 +02:00