Add include_import tests for many top level include_tasks (#36531)

* Add include_import tests for many top level include_tasks

Rename a few test playbooks to make more sense

* Use fewer include_tasks due to memory limits in CI
This commit is contained in:
Sam Doran 2018-04-11 17:08:33 -04:00 committed by ansibot
parent 98a6827be0
commit e5776a129a
6 changed files with 64 additions and 5 deletions

View file

@ -4,6 +4,12 @@ set -eux
export ANSIBLE_ROLES_PATH=./roles
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
}
## Import (static)
# Playbook
@ -33,11 +39,19 @@ ANSIBLE_STRATEGY='linear' ansible-playbook role/test_include_role.yml -i ../../i
ANSIBLE_STRATEGY='free' ansible-playbook role/test_include_role.yml -i ../../inventory "$@" --skip-tags never
## Recursion
## Max Recursion Depth
# https://github.com/ansible/ansible/issues/23609
ANSIBLE_STRATEGY='linear' ansible-playbook test_recursion.yml -i ../../inventory "$@" --skip-tags never
ANSIBLE_STRATEGY='linear' ansible-playbook test_role_recursion.yml -i ../../inventory "$@" --skip-tags never
## Nested tasks
# https://github.com/ansible/ansible/issues/34782
ANSIBLE_STRATEGY='linear' ansible-playbook nested.yml -i ../../inventory "$@" --skip-tags never
ANSIBLE_STRATEGY='free' ansible-playbook nested.yml -i ../../inventory "$@" --skip-tags never
ANSIBLE_STRATEGY='linear' ansible-playbook test_nested_tasks.yml -i ../../inventory "$@" --skip-tags never
ANSIBLE_STRATEGY='free' ansible-playbook test_nested_tasks.yml -i ../../inventory "$@" --skip-tags never
## 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
ANSIBLE_STRATEGY='linear' ansible-playbook test_copious_include_tasks.yml -i ../../inventory "$@" --skip-tags never
ANSIBLE_STRATEGY='free' ansible-playbook test_copious_include_tasks.yml -i ../../inventory "$@" --skip-tags never
rm -f tasks/hello/*.yml

View file

@ -0,0 +1 @@
tasks-file-*

View file

@ -0,0 +1,44 @@
- name: Test many include_tasks
hosts: testhost
gather_facts: no
tasks:
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-001.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-002.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-003.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-004.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-005.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-006.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-007.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-008.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-009.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-010.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-011.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-012.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-013.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-014.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-015.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-016.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-017.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-018.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-019.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-020.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-021.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-022.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-023.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-024.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-025.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-026.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-027.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-028.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-029.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-030.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-031.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-032.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-033.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-034.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-035.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-036.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-037.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-038.yml"
- include_tasks: "{{ playbook_dir }}/tasks/hello/tasks-file-039.yml"

View file

@ -3,4 +3,4 @@
include+meta doesnt mess included files mecanisms
hosts: testhost
tasks:
- include_tasks: ./tasks/nested/nested.yml
- include_tasks: ./tasks/nested/nested.yml