The `setup` module reports incorrectly computed disk and partition size facts on (afaict) all Linux kernels for block devices that report a physical block size other than 512b.
This happens because `facts.py` incorrectly assumes that sysfs reports a device's block count in units of that device's physical sector size. The kernel, however, always reports and exports sector counts in units of 512b sectors, even if the device's hardware interface cannot address individual blocks this small. The results we see are inflated capacity figures for things like some SSD models and 4kn-HDDs that do report a hardware sector size greater than 512b.
This reverts commit e856ac2320.
That commit was intended to fix --limit not honoring the playbook
directory as a source of inventory variable information. However, the
commit changes the inventory basedir to where it thinks the playbook
basedir which breaks finding inventory variables inside of inventory
directories #15093. Reverting this and looking for where limit might be
affecting the playbook basedir rather than the inventory basedir.
This fixes#12915
Since combine_vars() is being run directly on role_params, we have to avoid merge_hash() to complain about merging a dict with a string (jinja template).
While debugging I noticed that _validate_both_dicts() was evaluated twice through combine_vars (when merge_hash). Looking at v2.0 the logic was improved to not do _validate_both_dicts() twice in this case.
I also backported the 'update' behaviour as it looks more pythonic.
This commit improves 2 things:
- It makes merging empty dicts, or equal dicts faster
- It makes merging dicts faster (backported from v2.0)
I noticed that while debugging merge_hash a lot of merges related to empty dictionaries and sometimes identical dictionaries.
both really work the same for the Lock but this hopefully will
avoid confusing people into thinking we are threaded or thread safe
Also did pyflakes cleanup and made note why checksums import exists
We define 'false', 'true' and 'null' as variables so that python eval() recognizes them as False, True and None.
This is a backport of a fix from 2.0.0.2 which also affects 1.9.4 (See issue #14291 and PR #14293)
This fixes#14291 for 1.9.4.
This closes#14250.
It should not have any ill-effects for existing use-cases as we would only allow additional authentication methods on top of password authentication. And since the user can authenticate in other ways already, it also has no security impact.
Ensure only one thread can start up an accelerate daemon on a target
host where multiple hosts may be specified in the play, gather facts is
disabled and the first task delegates to the same target host.
This will slow down the initial connection to only allowing a single
thread setup a connection at a time, however this should be of a
negligible impact overall.
Ensure that initial setup in creating the key directory for ansible
accelerate mode keys, and generation/storage of the key for a
particular host are completed in a thread safe manner.
Creating directories/files and then assigning permissions and contents
to them means that paths may exist and satisfy the os.path.exists()
method in python for other threads before they are usuable.
Use a combination of locking around operations with use of unique named
files and an OS file system move to ensure that the conditions of
checking whether a file or directory exists, where it is potentially
created by another thread, will only succeed when the file has both the
correct contents and permissions.
Fixes#13850