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
Nick 8db59ff02d
with_filetree:: use splitext for compatibility with template: (#2285)
* 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>
2021-04-21 14:04:46 +02: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) 2021-03-24 17:20:26 +01:00
cache fixed Python 3 keys() usage (#1861) 2021-02-23 23:19:27 +01:00
callback Callback plugin: Azure Log Analytics (#2091) 2021-03-30 12:12:26 +02:00
connection funcd connection plugin is now usable/loadable (#2235) 2021-04-14 09:25:57 +02:00
doc_fragments Allow keycloak modules to take token as parameter for the auth. (#2250) 2021-04-20 13:20:46 +02:00
filter New filter plugins: hashids_encode and hashids_decode (#2244) 2021-04-17 20:00:03 +02:00
inventory Proxmox inv fix agent string parsing (#2245) 2021-04-17 10:08:41 +02:00
lookup with_filetree:: use splitext for compatibility with template: (#2285) 2021-04-21 14:04:46 +02:00
module_utils Keycloak: add realm management (#2155) 2021-04-21 12:42:28 +02:00
modules More renames. (#2307) 2021-04-21 12:54:35 +02:00