work around an ansible bug that can cause project syncs to fail

https://github.com/ansible/ansible-tower/issues/7746
https://github.com/ansible/ansible/issues/30064
This commit is contained in:
Ryan Petrello
2017-10-25 11:07:42 -04:00
parent 70919638ba
commit c95d7d465a

View File

@@ -1017,6 +1017,9 @@ class RunJob(BaseTask):
plugin_path = ':'.join(plugin_dirs)
env = super(RunJob, self).build_env(job, **kwargs)
env = self.add_ansible_venv(env, add_awx_lib=kwargs.get('isolated', False))
# give ansible a hint about the intended tmpdir to work around issues
# like https://github.com/ansible/ansible/issues/30064
env['TMPDIR'] = settings.AWX_PROOT_BASE_PATH
# Set environment variables needed for inventory and job event
# callbacks to work.
env['JOB_ID'] = str(job.pk)