diff options
Diffstat (limited to 'test/integration/targets/callback_default')
42 files changed, 2291 insertions, 0 deletions
diff --git a/test/integration/targets/callback_default/aliases b/test/integration/targets/callback_default/aliases new file mode 100644 index 0000000..b598321 --- /dev/null +++ b/test/integration/targets/callback_default/aliases @@ -0,0 +1 @@ +shippable/posix/group3 diff --git a/test/integration/targets/callback_default/callback_default.out.check_markers_dry.stderr b/test/integration/targets/callback_default/callback_default.out.check_markers_dry.stderr new file mode 100644 index 0000000..431a020 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_markers_dry.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory --check test_dryrun.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.check_markers_dry.stdout b/test/integration/targets/callback_default/callback_default.out.check_markers_dry.stdout new file mode 100644 index 0000000..8a34909 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_markers_dry.stdout @@ -0,0 +1,78 @@ + +DRY RUN ************************************************************************ + +PLAY [A common play] [CHECK MODE] ********************************************** + +TASK [debug] [CHECK MODE] ****************************************************** +ok: [testhost] => { + "msg": "ansible_check_mode: True" +} + +TASK [Command] [CHECK MODE] **************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with check_mode: true (runs always in check_mode)] [CHECK MODE] ***** + +TASK [debug] [CHECK MODE] ****************************************************** +ok: [testhost] => { + "msg": "ansible_check_mode: True" +} + +TASK [Command] [CHECK MODE] **************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with check_mode: false (runs always in wet mode)] ******************* + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: True" +} + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with a block with check_mode: true] [CHECK MODE] ******************** + +TASK [Command] [CHECK MODE] **************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with a block with check_mode: false] [CHECK MODE] ******************* + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY RECAP ********************************************************************* +testhost : ok=10 changed=7 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 + + +DRY RUN ************************************************************************ diff --git a/test/integration/targets/callback_default/callback_default.out.check_markers_wet.stderr b/test/integration/targets/callback_default/callback_default.out.check_markers_wet.stderr new file mode 100644 index 0000000..e430942 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_markers_wet.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test_dryrun.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.check_markers_wet.stdout b/test/integration/targets/callback_default/callback_default.out.check_markers_wet.stdout new file mode 100644 index 0000000..f5f4510 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_markers_wet.stdout @@ -0,0 +1,74 @@ + +PLAY [A common play] *********************************************************** + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: False" +} + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with check_mode: true (runs always in check_mode)] [CHECK MODE] ***** + +TASK [debug] [CHECK MODE] ****************************************************** +ok: [testhost] => { + "msg": "ansible_check_mode: False" +} + +TASK [Command] [CHECK MODE] **************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with check_mode: false (runs always in wet mode)] ******************* + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: False" +} + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with a block with check_mode: true] ********************************* + +TASK [Command] [CHECK MODE] **************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY [Play with a block with check_mode: false] ******************************** + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] [CHECK MODE] ****************************** +skipping: [testhost] + +PLAY RECAP ********************************************************************* +testhost : ok=11 changed=8 unreachable=0 failed=0 skipped=7 rescued=0 ignored=0 + diff --git a/test/integration/targets/callback_default/callback_default.out.check_nomarkers_dry.stderr b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_dry.stderr new file mode 100644 index 0000000..431a020 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_dry.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory --check test_dryrun.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.check_nomarkers_dry.stdout b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_dry.stdout new file mode 100644 index 0000000..e984d49 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_dry.stdout @@ -0,0 +1,74 @@ + +PLAY [A common play] *********************************************************** + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: True" +} + +TASK [Command] ***************************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with check_mode: true (runs always in check_mode)] ****************** + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: True" +} + +TASK [Command] ***************************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with check_mode: false (runs always in wet mode)] ******************* + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: True" +} + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with a block with check_mode: true] ********************************* + +TASK [Command] ***************************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with a block with check_mode: false] ******************************** + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY RECAP ********************************************************************* +testhost : ok=10 changed=7 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 + diff --git a/test/integration/targets/callback_default/callback_default.out.check_nomarkers_wet.stderr b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_wet.stderr new file mode 100644 index 0000000..e430942 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_wet.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test_dryrun.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.check_nomarkers_wet.stdout b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_wet.stdout new file mode 100644 index 0000000..2b331bb --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.check_nomarkers_wet.stdout @@ -0,0 +1,74 @@ + +PLAY [A common play] *********************************************************** + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: False" +} + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with check_mode: true (runs always in check_mode)] ****************** + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: False" +} + +TASK [Command] ***************************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with check_mode: false (runs always in wet mode)] ******************* + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "msg": "ansible_check_mode: False" +} + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with a block with check_mode: true] ********************************* + +TASK [Command] ***************************************************************** +skipping: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY [Play with a block with check_mode: false] ******************************** + +TASK [Command] ***************************************************************** +changed: [testhost] + +TASK [Command with check_mode: false] ****************************************** +changed: [testhost] + +TASK [Command with check_mode: true] ******************************************* +skipping: [testhost] + +PLAY RECAP ********************************************************************* +testhost : ok=11 changed=8 unreachable=0 failed=0 skipped=7 rescued=0 ignored=0 + diff --git a/test/integration/targets/callback_default/callback_default.out.default.stderr b/test/integration/targets/callback_default/callback_default.out.default.stderr new file mode 100644 index 0000000..d3e07d4 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.default.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.default.stdout b/test/integration/targets/callback_default/callback_default.out.default.stdout new file mode 100644 index 0000000..5502b34 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.default.stdout @@ -0,0 +1,108 @@ + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] + +TASK [Ok task] ***************************************************************** +ok: [testhost] + +TASK [Failed task] ************************************************************* +fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"} +...ignoring + +TASK [Skipped task] ************************************************************ +skipping: [testhost] + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) +changed: [testhost] => (item=foo-2) +changed: [testhost] => (item=foo-3) + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => { + "msg": "debug-1" +} +failed: [testhost] (item=debug-2) => { + "msg": "debug-2" +} +ok: [testhost] => (item=debug-3) => { + "msg": "debug-3" +} +skipping: [testhost] => (item=debug-4) +fatal: [testhost]: FAILED! => {"msg": "One or more items failed"} +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"} + +TASK [Rescue task] ************************************************************* +changed: [testhost] + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +TASK [copy] ******************************************************************** +changed: [testhost] + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] + +TASK [replace] ***************************************************************** +ok: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] => (item=1) +skipping: [testhost] => (item=2) +skipping: [testhost] + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] + +RUNNING HANDLER [Test handler 2] *********************************************** +ok: [testhost] + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] + +TASK [Second free task] ******************************************************** +changed: [testhost] + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.display_path_on_failure.stderr b/test/integration/targets/callback_default/callback_default.out.display_path_on_failure.stderr new file mode 100644 index 0000000..d3e07d4 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.display_path_on_failure.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.display_path_on_failure.stdout b/test/integration/targets/callback_default/callback_default.out.display_path_on_failure.stdout new file mode 100644 index 0000000..22f3f51 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.display_path_on_failure.stdout @@ -0,0 +1,111 @@ + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] + +TASK [Ok task] ***************************************************************** +ok: [testhost] + +TASK [Failed task] ************************************************************* +task path: TEST_PATH/test.yml:16 +fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"} +...ignoring + +TASK [Skipped task] ************************************************************ +skipping: [testhost] + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) +changed: [testhost] => (item=foo-2) +changed: [testhost] => (item=foo-3) + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => { + "msg": "debug-1" +} +failed: [testhost] (item=debug-2) => { + "msg": "debug-2" +} +ok: [testhost] => (item=debug-3) => { + "msg": "debug-3" +} +skipping: [testhost] => (item=debug-4) +task path: TEST_PATH/test.yml:38 +fatal: [testhost]: FAILED! => {"msg": "One or more items failed"} +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +task path: TEST_PATH/test.yml:54 +fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"} + +TASK [Rescue task] ************************************************************* +changed: [testhost] + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +TASK [copy] ******************************************************************** +changed: [testhost] + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] + +TASK [replace] ***************************************************************** +ok: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] => (item=1) +skipping: [testhost] => (item=2) +skipping: [testhost] + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] + +RUNNING HANDLER [Test handler 2] *********************************************** +ok: [testhost] + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] + +TASK [Second free task] ******************************************************** +changed: [testhost] + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stderr b/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stderr new file mode 100644 index 0000000..9a39d78 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stderr @@ -0,0 +1,8 @@ ++ ansible-playbook -i inventory test.yml +++ set +x +fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"} +failed: [testhost] (item=debug-2) => { + "msg": "debug-2" +} +fatal: [testhost]: FAILED! => {"msg": "One or more items failed"} +fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"} diff --git a/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stdout b/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stdout new file mode 100644 index 0000000..87af5be --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.failed_to_stderr.stdout @@ -0,0 +1,102 @@ + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] + +TASK [Ok task] ***************************************************************** +ok: [testhost] + +TASK [Failed task] ************************************************************* +...ignoring + +TASK [Skipped task] ************************************************************ +skipping: [testhost] + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) +changed: [testhost] => (item=foo-2) +changed: [testhost] => (item=foo-3) + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => { + "msg": "debug-1" +} +ok: [testhost] => (item=debug-3) => { + "msg": "debug-3" +} +skipping: [testhost] => (item=debug-4) +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** + +TASK [Rescue task] ************************************************************* +changed: [testhost] + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +TASK [copy] ******************************************************************** +changed: [testhost] + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] + +TASK [replace] ***************************************************************** +ok: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] => (item=1) +skipping: [testhost] => (item=2) +skipping: [testhost] + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] + +RUNNING HANDLER [Test handler 2] *********************************************** +ok: [testhost] + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] + +TASK [Second free task] ******************************************************** +changed: [testhost] + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.fqcn_free.stdout b/test/integration/targets/callback_default/callback_default.out.fqcn_free.stdout new file mode 100644 index 0000000..0ec0447 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.fqcn_free.stdout @@ -0,0 +1,35 @@ + +PLAY [nonlockstep] ************************************************************* + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost12] + +TASK [command] ***************************************************************** +changed: [testhost12] + +TASK [command] ***************************************************************** +changed: [testhost12] + +PLAY RECAP ********************************************************************* +testhost10 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +testhost11 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +testhost12 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 + diff --git a/test/integration/targets/callback_default/callback_default.out.free.stdout b/test/integration/targets/callback_default/callback_default.out.free.stdout new file mode 100644 index 0000000..0ec0447 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.free.stdout @@ -0,0 +1,35 @@ + +PLAY [nonlockstep] ************************************************************* + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost12] + +TASK [command] ***************************************************************** +changed: [testhost12] + +TASK [command] ***************************************************************** +changed: [testhost12] + +PLAY RECAP ********************************************************************* +testhost10 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +testhost11 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +testhost12 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 + diff --git a/test/integration/targets/callback_default/callback_default.out.hide_ok.stderr b/test/integration/targets/callback_default/callback_default.out.hide_ok.stderr new file mode 100644 index 0000000..d3e07d4 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.hide_ok.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.hide_ok.stdout b/test/integration/targets/callback_default/callback_default.out.hide_ok.stdout new file mode 100644 index 0000000..3921f73 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.hide_ok.stdout @@ -0,0 +1,86 @@ + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] + +TASK [Failed task] ************************************************************* +fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"} +...ignoring + +TASK [Skipped task] ************************************************************ +skipping: [testhost] + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) +changed: [testhost] => (item=foo-2) +changed: [testhost] => (item=foo-3) + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => { + "msg": "debug-1" +} +failed: [testhost] (item=debug-2) => { + "msg": "debug-2" +} +skipping: [testhost] => (item=debug-4) +fatal: [testhost]: FAILED! => {"msg": "One or more items failed"} +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"} + +TASK [Rescue task] ************************************************************* +changed: [testhost] + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [copy] ******************************************************************** +changed: [testhost] + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] => (item=1) +skipping: [testhost] => (item=2) +skipping: [testhost] + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] + +TASK [Second free task] ******************************************************** +changed: [testhost] + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.hide_skipped.stderr b/test/integration/targets/callback_default/callback_default.out.hide_skipped.stderr new file mode 100644 index 0000000..d3e07d4 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.hide_skipped.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.hide_skipped.stdout b/test/integration/targets/callback_default/callback_default.out.hide_skipped.stdout new file mode 100644 index 0000000..b291869 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.hide_skipped.stdout @@ -0,0 +1,93 @@ + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] + +TASK [Ok task] ***************************************************************** +ok: [testhost] + +TASK [Failed task] ************************************************************* +fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"} +...ignoring + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) +changed: [testhost] => (item=foo-2) +changed: [testhost] => (item=foo-3) + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => { + "msg": "debug-1" +} +failed: [testhost] (item=debug-2) => { + "msg": "debug-2" +} +ok: [testhost] => (item=debug-3) => { + "msg": "debug-3" +} +fatal: [testhost]: FAILED! => {"msg": "One or more items failed"} +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"} + +TASK [Rescue task] ************************************************************* +changed: [testhost] + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +TASK [copy] ******************************************************************** +changed: [testhost] + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] + +TASK [replace] ***************************************************************** +ok: [testhost] + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] + +RUNNING HANDLER [Test handler 2] *********************************************** +ok: [testhost] + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] + +TASK [Second free task] ******************************************************** +changed: [testhost] + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => { + "item": 1 +} + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stderr b/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stderr new file mode 100644 index 0000000..d3e07d4 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stdout b/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stdout new file mode 100644 index 0000000..e3eb937 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.hide_skipped_ok.stdout @@ -0,0 +1,71 @@ + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] + +TASK [Failed task] ************************************************************* +fatal: [testhost]: FAILED! => {"changed": false, "msg": "no reason"} +...ignoring + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) +changed: [testhost] => (item=foo-2) +changed: [testhost] => (item=foo-3) + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => { + "msg": "debug-1" +} +failed: [testhost] (item=debug-2) => { + "msg": "debug-2" +} +fatal: [testhost]: FAILED! => {"msg": "One or more items failed"} +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +fatal: [testhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"} + +TASK [Rescue task] ************************************************************* +changed: [testhost] + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [copy] ******************************************************************** +changed: [testhost] + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] + +TASK [Second free task] ******************************************************** +changed: [testhost] + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.host_pinned.stdout b/test/integration/targets/callback_default/callback_default.out.host_pinned.stdout new file mode 100644 index 0000000..0ec0447 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.host_pinned.stdout @@ -0,0 +1,35 @@ + +PLAY [nonlockstep] ************************************************************* + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost10] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost11] + +TASK [command] ***************************************************************** +changed: [testhost12] + +TASK [command] ***************************************************************** +changed: [testhost12] + +TASK [command] ***************************************************************** +changed: [testhost12] + +PLAY RECAP ********************************************************************* +testhost10 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +testhost11 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +testhost12 : ok=3 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 + diff --git a/test/integration/targets/callback_default/callback_default.out.result_format_yaml.stderr b/test/integration/targets/callback_default/callback_default.out.result_format_yaml.stderr new file mode 100644 index 0000000..d3e07d4 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.result_format_yaml.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.result_format_yaml.stdout b/test/integration/targets/callback_default/callback_default.out.result_format_yaml.stdout new file mode 100644 index 0000000..87ddc60 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.result_format_yaml.stdout @@ -0,0 +1,108 @@ + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] + +TASK [Ok task] ***************************************************************** +ok: [testhost] + +TASK [Failed task] ************************************************************* +fatal: [testhost]: FAILED! => + changed: false + msg: no reason +...ignoring + +TASK [Skipped task] ************************************************************ +skipping: [testhost] + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) +changed: [testhost] => (item=foo-2) +changed: [testhost] => (item=foo-3) + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => + msg: debug-1 +failed: [testhost] (item=debug-2) => + msg: debug-2 +ok: [testhost] => (item=debug-3) => + msg: debug-3 +skipping: [testhost] => (item=debug-4) +fatal: [testhost]: FAILED! => + msg: One or more items failed +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +fatal: [testhost]: FAILED! => + changed: false + msg: Failed as requested from task + +TASK [Rescue task] ************************************************************* +changed: [testhost] + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => + item: 1 + +TASK [copy] ******************************************************************** +changed: [testhost] + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] + +TASK [replace] ***************************************************************** +ok: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] + +TASK [debug] ******************************************************************* +skipping: [testhost] => (item=1) +skipping: [testhost] => (item=2) +skipping: [testhost] + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] + +RUNNING HANDLER [Test handler 2] *********************************************** +ok: [testhost] + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] + +TASK [Second free task] ******************************************************** +changed: [testhost] + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => + item: 1 + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.result_format_yaml_lossy_verbose.stderr b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_lossy_verbose.stderr new file mode 100644 index 0000000..4884dfe --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_lossy_verbose.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml -v +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.result_format_yaml_lossy_verbose.stdout b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_lossy_verbose.stdout new file mode 100644 index 0000000..71a4ef9 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_lossy_verbose.stdout @@ -0,0 +1,300 @@ + + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +TASK [Ok task] ***************************************************************** +ok: [testhost] => + changed: false + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +TASK [Failed task] ************************************************************* +fatal: [testhost]: FAILED! => + changed: false + msg: no reason +...ignoring + +TASK [Skipped task] ************************************************************ +skipping: [testhost] => + changed: false + skip_reason: Conditional result was False + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) => + ansible_loop_var: item + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + item: 1 + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> +changed: [testhost] => (item=foo-2) => + ansible_loop_var: item + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + item: 2 + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> +changed: [testhost] => (item=foo-3) => + ansible_loop_var: item + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + item: 3 + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => + msg: debug-1 +failed: [testhost] (item=debug-2) => + msg: debug-2 +ok: [testhost] => (item=debug-3) => + msg: debug-3 +skipping: [testhost] => (item=debug-4) => + ansible_loop_var: item + item: 4 +fatal: [testhost]: FAILED! => + msg: One or more items failed +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +fatal: [testhost]: FAILED! => + changed: false + msg: Failed as requested from task + +TASK [Rescue task] ************************************************************* +changed: [testhost] => + changed: true + cmd: + - echo + - rescued + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: rescued + stdout_lines: <omitted> + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => + item: 1 + +TASK [copy] ******************************************************************** +changed: [testhost] => + changed: true + checksum: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 + dest: .../test_diff.txt + gid: 0 + group: root + md5sum: acbd18db4cc2f85cedef654fccc4a4d8 + mode: '0644' + owner: root + size: 3 + src: .../source + state: file + uid: 0 + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] => + changed: true + msg: 1 replacements made + rc: 0 + +TASK [replace] ***************************************************************** +ok: [testhost] => + changed: false + msg: 1 replacements made + rc: 0 + +TASK [debug] ******************************************************************* +skipping: [testhost] => + skipped_reason: No items in the list + +TASK [debug] ******************************************************************* +skipping: [testhost] => + skipped_reason: No items in the list + +TASK [debug] ******************************************************************* +skipping: [testhost] => (item=1) => + ansible_loop_var: item + item: 1 +skipping: [testhost] => (item=2) => + ansible_loop_var: item + item: 2 +skipping: [testhost] => + msg: All items skipped + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +RUNNING HANDLER [Test handler 2] *********************************************** +ok: [testhost] => + changed: false + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +TASK [Second free task] ******************************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: <omitted> + stdout: foo + stdout_lines: <omitted> + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => + item: 1 + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.result_format_yaml_verbose.stderr b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_verbose.stderr new file mode 100644 index 0000000..4884dfe --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_verbose.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test.yml -v +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.result_format_yaml_verbose.stdout b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_verbose.stdout new file mode 100644 index 0000000..7a99cc7 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.result_format_yaml_verbose.stdout @@ -0,0 +1,312 @@ + + +PLAY [testhost] **************************************************************** + +TASK [Changed task] ************************************************************ +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +TASK [Ok task] ***************************************************************** +ok: [testhost] => + changed: false + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +TASK [Failed task] ************************************************************* +fatal: [testhost]: FAILED! => + changed: false + msg: no reason +...ignoring + +TASK [Skipped task] ************************************************************ +skipping: [testhost] => + changed: false + skip_reason: Conditional result was False + +TASK [Task with var in name (foo bar)] ***************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +TASK [Loop task] *************************************************************** +changed: [testhost] => (item=foo-1) => + ansible_loop_var: item + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + item: 1 + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo +changed: [testhost] => (item=foo-2) => + ansible_loop_var: item + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + item: 2 + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo +changed: [testhost] => (item=foo-3) => + ansible_loop_var: item + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + item: 3 + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +TASK [debug loop] ************************************************************** +changed: [testhost] => (item=debug-1) => + msg: debug-1 +failed: [testhost] (item=debug-2) => + msg: debug-2 +ok: [testhost] => (item=debug-3) => + msg: debug-3 +skipping: [testhost] => (item=debug-4) => + ansible_loop_var: item + item: 4 +fatal: [testhost]: FAILED! => + msg: One or more items failed +...ignoring + +TASK [EXPECTED FAILURE Failed task to be rescued] ****************************** +fatal: [testhost]: FAILED! => + changed: false + msg: Failed as requested from task + +TASK [Rescue task] ************************************************************* +changed: [testhost] => + changed: true + cmd: + - echo + - rescued + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: rescued + stdout_lines: + - rescued + +TASK [include_tasks] *********************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => + item: 1 + +TASK [copy] ******************************************************************** +changed: [testhost] => + changed: true + checksum: 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 + dest: .../test_diff.txt + gid: 0 + group: root + md5sum: acbd18db4cc2f85cedef654fccc4a4d8 + mode: '0644' + owner: root + size: 3 + src: .../source + state: file + uid: 0 + +TASK [replace] ***************************************************************** +--- before: .../test_diff.txt ++++ after: .../test_diff.txt +@@ -1 +1 @@ +-foo +\ No newline at end of file ++bar +\ No newline at end of file + +changed: [testhost] => + changed: true + msg: 1 replacements made + rc: 0 + +TASK [replace] ***************************************************************** +ok: [testhost] => + changed: false + msg: 1 replacements made + rc: 0 + +TASK [debug] ******************************************************************* +skipping: [testhost] => + skipped_reason: No items in the list + +TASK [debug] ******************************************************************* +skipping: [testhost] => + skipped_reason: No items in the list + +TASK [debug] ******************************************************************* +skipping: [testhost] => (item=1) => + ansible_loop_var: item + item: 1 +skipping: [testhost] => (item=2) => + ansible_loop_var: item + item: 2 +skipping: [testhost] => + msg: All items skipped + +RUNNING HANDLER [Test handler 1] *********************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +RUNNING HANDLER [Test handler 2] *********************************************** +ok: [testhost] => + changed: false + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +RUNNING HANDLER [Test handler 3] *********************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +PLAY [testhost] **************************************************************** + +TASK [First free task] ********************************************************* +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +TASK [Second free task] ******************************************************** +changed: [testhost] => + changed: true + cmd: + - echo + - foo + delta: '0:00:00.000000' + end: '0000-00-00 00:00:00.000000' + msg: '' + rc: 0 + start: '0000-00-00 00:00:00.000000' + stderr: '' + stderr_lines: [] + stdout: foo + stdout_lines: + - foo + +TASK [Include some tasks] ****************************************************** +included: .../test/integration/targets/callback_default/include_me.yml for testhost => (item=1) + +TASK [debug] ******************************************************************* +ok: [testhost] => + item: 1 + +PLAY RECAP ********************************************************************* +testhost : ok=19 changed=11 unreachable=0 failed=0 skipped=4 rescued=1 ignored=2 + diff --git a/test/integration/targets/callback_default/callback_default.out.yaml_result_format_yaml_verbose.stderr b/test/integration/targets/callback_default/callback_default.out.yaml_result_format_yaml_verbose.stderr new file mode 100644 index 0000000..6d767d2 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.yaml_result_format_yaml_verbose.stderr @@ -0,0 +1,2 @@ ++ ansible-playbook -i inventory test_yaml.yml -v +++ set +x diff --git a/test/integration/targets/callback_default/callback_default.out.yaml_result_format_yaml_verbose.stdout b/test/integration/targets/callback_default/callback_default.out.yaml_result_format_yaml_verbose.stdout new file mode 100644 index 0000000..36437e5 --- /dev/null +++ b/test/integration/targets/callback_default/callback_default.out.yaml_result_format_yaml_verbose.stdout @@ -0,0 +1,29 @@ + + +PLAY [testhost] **************************************************************** + +TASK [Sample task name] ******************************************************** +ok: [testhost] => + msg: sample debug msg + +TASK [Umlaut output] *********************************************************** +ok: [testhost] => + msg: |- + äöü + éêè + ßï☺ + +TASK [Test to_yaml] ************************************************************ +ok: [testhost] => + msg: |- + 'line 1 + + line 2 + + line 3 + + ' + +PLAY RECAP ********************************************************************* +testhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 + diff --git a/test/integration/targets/callback_default/include_me.yml b/test/integration/targets/callback_default/include_me.yml new file mode 100644 index 0000000..51470f3 --- /dev/null +++ b/test/integration/targets/callback_default/include_me.yml @@ -0,0 +1,2 @@ +- debug: + var: item diff --git a/test/integration/targets/callback_default/inventory b/test/integration/targets/callback_default/inventory new file mode 100644 index 0000000..5d93afd --- /dev/null +++ b/test/integration/targets/callback_default/inventory @@ -0,0 +1,10 @@ +[local] +testhost ansible_connection=local ansible_python_interpreter="{{ ansible_playbook_python }}" + +[nonexistent] +testhost5 ansible_host=169.254.199.200 # no connection is ever established with this host + +[nonlockstep] +testhost10 i=0 ansible_connection=local ansible_python_interpreter="{{ ansible_playbook_python }}" +testhost11 i=3.0 ansible_connection=local ansible_python_interpreter="{{ ansible_playbook_python }}" +testhost12 i=12.0 ansible_connection=local ansible_python_interpreter="{{ ansible_playbook_python }}" diff --git a/test/integration/targets/callback_default/no_implicit_meta_banners.yml b/test/integration/targets/callback_default/no_implicit_meta_banners.yml new file mode 100644 index 0000000..87883dc --- /dev/null +++ b/test/integration/targets/callback_default/no_implicit_meta_banners.yml @@ -0,0 +1,11 @@ +# This playbooks generates a noop task in the linear strategy, the output is tested that the banner for noop task is not printed https://github.com/ansible/ansible/pull/71344 +- hosts: all + gather_facts: no + tasks: + - block: + - name: EXPECTED FAILURE # sate shippable + fail: + when: inventory_hostname == 'host1' + rescue: + - name: rescue + debug: diff --git a/test/integration/targets/callback_default/runme.sh b/test/integration/targets/callback_default/runme.sh new file mode 100755 index 0000000..0ee4259 --- /dev/null +++ b/test/integration/targets/callback_default/runme.sh @@ -0,0 +1,241 @@ +#!/usr/bin/env bash + +# This test compares "known good" output with various settings against output +# with the current code. It's brittle by nature, but this is probably the +# "best" approach possible. +# +# Notes: +# * options passed to this script (such as -v) are ignored, as they would change +# the output and break the test +# * the number of asterisks after a "banner" differs depending on the number of +# columns on the TTY, so we must adjust the columns for the current session +# for consistency + +set -eux + +run_test() { + local testname=$1 + local playbook=$2 + + # output was recorded w/o cowsay, ensure we reproduce the same + export ANSIBLE_NOCOWS=1 + + # The shenanigans with redirection and 'tee' are to capture STDOUT and + # STDERR separately while still displaying both to the console + { ansible-playbook -i inventory "$playbook" "${@:3}" \ + > >(set +x; tee "${OUTFILE}.${testname}.stdout"); } \ + 2> >(set +x; tee "${OUTFILE}.${testname}.stderr" >&2) + # Scrub deprication warning that shows up in Python 2.6 on CentOS 6 + sed -i -e '/RandomPool_DeprecationWarning/d' "${OUTFILE}.${testname}.stderr" + sed -i -e 's/included: .*\/test\/integration/included: ...\/test\/integration/g' "${OUTFILE}.${testname}.stdout" + sed -i -e 's/@@ -1,1 +1,1 @@/@@ -1 +1 @@/g' "${OUTFILE}.${testname}.stdout" + sed -i -e 's/: .*\/test_diff\.txt/: ...\/test_diff.txt/g' "${OUTFILE}.${testname}.stdout" + sed -i -e "s#${ANSIBLE_PLAYBOOK_DIR}#TEST_PATH#g" "${OUTFILE}.${testname}.stdout" + sed -i -e 's/^Using .*//g' "${OUTFILE}.${testname}.stdout" + sed -i -e 's/[0-9]:[0-9]\{2\}:[0-9]\{2\}\.[0-9]\{6\}/0:00:00.000000/g' "${OUTFILE}.${testname}.stdout" + sed -i -e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\} [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}\.[0-9]\{6\}/0000-00-00 00:00:00.000000/g' "${OUTFILE}.${testname}.stdout" + sed -i -e 's#: .*/source$#: .../source#g' "${OUTFILE}.${testname}.stdout" + sed -i -e '/secontext:/d' "${OUTFILE}.${testname}.stdout" + sed -i -e 's/group: wheel/group: root/g' "${OUTFILE}.${testname}.stdout" + + diff -u "${ORIGFILE}.${testname}.stdout" "${OUTFILE}.${testname}.stdout" || diff_failure + diff -u "${ORIGFILE}.${testname}.stderr" "${OUTFILE}.${testname}.stderr" || diff_failure +} + +run_test_dryrun() { + local testname=$1 + # optional, pass --check to run a dry run + local chk=${2:-} + + # outout was recorded w/o cowsay, ensure we reproduce the same + export ANSIBLE_NOCOWS=1 + + # This needed to satisfy shellcheck that can not accept unquoted variable + cmd="ansible-playbook -i inventory ${chk} test_dryrun.yml" + + # The shenanigans with redirection and 'tee' are to capture STDOUT and + # STDERR separately while still displaying both to the console + { $cmd \ + > >(set +x; tee "${OUTFILE}.${testname}.stdout"); } \ + 2> >(set +x; tee "${OUTFILE}.${testname}.stderr" >&2) + # Scrub deprication warning that shows up in Python 2.6 on CentOS 6 + sed -i -e '/RandomPool_DeprecationWarning/d' "${OUTFILE}.${testname}.stderr" + + diff -u "${ORIGFILE}.${testname}.stdout" "${OUTFILE}.${testname}.stdout" || diff_failure + diff -u "${ORIGFILE}.${testname}.stderr" "${OUTFILE}.${testname}.stderr" || diff_failure +} + +diff_failure() { + if [[ $INIT = 0 ]]; then + echo "FAILURE...diff mismatch!" + exit 1 + fi +} + +cleanup() { + if [[ $INIT = 0 ]]; then + rm -rf "${OUTFILE}.*" + fi + + if [[ -f "${BASEFILE}.unreachable.stdout" ]]; then + rm -rf "${BASEFILE}.unreachable.stdout" + fi + + if [[ -f "${BASEFILE}.unreachable.stderr" ]]; then + rm -rf "${BASEFILE}.unreachable.stderr" + fi + + # Restore TTY cols + if [[ -n ${TTY_COLS:-} ]]; then + stty cols "${TTY_COLS}" + fi +} + +adjust_tty_cols() { + if [[ -t 1 ]]; then + # Preserve existing TTY cols + TTY_COLS=$( stty -a | grep -Eo '; columns [0-9]+;' | cut -d';' -f2 | cut -d' ' -f3 ) + # Override TTY cols to make comparing ansible-playbook output easier + # This value matches the default in the code when there is no TTY + stty cols 79 + fi +} + +BASEFILE=callback_default.out + +ORIGFILE="${BASEFILE}" +OUTFILE="${BASEFILE}.new" + +trap 'cleanup' EXIT + +# The --init flag will (re)generate the "good" output files used by the tests +INIT=0 +if [[ ${1:-} == "--init" ]]; then + shift + OUTFILE=$ORIGFILE + INIT=1 +fi + +adjust_tty_cols + +# Force the 'default' callback plugin, since that's what we're testing +export ANSIBLE_STDOUT_CALLBACK=default +# Disable color in output for consistency +export ANSIBLE_FORCE_COLOR=0 +export ANSIBLE_NOCOLOR=1 + +# Default settings +export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1 +export ANSIBLE_DISPLAY_OK_HOSTS=1 +export ANSIBLE_DISPLAY_FAILED_STDERR=0 +export ANSIBLE_CHECK_MODE_MARKERS=0 + +run_test default test.yml + +# Check for async output +# NOTE: regex to match 1 or more digits works for both BSD and GNU grep +ansible-playbook -i inventory test_async.yml 2>&1 | tee async_test.out +grep "ASYNC OK .* jid=[0-9]\{1,\}" async_test.out +grep "ASYNC FAILED .* jid=[0-9]\{1,\}" async_test.out +rm -f async_test.out + +# Hide skipped +export ANSIBLE_DISPLAY_SKIPPED_HOSTS=0 + +run_test hide_skipped test.yml + +# Hide skipped/ok +export ANSIBLE_DISPLAY_SKIPPED_HOSTS=0 +export ANSIBLE_DISPLAY_OK_HOSTS=0 + +run_test hide_skipped_ok test.yml + +# Hide ok +export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1 +export ANSIBLE_DISPLAY_OK_HOSTS=0 + +run_test hide_ok test.yml + +# Failed to stderr +export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1 +export ANSIBLE_DISPLAY_OK_HOSTS=1 +export ANSIBLE_DISPLAY_FAILED_STDERR=1 + +run_test failed_to_stderr test.yml +export ANSIBLE_DISPLAY_FAILED_STDERR=0 + + +# Test displaying task path on failure +export ANSIBLE_SHOW_TASK_PATH_ON_FAILURE=1 +run_test display_path_on_failure test.yml +export ANSIBLE_SHOW_TASK_PATH_ON_FAILURE=0 + + +# Default settings with unreachable tasks +export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1 +export ANSIBLE_DISPLAY_OK_HOSTS=1 +export ANSIBLE_DISPLAY_FAILED_STDERR=1 +export ANSIBLE_TIMEOUT=1 + +# Check if UNREACHBLE is available in stderr +set +e +ansible-playbook -i inventory test_2.yml > >(set +x; tee "${BASEFILE}.unreachable.stdout";) 2> >(set +x; tee "${BASEFILE}.unreachable.stderr" >&2) || true +set -e +if test "$(grep -c 'UNREACHABLE' "${BASEFILE}.unreachable.stderr")" -ne 1; then + echo "Test failed" + exit 1 +fi +export ANSIBLE_DISPLAY_FAILED_STDERR=0 + +export ANSIBLE_CALLBACK_RESULT_FORMAT=yaml +run_test result_format_yaml test.yml +export ANSIBLE_CALLBACK_RESULT_FORMAT=json + +export ANSIBLE_CALLBACK_RESULT_FORMAT=yaml +export ANSIBLE_CALLBACK_FORMAT_PRETTY=1 +run_test result_format_yaml_lossy_verbose test.yml -v +run_test yaml_result_format_yaml_verbose test_yaml.yml -v +export ANSIBLE_CALLBACK_RESULT_FORMAT=json +unset ANSIBLE_CALLBACK_FORMAT_PRETTY + +export ANSIBLE_CALLBACK_RESULT_FORMAT=yaml +export ANSIBLE_CALLBACK_FORMAT_PRETTY=0 +run_test result_format_yaml_verbose test.yml -v +export ANSIBLE_CALLBACK_RESULT_FORMAT=json +unset ANSIBLE_CALLBACK_FORMAT_PRETTY + + +## DRY RUN tests +# +# Default settings with dry run tasks +export ANSIBLE_DISPLAY_SKIPPED_HOSTS=1 +export ANSIBLE_DISPLAY_OK_HOSTS=1 +export ANSIBLE_DISPLAY_FAILED_STDERR=1 +# Enable Check mode markers +export ANSIBLE_CHECK_MODE_MARKERS=1 + +# Test the wet run with check markers +run_test_dryrun check_markers_wet + +# Test the dry run with check markers +run_test_dryrun check_markers_dry --check + +# Disable Check mode markers +export ANSIBLE_CHECK_MODE_MARKERS=0 + +# Test the wet run without check markers +run_test_dryrun check_nomarkers_wet + +# Test the dry run without check markers +run_test_dryrun check_nomarkers_dry --check + +# Make sure implicit meta tasks are not printed +ansible-playbook -i host1,host2 no_implicit_meta_banners.yml > meta_test.out +cat meta_test.out +[ "$(grep -c 'TASK \[meta\]' meta_test.out)" -eq 0 ] +rm -f meta_test.out + +# Ensure free/host_pinned non-lockstep strategies display correctly +diff -u callback_default.out.free.stdout <(ANSIBLE_STRATEGY=free ansible-playbook -i inventory test_non_lockstep.yml 2>/dev/null) +diff -u callback_default.out.fqcn_free.stdout <(ANSIBLE_STRATEGY=ansible.builtin.free ansible-playbook -i inventory test_non_lockstep.yml 2>/dev/null) +diff -u callback_default.out.host_pinned.stdout <(ANSIBLE_STRATEGY=host_pinned ansible-playbook -i inventory test_non_lockstep.yml 2>/dev/null) diff --git a/test/integration/targets/callback_default/test.yml b/test/integration/targets/callback_default/test.yml new file mode 100644 index 0000000..79cea27 --- /dev/null +++ b/test/integration/targets/callback_default/test.yml @@ -0,0 +1,128 @@ +--- +- hosts: testhost + gather_facts: no + vars: + foo: foo bar + tasks: + - name: Changed task + command: echo foo + changed_when: true + notify: test handlers + + - name: Ok task + command: echo foo + changed_when: false + + - name: Failed task + fail: + msg: no reason + ignore_errors: yes + + - name: Skipped task + command: echo foo + when: false + + - name: Task with var in name ({{ foo }}) + command: echo foo + + - name: Loop task + command: echo foo + loop: + - 1 + - 2 + - 3 + loop_control: + label: foo-{{ item }} + + # detect "changed" debug tasks being hidden with display_ok_tasks=false + - name: debug loop + debug: + msg: debug-{{ item }} + changed_when: item == 1 + failed_when: item == 2 + when: item != 4 + ignore_errors: yes + loop: + - 1 + - 2 + - 3 + - 4 + loop_control: + label: debug-{{ item }} + + - block: + - name: EXPECTED FAILURE Failed task to be rescued + fail: + rescue: + - name: Rescue task + command: echo rescued + + - include_tasks: include_me.yml + loop: + - 1 + + - copy: + dest: '{{ lookup("env", "OUTPUT_DIR") }}/test_diff.txt' + content: foo + + - replace: + path: '{{ lookup("env", "OUTPUT_DIR") }}/test_diff.txt' + regexp: '^foo$' + replace: bar + diff: true + + - replace: + path: '{{ lookup("env", "OUTPUT_DIR") }}/test_diff.txt' + regexp: '^bar$' + replace: baz + diff: true + changed_when: false + + - debug: + msg: "{{ item }}" + loop: [] + + - debug: + msg: "{{ item }}" + loop: "{{ empty_list }}" + vars: + empty_list: [] + + - debug: + msg: "{{ item }}" + when: False + loop: + - 1 + - 2 + + handlers: + - name: Test handler 1 + command: echo foo + listen: test handlers + + - name: Test handler 2 + command: echo foo + changed_when: false + listen: test handlers + + - name: Test handler 3 + command: echo foo + listen: test handlers + +# An issue was found previously for tasks in a play using strategy 'free' after +# a non-'free' play in the same playbook, so we protect against a regression. +- hosts: testhost + gather_facts: no + strategy: free + tasks: + - name: First free task + command: echo foo + + - name: Second free task + command: echo foo + + # Ensure include_tasks task names get shown (#71277) + - name: Include some tasks + include_tasks: include_me.yml + loop: + - 1 diff --git a/test/integration/targets/callback_default/test_2.yml b/test/integration/targets/callback_default/test_2.yml new file mode 100644 index 0000000..2daded7 --- /dev/null +++ b/test/integration/targets/callback_default/test_2.yml @@ -0,0 +1,6 @@ +- hosts: nonexistent + gather_facts: no + tasks: + - name: Test task for unreachable host + command: echo foo + ignore_errors: True diff --git a/test/integration/targets/callback_default/test_async.yml b/test/integration/targets/callback_default/test_async.yml new file mode 100644 index 0000000..57294a4 --- /dev/null +++ b/test/integration/targets/callback_default/test_async.yml @@ -0,0 +1,14 @@ +--- +- hosts: testhost + gather_facts: no + tasks: + - name: test success async output + command: sleep 1 + async: 10 + poll: 1 + + - name: test failure async output + command: sleep 10 + async: 1 + poll: 1 + ignore_errors: yes diff --git a/test/integration/targets/callback_default/test_dryrun.yml b/test/integration/targets/callback_default/test_dryrun.yml new file mode 100644 index 0000000..e6e3294 --- /dev/null +++ b/test/integration/targets/callback_default/test_dryrun.yml @@ -0,0 +1,93 @@ +--- +- name: A common play + hosts: testhost + gather_facts: no + tasks: + - debug: + msg: 'ansible_check_mode: {{ansible_check_mode}}' + + - name: Command + command: ls -l + + - name: "Command with check_mode: false" + command: ls -l + check_mode: false + + - name: "Command with check_mode: true" + command: ls -l + check_mode: true + + +- name: "Play with check_mode: true (runs always in check_mode)" + hosts: testhost + gather_facts: no + check_mode: true + tasks: + - debug: + msg: 'ansible_check_mode: {{ansible_check_mode}}' + + - name: Command + command: ls -l + + - name: "Command with check_mode: false" + command: ls -l + check_mode: false + + - name: "Command with check_mode: true" + command: ls -l + check_mode: true + + +- name: "Play with check_mode: false (runs always in wet mode)" + hosts: testhost + gather_facts: no + check_mode: false + tasks: + - debug: + msg: 'ansible_check_mode: {{ansible_check_mode}}' + + - name: Command + command: ls -l + + - name: "Command with check_mode: false" + command: ls -l + check_mode: false + + - name: "Command with check_mode: true" + command: ls -l + check_mode: true + + +- name: "Play with a block with check_mode: true" + hosts: testhost + gather_facts: no + tasks: + - block: + - name: Command + command: ls -l + + - name: "Command with check_mode: false" + command: ls -l + check_mode: false + + - name: "Command with check_mode: true" + command: ls -l + check_mode: true + check_mode: true + +- name: "Play with a block with check_mode: false" + hosts: testhost + gather_facts: no + tasks: + - block: + - name: Command + command: ls -l + + - name: "Command with check_mode: false" + command: ls -l + check_mode: false + + - name: "Command with check_mode: true" + command: ls -l + check_mode: true + check_mode: false diff --git a/test/integration/targets/callback_default/test_non_lockstep.yml b/test/integration/targets/callback_default/test_non_lockstep.yml new file mode 100644 index 0000000..b656ee9 --- /dev/null +++ b/test/integration/targets/callback_default/test_non_lockstep.yml @@ -0,0 +1,7 @@ +--- +- hosts: nonlockstep + gather_facts: false + tasks: + - command: sleep {{ i }} + - command: sleep {{ i }} + - command: sleep {{ i }} diff --git a/test/integration/targets/callback_default/test_yaml.yml b/test/integration/targets/callback_default/test_yaml.yml new file mode 100644 index 0000000..6405906 --- /dev/null +++ b/test/integration/targets/callback_default/test_yaml.yml @@ -0,0 +1,19 @@ +- hosts: testhost + gather_facts: false + tasks: + - name: Sample task name + debug: + msg: sample debug msg + + - name: Umlaut output + debug: + msg: "äöü\néêè\nßï☺" + + - name: Test to_yaml + debug: + msg: "{{ data | to_yaml }}" + vars: + data: | + line 1 + line 2 + line 3 |