2018-01-19 16:23:48 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
export ANSIBLE_ROLES_PATH=./roles
|
|
|
|
|
2018-04-11 21:08:33 +00:00
|
|
|
function gen_task_files() {
|
|
|
|
for i in $(seq -f '%03g' 1 39); do
|
|
|
|
echo -e "- name: Hello Message\n debug:\n msg: Task file ${i}" > "tasks/hello/tasks-file-${i}.yml"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2018-01-19 16:23:48 +00:00
|
|
|
## Import (static)
|
|
|
|
|
|
|
|
# Playbook
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook playbook/test_import_playbook.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook playbook/test_import_playbook.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook playbook/test_import_playbook_tags.yml -i ../../inventory "$@" --tags canary1,canary22,validate --skip-tags skipme
|
2018-01-19 16:23:48 +00:00
|
|
|
|
|
|
|
# Tasks
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook tasks/test_import_tasks.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_import_tasks.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_import_tasks_tags.yml -i ../../inventory "$@" --tags tasks1,canary1,validate
|
2018-01-19 16:23:48 +00:00
|
|
|
|
|
|
|
# Role
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook role/test_import_role.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook role/test_import_role.yml -i ../../inventory "$@"
|
2018-01-19 16:23:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Include (dynamic)
|
|
|
|
|
|
|
|
# Tasks
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook tasks/test_include_tasks.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_include_tasks.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_include_tasks_tags.yml -i ../../inventory "$@" --tags tasks1,canary1,validate
|
2018-01-19 16:23:48 +00:00
|
|
|
|
|
|
|
# Role
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook role/test_include_role.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook role/test_include_role.yml -i ../../inventory "$@"
|
2018-01-19 16:23:48 +00:00
|
|
|
|
|
|
|
|
2018-04-11 21:08:33 +00:00
|
|
|
## Max Recursion Depth
|
2018-01-19 16:23:48 +00:00
|
|
|
# https://github.com/ansible/ansible/issues/23609
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook test_role_recursion.yml -i ../../inventory "$@"
|
2018-01-31 13:35:06 +00:00
|
|
|
|
|
|
|
## Nested tasks
|
|
|
|
# https://github.com/ansible/ansible/issues/34782
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook test_nested_tasks.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook test_nested_tasks.yml -i ../../inventory "$@"
|
2018-04-11 21:08:33 +00:00
|
|
|
|
|
|
|
## Tons of top level include_tasks
|
|
|
|
# https://github.com/ansible/ansible/issues/36053
|
|
|
|
# Fixed by https://github.com/ansible/ansible/pull/36075
|
|
|
|
gen_task_files
|
2018-05-03 04:56:42 +00:00
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook test_copious_include_tasks.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook test_copious_include_tasks.yml -i ../../inventory "$@"
|
2018-04-11 21:08:33 +00:00
|
|
|
rm -f tasks/hello/*.yml
|
2018-04-16 21:46:47 +00:00
|
|
|
|
|
|
|
# Inlcuded tasks should inherit attrs from non-dynamic blocks in parent chain
|
|
|
|
# https://github.com/ansible/ansible/pull/38827
|
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook test_grandparent_inheritance.yml -i ../../inventory "$@"
|
2018-04-26 18:39:44 +00:00
|
|
|
|
|
|
|
# undefined_var
|
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook undefined_var/playbook.yml -i ../../inventory "$@"
|
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook undefined_var/playbook.yml -i ../../inventory "$@"
|
2018-04-26 19:25:02 +00:00
|
|
|
|
2018-05-31 17:08:38 +00:00
|
|
|
# include_ + apply (explicit inheritance)
|
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook apply/include_apply.yml -i ../../inventory "$@" --tags foo
|
|
|
|
set +e
|
|
|
|
OUT=$(ANSIBLE_STRATEGY='linear' ansible-playbook apply/import_apply.yml -i ../../inventory "$@" --tags foo 2>&1 | grep 'ERROR! Invalid options for import_tasks: apply')
|
|
|
|
set -e
|
|
|
|
if [[ -z "$OUT" ]]; then
|
|
|
|
echo "apply on import_tasks did not cause error"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-06-08 20:36:22 +00:00
|
|
|
|
|
|
|
# Test that duplicate items in loop are not deduped
|
|
|
|
ANSIBLE_STRATEGY='linear' ansible-playbook tasks/test_include_dupe_loop.yml -i ../../inventory "$@" | tee test_include_dupe_loop.out
|
2018-07-09 15:27:00 +00:00
|
|
|
test "$(grep -c '"item=foo"' test_include_dupe_loop.out)" = 3
|
2018-06-08 20:36:22 +00:00
|
|
|
ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_include_dupe_loop.yml -i ../../inventory "$@" | tee test_include_dupe_loop.out
|
2018-07-15 14:59:30 +00:00
|
|
|
test "$(grep -c '"item=foo"' test_include_dupe_loop.out)" = 3
|
|
|
|
|
|
|
|
ansible-playbook public_exposure/playbook.yml -i ../../inventory "$@"
|
2018-10-12 15:43:09 +00:00
|
|
|
ansible-playbook public_exposure/no_bleeding.yml -i ../../inventory "$@"
|
2018-10-23 16:08:48 +00:00
|
|
|
ansible-playbook public_exposure/no_overwrite_roles.yml -i ../../inventory "$@"
|
2018-11-08 15:29:24 +00:00
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/pull/48068
|
|
|
|
ansible-playbook run_once/playbook.yml "$@"
|