diff options
Diffstat (limited to 'test/integration')
62 files changed, 3 insertions, 650 deletions
diff --git a/test/integration/inventory b/test/integration/inventory index 3b53217928..697a6a8ba0 100644 --- a/test/integration/inventory +++ b/test/integration/inventory @@ -1,5 +1,5 @@ [local] -testhost ansible_ssh_host=127.0.0.1 ansible_connection=local host_var_role_name=role3 +testhost ansible_ssh_host=127.0.0.1 ansible_connection=local testhost2 ansible_ssh_host=127.0.0.1 ansible_connection=local # For testing delegate_to testhost3 ansible_ssh_host=127.0.0.3 diff --git a/test/integration/targets/include_import/aliases b/test/integration/targets/include_import/aliases deleted file mode 100644 index 79d8b9285e..0000000000 --- a/test/integration/targets/include_import/aliases +++ /dev/null @@ -1 +0,0 @@ -posix/ci/group3 diff --git a/test/integration/targets/include_import/playbook/group_vars/all.yml b/test/integration/targets/include_import/playbook/group_vars/all.yml deleted file mode 100644 index 9acd8c64cd..0000000000 --- a/test/integration/targets/include_import/playbook/group_vars/all.yml +++ /dev/null @@ -1 +0,0 @@ -group_var1: set in group_vars/all.yml diff --git a/test/integration/targets/include_import/playbook/playbook1.yml b/test/integration/targets/include_import/playbook/playbook1.yml deleted file mode 100644 index 55c66d8096..0000000000 --- a/test/integration/targets/include_import/playbook/playbook1.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: Playbook 1 - hosts: testhost2 - - tasks: - - name: Set fact in playbook 1 - set_fact: - canary_var1: playbook1 imported - tags: - - canary1 diff --git a/test/integration/targets/include_import/playbook/playbook2.yml b/test/integration/targets/include_import/playbook/playbook2.yml deleted file mode 100644 index c986165e85..0000000000 --- a/test/integration/targets/include_import/playbook/playbook2.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: Playbook 2 - hosts: testhost2 - - tasks: - - name: Set fact in playbook 2 - set_fact: - canary_var2: playbook2 imported - tags: - - canary2 diff --git a/test/integration/targets/include_import/playbook/playbook3.yml b/test/integration/targets/include_import/playbook/playbook3.yml deleted file mode 100644 index b62b96c33e..0000000000 --- a/test/integration/targets/include_import/playbook/playbook3.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: Playbook 3 - hosts: testhost2 - - tasks: - - name: Set fact in playbook 3 - set_fact: - canary_var3: playbook3 imported - include_next_playbook: yes - tags: - - canary3 diff --git a/test/integration/targets/include_import/playbook/playbook4.yml b/test/integration/targets/include_import/playbook/playbook4.yml deleted file mode 100644 index 330612a96f..0000000000 --- a/test/integration/targets/include_import/playbook/playbook4.yml +++ /dev/null @@ -1,9 +0,0 @@ -- name: Playbook 4 - hosts: testhost2 - - tasks: - - name: Set fact in playbook 4 - set_fact: - canary_var4: playbook4 imported - tags: - - canary4 diff --git a/test/integration/targets/include_import/playbook/test_import_playbook.yml b/test/integration/targets/include_import/playbook/test_import_playbook.yml deleted file mode 100644 index 51443ea80f..0000000000 --- a/test/integration/targets/include_import/playbook/test_import_playbook.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Test and validate playbook import -- import_playbook: playbook1.yml -- import_playbook: validate1.yml - - -# Test and validate conditional import -- import_playbook: playbook2.yml - when: no - -- import_playbook: validate2.yml - -- import_playbook: playbook3.yml -- import_playbook: playbook4.yml - when: include_next_playbook - -- import_playbook: validate34.yml diff --git a/test/integration/targets/include_import/playbook/test_import_playbook_tags.yml b/test/integration/targets/include_import/playbook/test_import_playbook_tags.yml deleted file mode 100644 index 46136f6fb8..0000000000 --- a/test/integration/targets/include_import/playbook/test_import_playbook_tags.yml +++ /dev/null @@ -1,10 +0,0 @@ -- import_playbook: playbook1.yml # Test tag in tasks in included play -- import_playbook: playbook2.yml # Test tag added to import_playbook - tags: - - canary22 - -- import_playbook: playbook3.yml # Test skipping tags added to import_playbook - tags: - - skipme - -- import_playbook: validate_tags.yml # Validate diff --git a/test/integration/targets/include_import/playbook/validate1.yml b/test/integration/targets/include_import/playbook/validate1.yml deleted file mode 100644 index 0018344d14..0000000000 --- a/test/integration/targets/include_import/playbook/validate1.yml +++ /dev/null @@ -1,10 +0,0 @@ -- hosts: testhost2 - - tasks: - - name: Assert that variable was set in playbook1.yml - assert: - that: - - canary_var1 == 'playbook1 imported' - tags: - - validate - - validate1 diff --git a/test/integration/targets/include_import/playbook/validate2.yml b/test/integration/targets/include_import/playbook/validate2.yml deleted file mode 100644 index f22bcb6ebf..0000000000 --- a/test/integration/targets/include_import/playbook/validate2.yml +++ /dev/null @@ -1,10 +0,0 @@ -- hosts: testhost2 - - tasks: - - name: Assert that playbook2.yml was skipeed - assert: - that: - - canary_var2 is not defined - tags: - - validate - - validate2 diff --git a/test/integration/targets/include_import/playbook/validate34.yml b/test/integration/targets/include_import/playbook/validate34.yml deleted file mode 100644 index fd53a30539..0000000000 --- a/test/integration/targets/include_import/playbook/validate34.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: testhost2 - - tasks: - - name: Assert that playbook3.yml and playbook4.yml were imported - assert: - that: - - canary_var3 == 'playbook3 imported' - - canary_var4 == 'playbook4 imported' - tags: - - validate - - validate34 diff --git a/test/integration/targets/include_import/playbook/validate_tags.yml b/test/integration/targets/include_import/playbook/validate_tags.yml deleted file mode 100644 index acdcb1f2a4..0000000000 --- a/test/integration/targets/include_import/playbook/validate_tags.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: testhost2 - - tasks: - - name: Assert that only tasks with tags were run - assert: - that: - - canary_var1 == 'playbook1 imported' - - canary_var2 == 'playbook2 imported' - - canary_var3 is not defined - tags: - - validate diff --git a/test/integration/targets/include_import/role/test_import_role.yml b/test/integration/targets/include_import/role/test_import_role.yml deleted file mode 100644 index 8a8bdc1724..0000000000 --- a/test/integration/targets/include_import/role/test_import_role.yml +++ /dev/null @@ -1,138 +0,0 @@ -- name: Test import_role - hosts: testhost - - vars: - run_role: yes - do_not_run_role: no - role_name: role1 - test_var: templating test in playbook - role_vars: - where_am_i_defined: in the playbook - entire_task: - include_role: - name: role1 - - tasks: - - name: Test basic role import - import_role: - name: role1 - - - name: Assert that basic include works - assert: - that: - - _role1_result.msg == 'In role1' - - - name: Test conditional role include - import_role: - name: role1 - tasks_from: canary1.yml - when: run_role - - - name: Assert that role ran - assert: - that: - - role1_canary1 == 'r1c1' - - - name: Test conditional role import that should be skipped - import_role: - name: role1 - tasks_from: canary2.yml - when: do_not_run_role - - - name: Assert that role did not run - assert: - that: - - role1_canary2 is not defined - - # FIXME We expect this to fail, but I'm not sure how best to test for - # syntax level failures. - # - # - name: Test role import with a loop - # import_role: - # name: "{{ item }}" - # register: loop_test - # with_items: - # - role1 - # - role3 - # - role2 - - - name: Test importing a task file from a role - import_role: - name: role1 - tasks_from: tasks.yml - - - name: Test importing vars file and tasks file from a role - import_role: - name: role3 - tasks_from: vartest.yml - vars_from: role3vars.yml - private: no - - # FIXME Setting private: no in previous task does not make the variables - # available to the play - # - - name: Assert that variables defined in previous task are available to play - assert: - that: - - role3_default == 'defined in role3/defaults/main.yml' - - role3_main == 'defined in role3/vars/main.yml' - - role3_var == 'defined in role3/vars/role3vars.yml' - ignore_errors: yes - - - name: Test using a play variable for role name - import_role: - name: "{{ role_name }}" - - # FIXME Trying to use a host_var here causes play execution to fail because - # the variable is undefined. - # - # - name: Test using a host variable for role name - # import_role: - # name: "{{ host_var_role_name }}" - - - name: Pass variable to role - import_role: - name: role1 - tasks_from: vartest.yml - vars: - where_am_i_defined: in the task - - ## FIXME Currently failing - ## ERROR! Vars in a IncludeRole must be specified as a dictionary, or a list of dictionaries - # - name: Pass all variables in a variable to role - # import_role: - # name: role1 - # tasks_from: vartest.yml - # vars: "{{ role_vars }}" - - - name: Pass templated variable to a role - import_role: - name: role1 - tasks_from: vartest.yml - vars: - where_am_i_defined: "{{ test_var }}" - - # FIXME This fails with the following error: - # The module {u'import_role': {u'name': u'role1'}} was not found in configured module paths. - # - - name: Include an entire task - action: - module: "{{ entire_task }}" - tags: - - never - - - block: - - name: Include a role that will fail - import_role: - name: role1 - tasks_from: fail.yml - - rescue: - - name: Include a role inside rescue - import_role: - name: role2 - - always: - - name: Include role inside always - import_role: - name: role3 diff --git a/test/integration/targets/include_import/role/test_include_role.yml b/test/integration/targets/include_import/role/test_include_role.yml deleted file mode 100644 index 79f4a78f0b..0000000000 --- a/test/integration/targets/include_import/role/test_include_role.yml +++ /dev/null @@ -1,128 +0,0 @@ -- name: Test include_role - hosts: testhost - - vars: - run_role: yes - do_not_run_role: no - role_name: role1 - test_var: templating test in playbook - role_vars: - where_am_i_defined: in the playbook - entire_task: - include_role: - name: role1 - - tasks: - - name: Test basic role include - include_role: - name: role1 - - - name: Assert that basic include works - assert: - that: - - _role1_result.msg == 'In role1' - - - name: Test conditional role include - include_role: - name: role1 - tasks_from: canary1.yml - when: run_role - - - name: Assert that role ran - assert: - that: - - role1_canary1 == 'r1c1' - - - name: Test conditional role include that should be skipped - include_role: - name: role1 - tasks_from: canary2.yml - when: do_not_run_role - - - name: Assert that role did not run - assert: - that: - - role1_canary2 is not defined - - - name: Test role include with a loop - include_role: - name: "{{ item }}" - register: loop_test - with_items: - - role1 - - role3 - - role2 - - - name: Test including a task file from a role - include_role: - name: role1 - tasks_from: tasks.yml - - - name: Test including vars file and tasks file from a role - include_role: - name: role3 - tasks_from: vartest.yml - vars_from: role3vars.yml - private: no - - # FIXME Setting private: no in previous task does not make the variables - # available to the play - - name: Assert that variables defined in previous task are available to play - assert: - that: - - role3_default == 'defined in role3/defaults/main.yml' - - role3_main == 'defined in role3/vars/main.yml' - - role3_var == 'defined in role3/vars/role3vars.yml' - ignore_errors: yes - - - name: Test using a play variable for role name - include_role: - name: "{{ role_name }}" - - - name: Test using a host variable for role name - include_role: - name: "{{ host_var_role_name }}" - - - name: Pass variable to role - include_role: - name: role1 - tasks_from: vartest.yml - vars: - where_am_i_defined: in the task - - ## FIXME Currently failing with - ## ERROR! Vars in a IncludeRole must be specified as a dictionary, or a list of dictionaries - # - name: Pass all variables in a variable to role - # include_role: - # name: role1 - # tasks_from: vartest.yml - # vars: "{{ role_vars }}" - - - name: Pass templated variable to a role - include_role: - name: role1 - tasks_from: vartest.yml - vars: - where_am_i_defined: "{{ test_var }}" - - ## FIXME This fails with the following error: - ## The module {u'include_role': {u'name': u'role1'}} was not found in configured module paths. - # - name: Include an entire task - # action: - # module: "{{ entire_task }}" - - - block: - - name: Include a role that will fail - include_role: - name: role1 - tasks_from: fail.yml - - rescue: - - name: Include a role inside rescue - include_role: - name: role2 - - always: - - name: Include role inside always - include_role: - name: role3 diff --git a/test/integration/targets/include_import/roles/role1/tasks/canary1.yml b/test/integration/targets/include_import/roles/role1/tasks/canary1.yml deleted file mode 100644 index 9f202ba337..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/canary1.yml +++ /dev/null @@ -1,2 +0,0 @@ -- set_fact: - role1_canary1: r1c1 diff --git a/test/integration/targets/include_import/roles/role1/tasks/canary2.yml b/test/integration/targets/include_import/roles/role1/tasks/canary2.yml deleted file mode 100644 index 80e18b8dda..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/canary2.yml +++ /dev/null @@ -1,2 +0,0 @@ -- set_fact: - role1_canary2: r1c2 diff --git a/test/integration/targets/include_import/roles/role1/tasks/fail.yml b/test/integration/targets/include_import/roles/role1/tasks/fail.yml deleted file mode 100644 index b1b5f1553a..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/fail.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: EXPECTED FAILURE - fail: - msg: This command should always fail diff --git a/test/integration/targets/include_import/roles/role1/tasks/main.yml b/test/integration/targets/include_import/roles/role1/tasks/main.yml deleted file mode 100644 index a8b641ee44..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -- debug: - msg: In role1 - register: _role1_result diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t01.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t01.yml deleted file mode 100644 index e4a1e63e9c..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t01.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t02.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t02.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t02.yml deleted file mode 100644 index d3d37507eb..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t02.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t03.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t03.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t03.yml deleted file mode 100644 index 1d3330aea8..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t03.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t04.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t04.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t04.yml deleted file mode 100644 index f3eece23f4..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t04.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t05.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t05.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t05.yml deleted file mode 100644 index 4c7371eebc..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t05.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t06.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t06.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t06.yml deleted file mode 100644 index 96d5660946..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t06.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t07.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t07.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t07.yml deleted file mode 100644 index ee8d325255..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t07.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t08.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t08.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t08.yml deleted file mode 100644 index 33b8109641..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t08.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t09.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t09.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t09.yml deleted file mode 100644 index 8973c2911b..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t09.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t10.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t10.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t10.yml deleted file mode 100644 index eafdca25fb..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t10.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t11.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t11.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t11.yml deleted file mode 100644 index 9ab828f3c5..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t11.yml +++ /dev/null @@ -1 +0,0 @@ -- import_tasks: r1t12.yml diff --git a/test/integration/targets/include_import/roles/role1/tasks/r1t12.yml b/test/integration/targets/include_import/roles/role1/tasks/r1t12.yml deleted file mode 100644 index 882848611a..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/r1t12.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - msg: r1t12 diff --git a/test/integration/targets/include_import/roles/role1/tasks/tasks.yml b/test/integration/targets/include_import/roles/role1/tasks/tasks.yml deleted file mode 100644 index 45430bc407..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/tasks.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - msg: Tasks file inside role1 diff --git a/test/integration/targets/include_import/roles/role1/tasks/vartest.yml b/test/integration/targets/include_import/roles/role1/tasks/vartest.yml deleted file mode 100644 index 5a49d8dd4b..0000000000 --- a/test/integration/targets/include_import/roles/role1/tasks/vartest.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - var: where_am_i_defined diff --git a/test/integration/targets/include_import/roles/role1/vars/main.yml b/test/integration/targets/include_import/roles/role1/vars/main.yml deleted file mode 100644 index 57d31cf753..0000000000 --- a/test/integration/targets/include_import/roles/role1/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -where_am_i_defined: role1 vars/main.yml diff --git a/test/integration/targets/include_import/roles/role1/vars/role1vars.yml b/test/integration/targets/include_import/roles/role1/vars/role1vars.yml deleted file mode 100644 index 57d31cf753..0000000000 --- a/test/integration/targets/include_import/roles/role1/vars/role1vars.yml +++ /dev/null @@ -1 +0,0 @@ -where_am_i_defined: role1 vars/main.yml diff --git a/test/integration/targets/include_import/roles/role2/tasks/main.yml b/test/integration/targets/include_import/roles/role2/tasks/main.yml deleted file mode 100644 index 80d6a81fc3..0000000000 --- a/test/integration/targets/include_import/roles/role2/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - msg: In role2 diff --git a/test/integration/targets/include_import/roles/role3/defaults/main.yml b/test/integration/targets/include_import/roles/role3/defaults/main.yml deleted file mode 100644 index c3464c4d90..0000000000 --- a/test/integration/targets/include_import/roles/role3/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -where_am_i_defined: defaults in role3 -role3_default: defined in role3/defaults/main.yml diff --git a/test/integration/targets/include_import/roles/role3/handlers/main.yml b/test/integration/targets/include_import/roles/role3/handlers/main.yml deleted file mode 100644 index c8baa27023..0000000000 --- a/test/integration/targets/include_import/roles/role3/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: runme - debug: - msg: role3 handler diff --git a/test/integration/targets/include_import/roles/role3/tasks/main.yml b/test/integration/targets/include_import/roles/role3/tasks/main.yml deleted file mode 100644 index 76608a9b19..0000000000 --- a/test/integration/targets/include_import/roles/role3/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - msg: In role3 diff --git a/test/integration/targets/include_import/roles/role3/tasks/tasks.yml b/test/integration/targets/include_import/roles/role3/tasks/tasks.yml deleted file mode 100644 index 0e822695ef..0000000000 --- a/test/integration/targets/include_import/roles/role3/tasks/tasks.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - msg: Tasks file inside role3 diff --git a/test/integration/targets/include_import/roles/role3/tasks/vartest.yml b/test/integration/targets/include_import/roles/role3/tasks/vartest.yml deleted file mode 100644 index cb21c53f88..0000000000 --- a/test/integration/targets/include_import/roles/role3/tasks/vartest.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - var: role3_var diff --git a/test/integration/targets/include_import/roles/role3/vars/main.yml b/test/integration/targets/include_import/roles/role3/vars/main.yml deleted file mode 100644 index 9adac6b87d..0000000000 --- a/test/integration/targets/include_import/roles/role3/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -role3_main: defined in role3/vars/main.yml diff --git a/test/integration/targets/include_import/roles/role3/vars/role3vars.yml b/test/integration/targets/include_import/roles/role3/vars/role3vars.yml deleted file mode 100644 index f324d56a6e..0000000000 --- a/test/integration/targets/include_import/roles/role3/vars/role3vars.yml +++ /dev/null @@ -1,2 +0,0 @@ -where_am_i_defined: role3vars.yml -role3_var: defined in role3/vars/role3vars.yml diff --git a/test/integration/targets/include_import/roles/role_with_deps/meta/main.yml b/test/integration/targets/include_import/roles/role_with_deps/meta/main.yml deleted file mode 100644 index a2446bba23..0000000000 --- a/test/integration/targets/include_import/roles/role_with_deps/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -dependencies: - - role1 - - role2 diff --git a/test/integration/targets/include_import/roles/role_with_deps/tasks/main.yml b/test/integration/targets/include_import/roles/role_with_deps/tasks/main.yml deleted file mode 100644 index 060fe42f15..0000000000 --- a/test/integration/targets/include_import/roles/role_with_deps/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -- debug: - msg: In role_with_deps diff --git a/test/integration/targets/include_import/runme.sh b/test/integration/targets/include_import/runme.sh deleted file mode 100755 index fbe961c574..0000000000 --- a/test/integration/targets/include_import/runme.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -export ANSIBLE_ROLES_PATH=./roles - -## Import (static) - -# Playbook -ANSIBLE_STRATEGY='linear' ansible-playbook playbook/test_import_playbook.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='free' ansible-playbook playbook/test_import_playbook.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='linear' ansible-playbook playbook/test_import_playbook_tags.yml -i ../../inventory "$@" --tags canary1,canary22,validate --skip-tags skipme,never - -# Tasks -ANSIBLE_STRATEGY='linear' ansible-playbook tasks/test_import_tasks.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_import_tasks.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_import_tasks_tags.yml -i ../../inventory "$@" --tags tasks1,canary1,validate --skip-tags never - -# Role -ANSIBLE_STRATEGY='linear' ansible-playbook role/test_import_role.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='free' ansible-playbook role/test_import_role.yml -i ../../inventory "$@" --skip-tags never - - -## Include (dynamic) - -# Tasks -ANSIBLE_STRATEGY='linear' ansible-playbook tasks/test_include_tasks.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_include_tasks.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='free' ansible-playbook tasks/test_include_tasks_tags.yml -i ../../inventory "$@" --tags tasks1,canary1,validate --skip-tags never - -# Role -ANSIBLE_STRATEGY='linear' ansible-playbook role/test_include_role.yml -i ../../inventory "$@" --skip-tags never -ANSIBLE_STRATEGY='free' ansible-playbook role/test_include_role.yml -i ../../inventory "$@" --skip-tags never - - -## Recursion -# https://github.com/ansible/ansible/issues/23609 -ANSIBLE_STRATEGY='linear' ansible-playbook test_recursion.yml -i ../../inventory "$@" --skip-tags never diff --git a/test/integration/targets/include_import/tasks/tasks1.yml b/test/integration/targets/include_import/tasks/tasks1.yml deleted file mode 100644 index e1d83d92b4..0000000000 --- a/test/integration/targets/include_import/tasks/tasks1.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Set variable inside tasks1.yml - set_fact: - set_in_tasks1: yes - tags: - - tasks1 diff --git a/test/integration/targets/include_import/tasks/tasks2.yml b/test/integration/targets/include_import/tasks/tasks2.yml deleted file mode 100644 index 1b4c86fc41..0000000000 --- a/test/integration/targets/include_import/tasks/tasks2.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Set variable inside tasks2.yml - set_fact: - set_in_tasks2: yes - tags: - - tasks2 diff --git a/test/integration/targets/include_import/tasks/tasks3.yml b/test/integration/targets/include_import/tasks/tasks3.yml deleted file mode 100644 index 6da371910f..0000000000 --- a/test/integration/targets/include_import/tasks/tasks3.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Set variable inside tasks3.yml - set_fact: - set_in_tasks3: yes - tags: - - tasks3 diff --git a/test/integration/targets/include_import/tasks/tasks4.yml b/test/integration/targets/include_import/tasks/tasks4.yml deleted file mode 100644 index fc2eb6cbcc..0000000000 --- a/test/integration/targets/include_import/tasks/tasks4.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Set variable inside tasks4.yml - set_fact: - set_in_tasks4: yes - tags: - - tasks4 diff --git a/test/integration/targets/include_import/tasks/tasks5.yml b/test/integration/targets/include_import/tasks/tasks5.yml deleted file mode 100644 index f2ee6b9ecb..0000000000 --- a/test/integration/targets/include_import/tasks/tasks5.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Set variable inside tasks5.yml - set_fact: - set_in_tasks5: yes - tags: - - tasks5 - - canary1 diff --git a/test/integration/targets/include_import/tasks/tasks6.yml b/test/integration/targets/include_import/tasks/tasks6.yml deleted file mode 100644 index fa03079d68..0000000000 --- a/test/integration/targets/include_import/tasks/tasks6.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Set variable inside tasks6.yml - set_fact: - set_in_tasks6: yes - tags: - - tasks6 diff --git a/test/integration/targets/include_import/tasks/test_import_tasks.yml b/test/integration/targets/include_import/tasks/test_import_tasks.yml deleted file mode 100644 index 8f07bb9090..0000000000 --- a/test/integration/targets/include_import/tasks/test_import_tasks.yml +++ /dev/null @@ -1,41 +0,0 @@ -- name: Test import_tasks - hosts: testhost - - tasks: - - name: Test basic task import - import_tasks: tasks1.yml - - - name: Assert that fact was set in import - assert: - that: - - set_in_tasks1 - - - name: Test conditional task import - import_tasks: tasks2.yml - when: no - - - name: Assert that tasks were skipped - assert: - that: - - set_in_tasks2 is not defined - - - block: - - name: Import tasks inside a block - import_tasks: tasks3.yml - - - name: Assert that task3 was included - assert: - that: - - set_in_tasks3 - - always: - - name: Import task inside always - import_tasks: tasks4.yml - - - name: Validate that variables set in previously improted tasks are passed down. - import_tasks: validate3.yml - - - name: Assert that tasks4 was included - assert: - that: - - set_in_tasks4 diff --git a/test/integration/targets/include_import/tasks/test_import_tasks_tags.yml b/test/integration/targets/include_import/tasks/test_import_tasks_tags.yml deleted file mode 100644 index 3b1d68fcad..0000000000 --- a/test/integration/targets/include_import/tasks/test_import_tasks_tags.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Test import_tasks using tags - hosts: testhost - - tasks: - - name: Import tasks1.yml - import_tasks: tasks1.yml - - - name: Import tasks4.yml using tag on import task - import_tasks: tasks4.yml - tags: - - canary1 - - - name: Import tasks2.yml - import_tasks: tasks2.yml - - - name: Assert that appropriate tasks were run - assert: - that: - - set_in_tasks1 - - set_in_tasks4 - - set_in_tasks2 is not defined - tags: - - validate diff --git a/test/integration/targets/include_import/tasks/test_include_tasks.yml b/test/integration/targets/include_import/tasks/test_include_tasks.yml deleted file mode 100644 index 76471ffd4c..0000000000 --- a/test/integration/targets/include_import/tasks/test_include_tasks.yml +++ /dev/null @@ -1,41 +0,0 @@ -- name: Test include_tasks - hosts: testhost - - tasks: - - name: Test basic task include - include_tasks: tasks1.yml - - - name: Assert that fact was set in include - assert: - that: - - set_in_tasks1 - - - name: Test conditional task include - include_tasks: tasks2.yml - when: no - - - name: Assert that tasks were skipped - assert: - that: - - set_in_tasks2 is not defined - - - block: - - name: Include tasks inside a block - include_tasks: tasks3.yml - - - name: Assert that task3 was included - assert: - that: - - set_in_tasks3 - - always: - - name: Include task inside always - include_tasks: tasks4.yml - - - name: Validate that variables set in previously improted tasks are passed down - include_tasks: validate3.yml - - - name: Assert that tasks4 was included - assert: - that: - - set_in_tasks4 diff --git a/test/integration/targets/include_import/tasks/test_include_tasks_tags.yml b/test/integration/targets/include_import/tasks/test_include_tasks_tags.yml deleted file mode 100644 index 3fe43809cd..0000000000 --- a/test/integration/targets/include_import/tasks/test_include_tasks_tags.yml +++ /dev/null @@ -1,25 +0,0 @@ -- name: Test include_tasks using tags - hosts: testhost - - tasks: - # This should not be included - - name: Include tasks1.yml - include_tasks: tasks1.yml - - # This should be included but tasks inside should not run because they do not have - # the canary1 tag and tasks2 is not in the list of tags for the ansible-playbook command - - name: Include tasks2.yml - include_tasks: tasks2.yml - tags: - - canary1 - - # This should be included and tasks inside should be run - - name: Include tasks5.yml using tag on include task - include_tasks: tasks5.yml - tags: - - canary1 - - - name: Include validate_tags.yml - include_tasks: validate_tags.yml - tags: - - validate diff --git a/test/integration/targets/include_import/tasks/test_recursion.yml b/test/integration/targets/include_import/tasks/test_recursion.yml deleted file mode 100644 index 96754ec800..0000000000 --- a/test/integration/targets/include_import/tasks/test_recursion.yml +++ /dev/null @@ -1,6 +0,0 @@ -- hosts: testhost - - tasks: - - include_role: - name: role - tasks_from: r1t1.yml diff --git a/test/integration/targets/include_import/tasks/validate3.yml b/test/integration/targets/include_import/tasks/validate3.yml deleted file mode 100644 index e3166aa307..0000000000 --- a/test/integration/targets/include_import/tasks/validate3.yml +++ /dev/null @@ -1,4 +0,0 @@ -- name: Assert than variable set in previously included task is defined - assert: - that: - - set_in_tasks3 diff --git a/test/integration/targets/include_import/tasks/validate_tags.yml b/test/integration/targets/include_import/tasks/validate_tags.yml deleted file mode 100644 index e2f3377bdc..0000000000 --- a/test/integration/targets/include_import/tasks/validate_tags.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: Assert that appropriate tasks were run - assert: - that: - - set_in_tasks1 is undefined - - set_in_tasks2 is undefined - - set_in_tasks5 - tags: - - validate diff --git a/test/integration/targets/include_import/test_recursion.yml b/test/integration/targets/include_import/test_recursion.yml deleted file mode 100644 index ad2489a0b2..0000000000 --- a/test/integration/targets/include_import/test_recursion.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: Test max recursion depth - hosts: testhost - - tasks: - - import_role: - name: role1 - tasks_from: r1t01.yml diff --git a/test/integration/targets/includes/test_includes2.yml b/test/integration/targets/includes/test_includes2.yml index a32e851384..d8dcf10e15 100644 --- a/test/integration/targets/includes/test_includes2.yml +++ b/test/integration/targets/includes/test_includes2.yml @@ -10,8 +10,7 @@ hosts: testhost gather_facts: True roles: - - role: test_includes - tags: test_includes + - { role: test_includes, tags: test_includes } tasks: - include: roles/test_includes/tasks/not_a_role_task.yml - include: roles/test_includes/tasks/empty.yml diff --git a/test/integration/targets/includes/test_includes3.yml b/test/integration/targets/includes/test_includes3.yml index bd3b0d30da..012ee20568 100644 --- a/test/integration/targets/includes/test_includes3.yml +++ b/test/integration/targets/includes/test_includes3.yml @@ -1,3 +1,4 @@ +--- - hosts: localhost tasks: - include: test_includes4.yml |