1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Update playbook to set environment in supervisor config, expose job_args, job_cwd and job_env attributes via API.

This commit is contained in:
Chris Church 2013-07-15 14:37:21 -04:00
parent 33aa4182ca
commit 5a630d6bfa
2 changed files with 4 additions and 3 deletions

View File

@ -377,7 +377,8 @@ class JobSerializer(BaseSerializer):
'forks', 'limit', 'verbosity', 'extra_vars', 'forks', 'limit', 'verbosity', 'extra_vars',
'job_tags', 'launch_type', 'status', 'failed', 'job_tags', 'launch_type', 'status', 'failed',
'result_stdout', 'result_traceback', 'result_stdout', 'result_traceback',
'passwords_needed_to_start') 'passwords_needed_to_start', 'job_args',
'job_cwd', 'job_env')
def get_related(self, obj): def get_related(self, obj):
res = super(JobSerializer, self).get_related(obj) res = super(JobSerializer, self).get_related(obj)

View File

@ -205,8 +205,8 @@ class RunJob(Task):
raise RuntimeError('project local_path %s cannot be found in %s' % raise RuntimeError('project local_path %s cannot be found in %s' %
(job.project.local_path, root)) (job.project.local_path, root))
env = self.build_env(job, **kwargs) env = self.build_env(job, **kwargs)
job = self.update_job(job_pk, job_args=args, job_cwd=cwd, job = self.update_job(job_pk, job_args=json.dumps(args),
job_env=env) job_cwd=cwd, job_env=env)
status, stdout = self.run_pexpect(job_pk, args, cwd, env, status, stdout = self.run_pexpect(job_pk, args, cwd, env,
kwargs['passwords']) kwargs['passwords'])
except Exception: except Exception: