Debian Codegraph @

test/integration/targets/include_vars-ad-hoc/runme.sh

raw
1 #!/usr/bin/env bash
2
3 set -eux -o pipefail
4
5 echo "single file include"
6 ansible testhost -i ../../inventory -m include_vars -a 'dir/inc.yml' -vvv 2>&1 | grep -q 'porter.*cable'
7
8 echo "single file encrypted include"
9 ansible testhost -i ../../inventory -m include_vars -a 'dir/encrypted.yml' -vvv --vault-password-file vaultpass > output.txt 2>&1
10
11 echo "directory include with encrypted"
12 ansible testhost -i ../../inventory -m include_vars -a 'dir=dir' -vvv --vault-password-file vaultpass >> output.txt 2>&1
13
14 grep -q 'output has been hidden' output.txt
15
16 # all content should be masked if any file is encrypted
17 if grep -e 'i am a secret' -e 'porter.*cable' output.txt; then
18 echo "FAIL: vault masking failed"
19 exit 1
20 fi
21
22 echo PASS