Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/callback_log_plays/runme.sh

raw
1 #!/usr/bin/env bash
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 set -eux
7
8 # ANSIBLE_CALLBACK_WHITELIST has been deprecated in ansible-base 2.11, ANSIBLE_CALLBACKS_ENABLED should be used
9 export ANSIBLE_CALLBACK_WHITELIST="community.general.log_plays,${ANSIBLE_CALLBACK_WHITELIST:-}"
10 export ANSIBLE_CALLBACKS_ENABLED="community.general.log_plays,${ANSIBLE_CALLBACKS_ENABLED:-}"
11
12 # run play, should create log and dir if needed
13 export ANSIBLE_LOG_FOLDER="logit"
14 ansible-playbook ping_log.yml -v "$@"
15 [[ -f "${ANSIBLE_LOG_FOLDER}/localhost" ]]
16
17 # now force it to fail
18 export ANSIBLE_LOG_FOLDER="logit.file"
19 touch "${ANSIBLE_LOG_FOLDER}"
20 ansible-playbook ping_log.yml -v "$@" 2>&1| grep -E "(Failure using method \(v2_runner_on_ok\) in callback plugin|Callback dispatch 'v2_runner_on_ok' failed for plugin)"
21 [[ ! -f "${ANSIBLE_LOG_FOLDER}/localhost" ]]