1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #50735 from mattclay/callback-inv

Move callback_default test inventory into test.
This commit is contained in:
Matt Clay 2019-01-09 18:00:17 -08:00 committed by GitHub
parent 39824f50b1
commit 6179f2f51c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 10 deletions

View file

@ -75,6 +75,3 @@ localhost ansible_ssh_host=127.0.0.1 ansible_connection=local
[azure]
localhost ansible_ssh_host=127.0.0.1 ansible_connection=local
[nonexistent]
testhost5 ansible_host=169.254.199.200

View file

@ -1 +1,2 @@
shippable/posix/group3
needs/ssh

View file

@ -1,2 +1,2 @@
+ ansible-playbook -i ../../inventory test.yml
+ ansible-playbook -i inventory test.yml
++ set +x

View file

@ -1,3 +1,3 @@
+ ansible-playbook -i ../../inventory test.yml
+ ansible-playbook -i inventory test.yml
++ set +x
fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"}

View file

@ -1,2 +1,2 @@
+ ansible-playbook -i ../../inventory test.yml
+ ansible-playbook -i inventory test.yml
++ set +x

View file

@ -1,2 +1,2 @@
+ ansible-playbook -i ../../inventory test.yml
+ ansible-playbook -i inventory test.yml
++ set +x

View file

@ -1,2 +1,2 @@
+ ansible-playbook -i ../../inventory test.yml
+ ansible-playbook -i inventory test.yml
++ set +x

View file

@ -0,0 +1,5 @@
[local]
testhost ansible_connection=local
[nonexistent]
testhost5 ansible_host=169.254.199.200

View file

@ -18,7 +18,7 @@ run_test() {
# The shenanigans with redirection and 'tee' are to capture STDOUT and
# STDERR separately while still displaying both to the console
{ ansible-playbook -i ../../inventory test.yml \
{ ansible-playbook -i inventory test.yml \
> >(set +x; tee "${OUTFILE}.${testname}.stdout"); } \
2> >(set +x; tee "${OUTFILE}.${testname}.stderr" >&2)
diff -u "${ORIGFILE}.${testname}.stdout" "${OUTFILE}.${testname}.stdout" || diff_failure
@ -122,7 +122,7 @@ export ANSIBLE_DISPLAY_FAILED_STDERR=1
# Check if UNREACHBLE is available in stderr
set +e
ansible-playbook -i ../../inventory test_2.yml > >(set +x; tee "${BASEFILE}.unreachable.stdout";) 2> >(set +x; tee "${BASEFILE}.unreachable.stderr" >&2) || true
ansible-playbook -i inventory test_2.yml > >(set +x; tee "${BASEFILE}.unreachable.stdout";) 2> >(set +x; tee "${BASEFILE}.unreachable.stderr" >&2) || true
set -e
if test "$(grep -c 'UNREACHABLE' "${BASEFILE}.unreachable.stderr")" -ne 1; then
echo "Test failed"