2016-10-12 21:57:53 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
2019-03-26 17:08:05 +00: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 07:47:28 +00:00
|
|
|
ANSIBLE_SSH_ARGS='-C -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null' \
|
2019-01-10 22:45:12 +00:00
|
|
|
ANSIBLE_HOST_KEY_CHECKING=false ansible-playbook test_delegate_to.yml -i inventory -v "$@"
|
2018-01-23 16:52:23 +00:00
|
|
|
|
2019-03-12 22:18:38 +00: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 20:10:04 +00:00
|
|
|
|
|
|
|
ansible-playbook test_delegate_to_loop_randomness.yml -v "$@"
|
2018-07-24 12:54:58 +00:00
|
|
|
|
2019-01-10 22:45:12 +00:00
|
|
|
ansible-playbook delegate_and_nolog.yml -i inventory -v "$@"
|
2018-10-10 19:10:23 +00:00
|
|
|
|
2019-01-10 22:45:12 +00:00
|
|
|
ansible-playbook delegate_facts_block.yml -i inventory -v "$@"
|
2018-10-18 20:25:43 +00:00
|
|
|
|
2019-01-10 22:45:12 +00:00
|
|
|
ansible-playbook test_delegate_to_loop_caching.yml -i inventory -v "$@"
|