Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible connect to jump machine through VPN?

Tags:

ansible

I was wondering if it were possible to tell Ansible to set up a VPN connection before executing the rest of the playbook. I've googled around, but haven't seen much on this.

like image 316
Breedly Avatar asked Jun 13 '16 23:06

Breedly


1 Answers

You could combine a local playbook to setup a VPN and a playbook to run your tasks against a server.

Depending on whats the job you can use ansible or a shell script to connect the VPN. Maybe there should be another playbook to disconnect afterwards.

As result you will have three playbooks and one to combine them via include:

- include: connect_vpn.yml
- include: do_stuff.yml
- include: disconnect_vpn.yml
like image 139
flxPeters Avatar answered Sep 28 '22 07:09

flxPeters