From 280e9d7bb7efec4bd745de3843908d6e3ac3a58b Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 3 Oct 2017 14:54:25 -0400 Subject: [PATCH] dont follow symlinks for inventories now symlink dir is checked for locality of group/host_vars fixes #31195 (cherry picked from commit f00d47fac03754d6729ca5fd6738e5bfe66a510c) --- CHANGELOG.md | 1 + lib/ansible/cli/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a46fae9ada6..d1a0d11936a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/ansible/cli/__init__.py b/lib/ansible/cli/__init__.py index 7d285740642..3660e4bf15d 100644 --- a/lib/ansible/cli/__init__.py +++ b/lib/ansible/cli/__init__.py @@ -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