diff --git a/tests/ansible/integration/action/low_level_execute_command.yml b/tests/ansible/integration/action/low_level_execute_command.yml index 7cb6c410..25e3c90f 100644 --- a/tests/ansible/integration/action/low_level_execute_command.yml +++ b/tests/ansible/integration/action/low_level_execute_command.yml @@ -28,7 +28,8 @@ - debug: msg={{raw}} - name: Verify raw module output. assert: - that: | - raw.rc == 0 and - raw.stdout == "root\r\n" and - raw.stdout_lines == ["root"] + that: + - raw.rc == 0 + # WHY DOES VANILLA ANSIBLE INSERT NEWLINES HERE!?!?!?!?!?!ONE + - raw.stdout in ("\r\nroot\r\n", "root\r\n") + - raw.stdout_lines in (["", "root"], ["root"]) diff --git a/tests/ansible/integration/become/sudo_flags_failure.yml b/tests/ansible/integration/become/sudo_flags_failure.yml index b0799846..0392e728 100644 --- a/tests/ansible/integration/become/sudo_flags_failure.yml +++ b/tests/ansible/integration/become/sudo_flags_failure.yml @@ -20,4 +20,5 @@ - out.failed - | ('sudo: no such option: --derps' in out.msg) or - ("sudo: unrecognized option `--derps'" in out.module_stderr) + ("sudo: unrecognized option `--derps'" in out.module_stderr) or + ("sudo: unrecognized option '--derps'" in out.module_stderr) diff --git a/tests/ansible/integration/connection_loader/local_blemished.yml b/tests/ansible/integration/connection_loader/local_blemished.yml index be9873b2..bb53cc48 100644 --- a/tests/ansible/integration/connection_loader/local_blemished.yml +++ b/tests/ansible/integration/connection_loader/local_blemished.yml @@ -11,4 +11,4 @@ register: out - assert: - that: out.mitogen_loaded or not is_mitogen + that: (not not out.mitogen_loaded) == (not not is_mitogen) diff --git a/tests/ansible/integration/connection_loader/ssh_blemished.yml b/tests/ansible/integration/connection_loader/ssh_blemished.yml index 6b295c7e..e39a3469 100644 --- a/tests/ansible/integration/connection_loader/ssh_blemished.yml +++ b/tests/ansible/integration/connection_loader/ssh_blemished.yml @@ -11,4 +11,4 @@ register: out - assert: - that: out.mitogen_loaded or not is_mitogen + that: (not not out.mitogen_loaded) == (not not is_mitogen) diff --git a/tests/ansible/integration/context_service/lru_one_target.yml b/tests/ansible/integration/context_service/lru_one_target.yml index 0ba2f21f..3abd7b48 100644 --- a/tests/ansible/integration/context_service/lru_one_target.yml +++ b/tests/ansible/integration/context_service/lru_one_target.yml @@ -13,6 +13,7 @@ - name: Reset all connections mitogen_shutdown_all: + when: is_mitogen - name: Spin up a bunch of interpreters custom_python_detect_environment: diff --git a/tests/ansible/run_ansible_playbook.sh b/tests/ansible/run_ansible_playbook.sh index 45a4a112..39580e37 100755 --- a/tests/ansible/run_ansible_playbook.sh +++ b/tests/ansible/run_ansible_playbook.sh @@ -7,9 +7,9 @@ export MITOGEN_MAX_INTERPRETERS=3 if [ "${ANSIBLE_STRATEGY:0:7}" = "mitogen" ] then - extra="-e is_mitogen=1" + EXTRA='{"is_mitogen": true}' else - extra="-e is_mitogen=0" + EXTRA='{"is_mitogen": false}' fi -exec ansible-playbook $extra "$@" +exec ansible-playbook -e "$EXTRA" "$@"