Terminal connection plugin: access to host or play inventory details?

zpe-reneneumann
Wed, 27 Sep 2023 09:30:25 +0000
Get Help

Hi,

I’m currently trying to create a terminal connection plugin. The goal is to connect to a console port via a terminal server. So the plugin must be able to deal with the initial terminal connection and have to authenticate against the device.
I have have current sample working overall, but I’m stuck on how I can handle the credentials?

The inventory data for ansible)user and password are used for the ssh session to the terminal server itself, so I need a 2nd pair of credentials which I can ideally define in the inventory. How can I either pass this 2nd set of credentials to the plugin or how can the plugin look this info up?

I was hoping that the “_connection._play_context” would help, but I am unsure how to add information to it?

Any help or hint would be greatly appreciated.

Regards
Rene

3 posts - 3 participants