Trying to make a dual boot script and came across these results, the shell is changed during the playbook but subsequent tasks are somehow using the old one.
How can I force a new connection please?
Change shell to cmd -Success
win_ping using powershell - success
win_ping using cmd - failure
The reverse is true when changing it back.
I’ve confimed the shells are changing by normal ssh from CLI
My explanation in the first message wasn’t great - apologies.
Just to be clear…
In a playbook…
A Tasks changes remote shell on windows system (ansible_shell_type) from powershell to cmd
Subsequent tasks then run but have the opposite results as if the shell hasn’t been changed
win_ping using powershell - success - when it should fail
win_ping using cmd shell - failure - when it should work, as we’ve changed the shell in 1
Just been reading about multiplexing, sounded a likely culprit so I set
ansible.cfg
[ssh_connection]
-o ControlMaster=no
But no change, it’s still hanging onto it’s old shell despite having been changed.
Or I’m tired and misreading something
Thank you, incredible helpful. Off to read more about that now.
Also wanted to take the opportunity to thank you, I was reading your excelelnt article on Windows Mapped drives the other day.
Still some testing to do on that but I may have a question there. If so shall I put it on this list?