Interactive shell on managed node?
I swear there's a way to run an Ansible command to launch an interactive shell from the controller to interact with a managed node.
Sometimes when troubleshooting a playbook, I need to SSH to a node and poke around a bit more than is convenient for an ad-hoc command. For ephemeral nodes that don't have fully provisioned IAM (i.e. I don't have or want my own account to SSH over with), I stitch together the same ssh config Ansible uses and ssh over as the Ansible user.
Am I imagining a forgotten fever dream, or is there an Ansible command that will basically drop me into an interactive shell session on the remote?
Posted Sep 2, 2022, 12:35 PM UTC
143
ANSIBLE-CONSOLE !! Scouts honor, I googled for a while before posting. And of course, as soon as I post, I google one more time and find it immediately.
This is not a 'shell on the remote host' but basically a REPL shell that works mostly by allowing each command to be an 'ad-hoc' execution
ansible-ssh is an 'actual remote shell' using ansible ssh args, this is not an 'official Ansible project' and i know of at least a couple of variants that did the same in the past.
Perfect timing, thank you! This will hopefully help with a rather unusual problem I’m currently working on.