mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 20:07:37 -02:30
Add extra_vars example to Job Launch module, update extra_vars type to dict,
update unit test, add details to Collections release notes.
This commit is contained in:
@@ -42,17 +42,23 @@ def test_job_launch_with_prompting(run_module, admin_user, project, inventory, m
|
||||
name='foo',
|
||||
project=project,
|
||||
playbook='helloworld.yml',
|
||||
ask_variables_on_launch=True,
|
||||
ask_inventory_on_launch=True,
|
||||
ask_credential_on_launch=True
|
||||
)
|
||||
result = run_module('tower_job_launch', dict(
|
||||
job_template='foo',
|
||||
inventory=inventory.name,
|
||||
credential=machine_credential.name
|
||||
credential=machine_credential.name,
|
||||
extra_vars={"var1": "My First Variable",
|
||||
"var2": "My Second Variable",
|
||||
"var3": "My Third Variable"
|
||||
}
|
||||
), admin_user)
|
||||
assert result.pop('changed', None), result
|
||||
|
||||
job = Job.objects.get(id=result['id'])
|
||||
assert job.extra_vars == '{"var1": "My First Variable", "var2": "My Second Variable", "var3": "My Third Variable"}'
|
||||
assert job.inventory == inventory
|
||||
assert [cred.id for cred in job.credentials.all()] == [machine_credential.id]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user