diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 16:04:21 +0000 |
commit | 8a754e0858d922e955e71b253c139e071ecec432 (patch) | |
tree | 527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/module_utils_common.respawn/tasks/main.yml | |
parent | Initial commit. (diff) | |
download | ansible-core-upstream/2.14.3.tar.xz ansible-core-upstream/2.14.3.zip |
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | test/integration/targets/module_utils_common.respawn/tasks/main.yml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/integration/targets/module_utils_common.respawn/tasks/main.yml b/test/integration/targets/module_utils_common.respawn/tasks/main.yml new file mode 100644 index 0000000..50178df --- /dev/null +++ b/test/integration/targets/module_utils_common.respawn/tasks/main.yml @@ -0,0 +1,24 @@ +- name: collect the default interpreter + respawnme: + mode: no_respawn + register: default_python + +- name: cause a respawn + respawnme: + mode: respawn + register: respawned_python + +- name: cause multiple respawns (should fail) + respawnme: + mode: multi_respawn + ignore_errors: true + register: multi_respawn + +- assert: + that: + # the respawn task should report the path of the interpreter it created, and that it's running under the new interpreter + - respawned_python.created_interpreter == respawned_python.interpreter_path + # ensure that the respawned interpreter is not the same as the default + - default_python.interpreter_path != respawned_python.interpreter_path + # multiple nested respawns should fail + - multi_respawn is failed and (multi_respawn.module_stdout + multi_respawn.module_stderr) is search('has already been respawned') |