Include executor variables in initial setup call

We call setup before we run playbooks to gather some information on
nodes. But sometimes variables might be needed for the setup module to
complete (such as the case where you want to use images without
/usr/bin/python and thus want to set ansible_python_interpreter to
something else).

Change-Id: I11fb912a86cedc67848f745f0afe16619a1d1e47
This commit is contained in:
Clint Byrum 2018-09-03 10:50:54 -07:00
parent 60cabbd368
commit bde27fa4ec
1 changed files with 2 additions and 0 deletions

View File

@ -1830,6 +1830,8 @@ class AnsibleJob(object):
cmd = ['ansible', '*', verbose, '-m', 'setup',
'-i', self.jobdir.setup_inventory,
'-a', 'gather_subset=!all']
if self.executor_variables_file is not None:
cmd.extend(['-e@%s' % self.executor_variables_file])
result, code = self.runAnsible(
cmd=cmd, timeout=60, playbook=playbook,