dont follow symlinks for inventories

now symlink dir is checked for locality of group/host_vars

fixes #31195

(cherry picked from commit f00d47fac0)
This commit is contained in:
Brian Coca 2017-10-03 14:54:25 -04:00
parent 8b39280d8d
commit 280e9d7bb7
2 changed files with 2 additions and 1 deletions

View file

@ -88,6 +88,7 @@ Ansible Changes By Release
* Fix removal of newlines when writing SELinux config (https://github.com/ansible/ansible/issues/30618)
* clarified extension requirement for constructed inv plugin
* really turn off inventory caching, toggle will be added in 2.5
* for inventory sources, dont follow symlinks to calculate base directory, used for group/host_vars
<a id="2.4"></a>

View file

@ -615,7 +615,7 @@ class CLI(with_metaclass(ABCMeta, object)):
self.options.inventory = [self.options.inventory]
# Ensure full paths when needed
self.options.inventory = [unfrackpath(opt) if ',' not in opt else opt for opt in self.options.inventory]
self.options.inventory = [unfrackpath(opt, follow=False) if ',' not in opt else opt for opt in self.options.inventory]
else:
self.options.inventory = C.DEFAULT_HOST_LIST