1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00
ansible-podman-collections/tests/integration/targets/connection_podman/runme.sh
Sagi Shnaidman ed1c5f5f42 Rewrite podman and buildah connections
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-09-11 20:25:32 +03:00

28 lines
987 B
Bash
Executable file

#!/usr/bin/env bash
set -o pipefail
set -eux
function run_ansible {
${SUDO:-} ${ANSIBLECMD:-ansible-playbook} ../connection/test_connection.yml -i "test_connection.inventory" \
-e target_hosts="podman" \
-e action_prefix= \
-e local_tmp=/tmp/ansible-local \
-e remote_tmp=/tmp/ansible-remote \
"$@"
}
run_ansible "$@"
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 run_ansible "$@"
ANSIBLE_VERBOSITY=4 ANSIBLE_REMOTE_TMP="/tmp" ANSIBLE_REMOTE_USER="1000" run_ansible "$@" | tee check_log
${SUDO:-} grep -q "Using podman connection from collection" check_log
${SUDO:-} rm -f check_log
set +o pipefail
ANSIBLE_PODMAN_EXECUTABLE=fakepodman run_ansible "$@" 2>&1 | grep "Could not find fakepodman in PATH"
set -o pipefail
ANSIBLE_PODMAN_EXECUTABLE=fakepodman run_ansible "$@" && {
echo "Playbook with fakepodman should fail!"
exit 1
}
ANSIBLE_VERBOSITY=4 ANSIBLE_PODMAN_EXTRA_ARGS=" --log-level debug " run_ansible "$@" | grep "level=debug msg="