Merge pull request #10323 from wenottingham/look-over-there

Add additional controller directory for collections for inventory update

SUMMARY
This may be present in some scenarios with additional collections for inventory usage.

Reviewed-by: Alan Rominger <arominge@redhat.com>
This commit is contained in:
softwarefactory-project-zuul[bot] 2021-06-03 20:42:04 +00:00 committed by GitHub
commit e342919735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2391,6 +2391,12 @@ class RunInventoryUpdate(BaseTask):
paths = [config_values[config_setting]] + paths
paths = [os.path.join(CONTAINER_ROOT, folder)] + paths
env[env_key] = os.pathsep.join(paths)
if 'ANSIBLE_COLLECTIONS_PATHS' in env:
paths = env['ANSIBLE_COLLECTIONS_PATHS'].split(':')
else:
paths = ['~/.ansible/collections', '/usr/share/ansible/collections']
paths.append('/usr/share/automation-controller/collections')
env['ANSIBLE_COLLECTIONS_PATHS'] = os.pathsep.join(paths)
return env