mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
8049-expose execution node var for playbook (#13418)
Expose execution node var for playbook --------- Co-authored-by: Lucas Benedito <lbenedit@redhat.com>
This commit is contained in:
parent
e15f4de0dd
commit
7deddabea6
@ -831,6 +831,9 @@ class Job(UnifiedJob, JobOptions, SurveyJobMixin, JobNotificationMixin, TaskMana
|
||||
for name in JOB_VARIABLE_PREFIXES:
|
||||
r['{}_job_template_id'.format(name)] = self.job_template.pk
|
||||
r['{}_job_template_name'.format(name)] = self.job_template.name
|
||||
if self.execution_node:
|
||||
for name in JOB_VARIABLE_PREFIXES:
|
||||
r['{}_execution_node'.format(name)] = self.execution_node
|
||||
return r
|
||||
|
||||
'''
|
||||
|
||||
@ -107,7 +107,11 @@ class TestMetaVars:
|
||||
result_hash['{}_user_id'.format(name)] = 47
|
||||
result_hash['{}_inventory_id'.format(name)] = 45
|
||||
result_hash['{}_inventory_name'.format(name)] = 'example-inv'
|
||||
assert Job(name='fake-job', pk=42, id=42, launch_type='manual', created_by=maker, inventory=inv).awx_meta_vars() == result_hash
|
||||
result_hash['{}_execution_node'.format(name)] = 'example-exec-node'
|
||||
assert (
|
||||
Job(name='fake-job', pk=42, id=42, launch_type='manual', created_by=maker, inventory=inv, execution_node='example-exec-node').awx_meta_vars()
|
||||
== result_hash
|
||||
)
|
||||
|
||||
def test_project_update_metavars(self):
|
||||
data = Job(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user