A
A
Artem2015-05-19 13:33:43
Vagrant
Artem, 2015-05-19 13:33:43

Provisioning with Ansible vagrant machines installed on Windows, how?

There are a large number of vagrantboxes with linux installed inside, hosted on different physical hosts with OS X, Ubuntu and Windows. It is necessary to set up their provisioning according to the push scheme, that is, the recipes must remain on the central host. The pull option is not considered because the configs for dev and prod environments are partly unified, plus I would not want to send data from vault to virtual machines.
Since vagrantboxes are inside different operating systems, you can’t just take them and access them via ssh. Therefore, the idea comes to mind of using reverse-ssh, which will be installed from vagrant hosts on a machine dedicated for this, where ansible-playbook will be launched for everything that has joined.
The question is, how to convince ssh on vagrant to choose a free port on a dedicated host, so as not to manually register it for each created virtual machine?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2015-05-19
@ya_1

He asked, he answered

ssh -N -f -R 0:localhost:22 [email protected]
Allocated port 59199 for remote forward to localhost:22

The null tells ssh to choose itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question