mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Further enhancements for include params tests
This commit is contained in:
parent
c9bfcf40d3
commit
b64a5ff73d
2 changed files with 27 additions and 7 deletions
|
@ -118,18 +118,38 @@
|
||||||
- result.cmd == "echo foo --arg=a --arg=b"
|
- result.cmd == "echo foo --arg=a --arg=b"
|
||||||
|
|
||||||
- name: test includes with params
|
- name: test includes with params
|
||||||
include: test_include.yml param={{ test_input }}
|
include: test_include.yml fact_name=include_params param="{{ test_input }}"
|
||||||
register: result
|
|
||||||
|
- name: assert the include set the correct fact for the param
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- include_params == test_input
|
||||||
|
|
||||||
- name: test includes with quoted params
|
- name: test includes with quoted params
|
||||||
include: test_include.yml param="this is a param with double quotes"
|
include: test_include.yml fact_name=double_quoted_param param="this is a param with double quotes"
|
||||||
register: result
|
|
||||||
|
- name: assert the include set the correct fact for the double quoted param
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- double_quoted_param == "this is a param with double quotes"
|
||||||
|
|
||||||
- name: test includes with single quoted params
|
- name: test includes with single quoted params
|
||||||
include: test_include.yml param='this is a param with single quotes'
|
include: test_include.yml fact_name=single_quoted_param param='this is a param with single quotes'
|
||||||
register: result
|
|
||||||
|
- name: assert the include set the correct fact for the single quoted param
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- single_quoted_param == "this is a param with single quotes"
|
||||||
|
|
||||||
- name: test includes with quoted params in complex args
|
- name: test includes with quoted params in complex args
|
||||||
include: test_include.yml
|
include: test_include.yml
|
||||||
vars:
|
vars:
|
||||||
|
fact_name: complex_param
|
||||||
param: "this is a param in a complex arg with double quotes"
|
param: "this is a param in a complex arg with double quotes"
|
||||||
|
|
||||||
|
- name: assert the include set the correct fact for the params in complex args
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- complex_param == "this is a param in a complex arg with double quotes"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
- debug: var=param
|
- set_fact: "{{fact_name}}='{{param}}'"
|
||||||
|
|
Loading…
Reference in a new issue