From dfc97dcefd90fa0bbb5af87402e11e6ed3162525 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 9 Jan 2019 15:42:36 -0800 Subject: [PATCH] Move meta_tasks test inventory into test. --- test/integration/targets/meta_tasks/inventory | 3 +++ test/integration/targets/meta_tasks/runme.sh | 4 ++-- test/integration/targets/meta_tasks/test_end_host.yml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 test/integration/targets/meta_tasks/inventory diff --git a/test/integration/targets/meta_tasks/inventory b/test/integration/targets/meta_tasks/inventory new file mode 100644 index 00000000000..470333e7bac --- /dev/null +++ b/test/integration/targets/meta_tasks/inventory @@ -0,0 +1,3 @@ +[local] +testhost ansible_connection=local host_var_role_name=role3 +testhost2 ansible_connection=local host_var_role_name=role2 diff --git a/test/integration/targets/meta_tasks/runme.sh b/test/integration/targets/meta_tasks/runme.sh index 1549b4c5788..c9ddbfeb538 100755 --- a/test/integration/targets/meta_tasks/runme.sh +++ b/test/integration/targets/meta_tasks/runme.sh @@ -4,7 +4,7 @@ set -eux # test end_host meta task, with when conditional for test_strategy in linear free; do - out="$(ansible-playbook test_end_host.yml -i ../../inventory -e test_strategy=$test_strategy -vv "$@")" + out="$(ansible-playbook test_end_host.yml -i inventory -e test_strategy=$test_strategy -vv "$@")" grep -q "META: end_host conditional evaluated to false, continuing execution for testhost" <<< "$out" grep -q "META: ending play for testhost2" <<< "$out" @@ -14,7 +14,7 @@ done # test end_host meta task, on all hosts for test_strategy in linear free; do - out="$(ansible-playbook test_end_host_all.yml -i ../../inventory -e test_strategy=$test_strategy -vv "$@")" + out="$(ansible-playbook test_end_host_all.yml -i inventory -e test_strategy=$test_strategy -vv "$@")" grep -q "META: ending play for testhost" <<< "$out" grep -q "META: ending play for testhost2" <<< "$out" diff --git a/test/integration/targets/meta_tasks/test_end_host.yml b/test/integration/targets/meta_tasks/test_end_host.yml index 131d4d4e265..a8bb0562720 100644 --- a/test/integration/targets/meta_tasks/test_end_host.yml +++ b/test/integration/targets/meta_tasks/test_end_host.yml @@ -8,7 +8,7 @@ - debug: - meta: end_host - when: "host_var_role_name == 'role2'" # end play for testhost2, see test/integration/inventory + when: "host_var_role_name == 'role2'" # end play for testhost2, see inventory - debug: msg: "play not ended for {{ inventory_hostname }}"