2016-10-12 23:57:53 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
2019-03-26 18:08:05 +01:00
|
|
|
platform="$(uname)"
|
|
|
|
|
|
|
|
function setup() {
|
|
|
|
if [[ "${platform}" == "FreeBSD" ]] || [[ "${platform}" == "Darwin" ]]; then
|
|
|
|
ifconfig lo0
|
|
|
|
|
|
|
|
existing=$(ifconfig lo0 | grep '^[[:blank:]]inet 127\.0\.0\. ' || true)
|
|
|
|
|
|
|
|
echo "${existing}"
|
|
|
|
|
|
|
|
for i in 3 4 254; do
|
|
|
|
ip="127.0.0.${i}"
|
|
|
|
|
|
|
|
if [[ "${existing}" != *"${ip}"* ]]; then
|
|
|
|
ifconfig lo0 alias "${ip}" up
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
ifconfig lo0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function teardown() {
|
|
|
|
if [[ "${platform}" == "FreeBSD" ]] || [[ "${platform}" == "Darwin" ]]; then
|
|
|
|
for i in 3 4 254; do
|
|
|
|
ip="127.0.0.${i}"
|
|
|
|
|
|
|
|
if [[ "${existing}" != *"${ip}"* ]]; then
|
|
|
|
ifconfig lo0 -alias "${ip}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
ifconfig lo0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
setup
|
|
|
|
|
|
|
|
trap teardown EXIT
|
|
|
|
|
2017-07-06 09:47:28 +02:00
|
|
|
ANSIBLE_SSH_ARGS='-C -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null' \
|
2019-01-10 23:45:12 +01:00
|
|
|
ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook test_delegate_to.yml -i inventory -v "$@"
|
2018-01-23 17:52:23 +01:00
|
|
|
|
2019-03-12 23:18:38 +01:00
|
|
|
# this test is not doing what it says it does, also relies on var that should not be available
|
|
|
|
#ansible-playbook test_loop_control.yml -v "$@"
|
2018-06-26 22:10:04 +02:00
|
|
|
|
|
|
|
ansible-playbook test_delegate_to_loop_randomness.yml -v "$@"
|
2018-07-24 14:54:58 +02:00
|
|
|
|
2019-01-10 23:45:12 +01:00
|
|
|
ansible-playbook delegate_and_nolog.yml -i inventory -v "$@"
|
2018-10-10 21:10:23 +02:00
|
|
|
|
2019-01-10 23:45:12 +01:00
|
|
|
ansible-playbook delegate_facts_block.yml -i inventory -v "$@"
|
2018-10-18 22:25:43 +02:00
|
|
|
|
2019-01-10 23:45:12 +01:00
|
|
|
ansible-playbook test_delegate_to_loop_caching.yml -i inventory -v "$@"
|
2020-05-14 22:36:13 +02:00
|
|
|
|
|
|
|
# ensure we are using correct settings when delegating
|
|
|
|
ANSIBLE_TIMEOUT=3 ansible-playbook delegate_vars_hanldling.yml -i inventory -v "$@"
|
2020-05-22 15:31:34 +02:00
|
|
|
|
2020-07-22 17:13:57 +02:00
|
|
|
ansible-playbook has_hostvars.yml -i inventory -v "$@"
|
2020-05-22 15:31:34 +02:00
|
|
|
|
|
|
|
# test ansible_x_interpreter
|
|
|
|
# python
|
|
|
|
source virtualenv.sh
|
|
|
|
(
|
|
|
|
cd "${OUTPUT_DIR}"/venv/bin
|
|
|
|
ln -s python firstpython
|
|
|
|
ln -s python secondpython
|
|
|
|
)
|
|
|
|
ansible-playbook verify_interpreter.yml -i inventory_interpreters -v "$@"
|
2020-06-12 00:04:17 +02:00
|
|
|
ansible-playbook discovery_applied.yml -i inventory -v "$@"
|
2020-10-02 21:13:56 +02:00
|
|
|
ansible-playbook resolve_vars.yml -i inventory -v "$@"
|
2020-11-09 22:21:17 +01:00
|
|
|
ansible-playbook test_delegate_to_lookup_context.yml -i inventory -v "$@"
|
|
|
|
ansible-playbook delegate_local_from_root.yml -i inventory -v "$@" -e 'ansible_user=root'
|
2021-05-24 16:13:19 +02:00
|
|
|
ansible-playbook delegate_with_fact_from_delegate_host.yml "$@"
|