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/lookup
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
..
__init__.py Initial commit 2020-03-09 09:11:07 +00:00
cartesian.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
chef_databag.py fixed Python 3 keys() usage (#1861) (#1890) 2021-02-23 23:48:28 +01:00
consul_kv.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
credstash.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
cyberarkpassword.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
dig.py Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
dnstxt.py Fix plugins (names, constants, FQCNs in examples) (#722) 2020-08-18 08:29:44 +02:00
dsv.py Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
etcd.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
etcd3.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
filetree.py with_filetree:: use splitext for compatibility with template: (#2285) (#2321) 2021-04-21 13:03:05 +00:00
flattened.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
gcp_storage_file.py Fix gcp_storage_file lookup plugin (#1284). 2020-11-13 22:06:46 +01:00
hashi_vault.py Fix hashi_vault lookup approle authentication (#1138) (#1315) 2020-11-16 16:40:54 +00:00
hiera.py rewritten as list literals (#2160) (#2167) 2021-04-05 09:50:08 +02:00
keyring.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
lastpass.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
lmdb_kv.py Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
manifold.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
nios.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
nios_next_ip.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
nios_next_network.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
onepassword.py onepassword: find the password field out of the fields list (#1610) (#1651) 2021-01-20 23:12:41 +01:00
onepassword_raw.py Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
passwordstore.py fix passwordstore.py to be compatible with gopass. (#1589) (#1674) 2021-01-25 12:59:22 +01:00
redis.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
shelvefile.py Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
tss.py Adding another example for tss lookup (#1945) (#1947) 2021-03-03 08:30:36 +01:00