Debian Codegraph @

test/integration/targets/connection/test.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux
4
5 [ -f "${INVENTORY}" ]
6
7 ansible-playbook test_connection.yml -i "${INVENTORY}" "$@"
8
9 # Check that connection vars do not appear in the output
10 # https://github.com/ansible/ansible/pull/70853
11 trap "rm out.txt" EXIT
12
13 ansible all -i "${INVENTORY}" -m set_fact -a "testing=value" -v | tee out.txt
14 if grep 'ansible_host' out.txt
15 then
16 echo "FAILURE: Connection vars in output"
17 exit 1
18 else
19 echo "SUCCESS: Connection vars not found"
20 fi
21
22 ansible-playbook test_reset_connection.yml -i "${INVENTORY}" "$@"
23 ansible-playbook test_reset_connection_templated.yml -i "${INVENTORY}" "$@"