store cloudforms inventory cache files in the proper location on disk

with process isolation enabled (which is the awx default), cloudforms
caches inventory script results on disk; awx should direct cloudforms to
store these cache files in a location that's exposed to the isolated
environment

see: ansible/ansible#31760
This commit is contained in:
Ryan Petrello
2017-10-17 17:06:48 -04:00
parent 3d12e040ed
commit 5895654538
2 changed files with 9 additions and 0 deletions

View File

@@ -1794,6 +1794,11 @@ class RunInventoryUpdate(BaseTask):
section = 'cache'
cp.add_section(section)
cp.set(section, 'max_age', "0")
cache_path = tempfile.mkdtemp(
prefix='cloudforms_cache',
dir=kwargs.get('private_data_dir', None)
)
cp.set(section, 'path', cache_path)
elif inventory_update.source == 'azure_rm':
section = 'azure'