简体   繁体   中英

Use Windows with Virtual Box as Host and VM guest for managing with Vagrant and Ansible

Is there a way for next scenario as I am planing to setup lab environment:

  • physical desktop running Windows 8 platform
  • on Windows 8, I plan to install ONLY Virtual Box 5.1
  • then on VirtualBox to setup CentOS system
  • and then on CentOS will be running Vagrant and Ansible (no VirtualBox installation)

Question: Is there any way that this setup will work to create new environments via CentOS as Vagrant-Ansible manage servers?

------------------------edit---------------------- Thank you for your answer. I try to setup as I mentioned above without luck. I am new user of Vagrant and Ansible so I am having trouble to make it work. I setup Linux system on VB, install vagrant, install Ansible but when I hit 'vagrant up' I am getting error that "No usable default provider could be found for your". I am following documentation form official sites but can;t make it work. Then I try to install VirtualBox inside Linux system and now it is working but defined machines with Vagrant installs inside Linux machine (where are Vagrant and Ansible installed) and not on Host VirtualBox. Any advice? I hope it is clearer now. Thanks

I have had some success in using a Windows Ansible Host and running using Vagrant with this host.

I have scripted how to setup Win Ansible and the shims at: https://github.com/taliesins/win-ansible

The important bit is to setup shims that call bash scripts running under cygwin.

Another important thing to consider is, is that it is probably better to generate your own inventory file (put it in the vagrant file before you create VMs) then to use an auto-generated inventory file.

If you environment is not simple consider not using Vagrant provisioner for Ansible, but rather call Ansible via command line at the end of the vagrant file (after you have created the VMs).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM