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/lib/ansible
Mark Mielke b4a1542670 Reduce the system calls performed by the "file" module
when using "state: link", and particularly when using
"force: yes".

Symbolic link resolution can be expensive. In our case,
the symbolic links are legacy links to automounts, and
the "file" task was causing all of the legacy links to
be traversed and mounted on every host every time the
task executed, even when the links were correct and there
was nothing to do.

This change avoids the system calls that perform the
symbolic link resolution by taking advantage of the short
circuit behaviur of the boolean "and" operator. The code
behaviour is unchanged except that it no longer performs
unnecessary system calls.

As it turns out, this change is not sufficient to fully
solve the symbolic link resolution problem, as the "file"
module still performs a stat() at the end of execution to
provide the caller with information about the file.
However, this change is very simple, it will eliminate
unnecessary system calls in a number of use cases, and it
gets the "file" module closer to the desired end result.
2017-01-24 12:31:25 -08:00
..
cli Fix exc on ansible-console --ask-vault-pass with empty password 2017-01-20 13:17:50 -05:00
compat Fix role completion detection problem 2017-01-03 14:32:44 -06:00
config Making the switch to v2 2015-05-03 21:47:26 -05:00
errors adds feature to all modules to be run locally (#18763) 2016-12-15 15:47:29 -05:00
executor Fixing iterator bug related to reworking of end-of-role detection 2017-01-19 10:10:07 -06:00
galaxy Improve ansible-galaxy handling of role versions (#12904) 2017-01-17 09:49:16 -05:00
inventory Fix linenos being wrong in inventory errors 2017-01-19 08:40:20 -08:00
module_utils win_psexec: execute cmds on remote systems as any user (#20141) 2017-01-24 13:48:58 +00:00
modules Reduce the system calls performed by the "file" module 2017-01-24 12:31:25 -08:00
parsing Add representer to AnsibleDumper for AnsibleUnsafeText 2017-01-19 10:10:07 -06:00
playbook Add pipeline-ish method using dd for file transfer over SSH (#18642) 2017-01-19 12:31:14 -05:00
plugins updates ensure_connect decorator function 2017-01-24 09:52:20 -05:00
template Don't restrict local jinja2 variables to those that start with l_ 2017-01-20 07:15:51 -06:00
utils parse yaml metadata and more info on fragment err 2017-01-18 19:21:34 -05:00
vars Fixing another corner case for security related to CVE-2016-9587 2017-01-11 15:52:58 -06:00
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
constants.py Add pipeline-ish method using dd for file transfer over SSH (#18642) 2017-01-19 12:31:14 -05:00
release.py Bumping devel version to 2.3.0 2016-10-03 11:46:31 -05:00
test-requirements.txt Switch tests to pytest and ansible-test. 2017-01-11 12:34:59 -08:00