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] 457c92c8e2
with_filetree:: use splitext for compatibility with template: (#2285) (#2321)
* 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:05 +00:00
..
action iptables_state: fix race condition between module and its action plugin (#1140) (#1143) 2020-10-20 22:46:12 +02:00
become Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
cache fixed Python 3 keys() usage (#1861) (#1890) 2021-02-23 23:48:28 +01:00
callback fixed Python 3 keys() usage (#1861) (#1890) 2021-02-23 23:48:28 +01:00
connection funcd connection plugin is now usable/loadable (#2235) (#2240) 2021-04-14 10:00:36 +02:00
doc_fragments fixed documentation for oneview modules (#2092) (#2098) 2021-03-24 18:24:30 +01:00
filter json_query: Handle AnsibleUnicode, AnsibleUnsafeText (#1434) (#1443) 2020-12-04 08:06:09 +01:00
inventory Excluded qemu templates in pools (#1991) (#2002) 2021-03-12 08:33:23 +01:00
lookup with_filetree:: use splitext for compatibility with template: (#2285) (#2321) 2021-04-21 13:03:05 +00:00
module_utils [PR #2203/0cd0f0ea backport][stable-1] module_helper - fixed decorator cause_changes (#2209) 2021-04-08 19:49:50 +02:00
modules More renames. (#2307) (#2317) 2021-04-21 13:30:39 +02:00