diff --git a/test/integration/targets/connection_windows_ssh/runme.sh b/test/integration/targets/connection_windows_ssh/runme.sh index 766193f8eb5..ffc285deeff 100755 --- a/test/integration/targets/connection_windows_ssh/runme.sh +++ b/test/integration/targets/connection_windows_ssh/runme.sh @@ -38,10 +38,13 @@ ansible -i ../../inventory.winrm localhost \ -e "test_shell_type=powershell" \ "$@" -# ensure the default shell is set to PowerShell +# ensure the default shell is set to PowerShell - use an explicit shell +# var as a previous task set the default shell to cmd and we don't want to +# inherit the ansible-test defaults in inventory.winrm. ansible -i ../../inventory.winrm windows \ -m win_regedit \ -a "path=HKLM:\\\\SOFTWARE\\\\OpenSSH name=DefaultShell data=C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe" \ + -e "ansible_shell_type=cmd" \ "$@" ansible -i "${OUTPUT_DIR}/test_connection.inventory" windows \ diff --git a/test/integration/targets/incidental_win_reboot/tasks/main.yml b/test/integration/targets/incidental_win_reboot/tasks/main.yml index 59b9c972bf3..b23106f6f09 100644 --- a/test/integration/targets/incidental_win_reboot/tasks/main.yml +++ b/test/integration/targets/incidental_win_reboot/tasks/main.yml @@ -44,6 +44,9 @@ register: removed_shutdown_privilege - block: + - name: reset connection to ensure privilege change takes effect + meta: reset_connection + - name: try and reboot without required privilege win_reboot: register: fail_privilege @@ -58,6 +61,9 @@ users: '{{ removed_shutdown_privilege.removed }}' action: add + - name: reset connection after adding privileges back in + meta: reset_connection + - name: Use invalid parameter reboot: foo: bar