mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +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:
parent
33aa4182ca
commit
5a630d6bfa
@ -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)
|
||||||
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user