4

I have a set of hosts that I can only access via openVPN (one VPN per host or group of hosts). ssh is only available after connected to the VPN.

Is there any way to automatically bring up the VPN connection for the individual hosts / host groups inside the inventory using default ansible methods?

2
  • 2
    That could be implement with a generic rule that would have to be called; I have no ideia if it could be implemented in the inventory phase. I know about VPN-on demand policy configurations for iOS and OS/X, would be interested to learn if something similar can be configured in Linux. In sshd_config specific connection rules can be added for each host via ProxyCommand, however it does not seem a practical approach for a high number of hosts. Feb 10, 2016 at 14:54
  • 1
    Interesting ideas! I didn't know about the VPN on demand option on OSX. Pity, it doesn't work with openVPN. I'll have a look at the sshd connection rules. If that doesn't pan out, I'll just have to write a wrapper script. I just don't want to reinvent the wheel. Unfortunately the problem is virtually un-google-able, always leads to playbooks for vpn installation. Feb 11, 2016 at 15:32

0

You must log in to answer this question.

Browse other questions tagged .