HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Using SSH to open interactive session in ansible

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
interactiveopenusingsessionsshansible

Problem

Is there a semi-easy way to use Ansible to open an interactive session?

I've spent a good amount of time making use of keys and other credentials stores to make a stellar ansible inventory file. Problem is, when I want to get on the servers that I can easily manage, I've gotta go out and find those creds and take the time to log into them.

It's almost easier for me just to run adhoc commands with ansible instead of logging in via ssh. Is there a way to pause ansible with a running interactive session so I can get a command prompt? I noticed that sometimes it lets me accept host keys, but other times it bombs out, (I think this happens when running ssh proxy), so I know things can be done interactively.

Solution

You could try ansinble-console

It mostly feels like you just have a shell open, unless you use and ansible task name as your command, in which case prefixing it with shell should work.

Context

StackExchange DevOps Q#10495, answer score: 4

Revisions (0)

No revisions yet.