summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/ansible_log/runme.sh
blob: 84c58c4d9de3e8ffd9ec1add712bca1cfb8ee4f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

set -eux

ALOG=${OUTPUT_DIR}/ansible_log_test.log

ansible-playbook logit.yml
[ ! -f "${ALOG}" ]

ANSIBLE_LOG_PATH=${ALOG} ansible-playbook logit.yml
[ -f "${ALOG}" ]
grep -q 'ping' "${ALOG}"

rm "${ALOG}"
# inline grep should fail if EXEC was present
set +e
ANSIBLE_LOG_PATH=${ALOG} ANSIBLE_LOG_VERBOSITY=3 ansible-playbook -v logit.yml | tee /dev/stderr | grep -q EXEC
rc=$?
set -e
if [ "$rc" == "0" ]; then
    false  # fail if we found EXEC in stdout
fi
grep -q EXEC "${ALOG}"