mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03:30
on job template launch inherit variables in the following hierarchy
(bottom up): * Job Launch Extra Vars * Job Template Survey (defaults) * Job Template Extra vars
This commit is contained in:
@@ -282,6 +282,19 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
|
|||||||
survey_element['variable'],
|
survey_element['variable'],
|
||||||
survey_element['choices']))
|
survey_element['choices']))
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
def _update_unified_job_kwargs(self, **kwargs):
|
||||||
|
# Overwrite job extra_vars with job template extra vars
|
||||||
|
extra_vars = self.extra_vars_dict
|
||||||
|
|
||||||
|
# Overwrite with job template survey default vars
|
||||||
|
if self.survey_enabled and 'spec' in self.survey_spec:
|
||||||
|
for survey_element in self.survey_spec.get("spec", []):
|
||||||
|
if survey_element['default']:
|
||||||
|
extra_vars[survey_element['variable']] = survey_element['default']
|
||||||
|
|
||||||
|
kwargs['extra_vars'] = json.dumps(extra_vars)
|
||||||
|
return kwargs
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cache_timeout_blocked(self):
|
def cache_timeout_blocked(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user