diff options
author | Kshitij Chawla <kc.insight.pi@gmail.com> | 2020-06-10 19:22:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 13:22:40 -0400 |
commit | 32c392e622976b9921720f6961d4e871a88b7646 (patch) | |
tree | 4f43347f0b79ffd7766bc3022cce4f6f9c3bd995 /test/integration/targets/include_import | |
parent | ac2046637510eed8e31ca0c88aebce3279f38070 (diff) | |
download | ansible-32c392e622976b9921720f6961d4e871a88b7646.tar.gz |
Raise Warning when import_playbook receives additional parameters (#64156)
* Extra whitespace around imported playbook filename are stripped.
* Corrected call for display.deprecated
* Changed warning type & added test
* Added auto verification of raised warning
* More accurate warning message
Diffstat (limited to 'test/integration/targets/include_import')
-rw-r--r-- | test/integration/targets/include_import/playbook/test_import_playbook.yml | 3 | ||||
-rwxr-xr-x | test/integration/targets/include_import/runme.sh | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/test/integration/targets/include_import/playbook/test_import_playbook.yml b/test/integration/targets/include_import/playbook/test_import_playbook.yml index 91c6a19880..a58946080c 100644 --- a/test/integration/targets/include_import/playbook/test_import_playbook.yml +++ b/test/integration/targets/include_import/playbook/test_import_playbook.yml @@ -1,3 +1,6 @@ +# Test that additional parameters after import_playbook raises a warning & strips whitespaces +- import_playbook: playbook1.yml tags=test_import + # Test and validate playbook import - import_playbook: playbook1.yml - import_playbook: validate1.yml diff --git a/test/integration/targets/include_import/runme.sh b/test/integration/targets/include_import/runme.sh index 0a052a1822..4dbe905307 100755 --- a/test/integration/targets/include_import/runme.sh +++ b/test/integration/targets/include_import/runme.sh @@ -17,8 +17,8 @@ ansible -m include_role -a name=role1 localhost ## Import (static) # Playbook -ANSIBLE_STRATEGY='linear' ansible-playbook playbook/test_import_playbook.yml -i inventory "$@" -ANSIBLE_STRATEGY='free' ansible-playbook playbook/test_import_playbook.yml -i inventory "$@" +test "$(ansible-playbook -i ../../inventory playbook/test_import_playbook.yml "$@" 2>&1 | grep -c '\[WARNING\]: Additional parameters in import_playbook')" = 1 + ANSIBLE_STRATEGY='linear' ansible-playbook playbook/test_import_playbook_tags.yml -i inventory "$@" --tags canary1,canary22,validate --skip-tags skipme # Tasks |