geerlingguy/ansible-vagrant-examples

Use ubuntu bash on windows as control box?

dgmdevelopment opened this issue · 1 comments

Hi, is it possible to use the linux (ubuntu) bash on windows as the ansible control machine? on vagrant.exe up on the lamp stack i get

Running provisioner: ansible...
Windows is not officially supported for the Ansible Control Machine.
Please check https://docs.ansible.com/intro_installation.html#control-machine-requirements
Vagrant gathered an unknown Ansible version:

and falls back on the compatibility mode '1.8'.

Alternatively, the compatibility mode can be specified in your Vagrantfile:
https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode
    lamp: Running ansible-playbook...
The Ansible software could not be found! Please verify
that Ansible is correctly installed on your host system.

If you haven't installed Ansible yet, please install Ansible
on your host system. Vagrant can't do this for you in a safe and
automated way.
Please check https://docs.ansible.com for more information.

I did install ansible on the control machine (ubuntu). Not sure what I'm doing wrong. Thanks for any suggestions!

@dgmdevelopment so, the problem is if you use vagrant.exe, Ubuntu Bash is calling out to the Windows executable—which does not have any ability to see utilities like Ansible installed inside Ubuntu Bash.

One option would be to use the ansible_local provisioner and have Ansible inside the Vagrant VM (that's what Drupal VM does). Another option is to use Vagrant to build the VM(s), but do all the Ansible stuff completely separately in Ubuntu Bash, with your own custom inventory to connect to the VM(s) by IP or hostname.