Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Ansible-Playbook on localhost on Windows

I know Ansible supports Windows clients/nodes. What I really enjoy about Ansible is that I can create a Linux VM, pull a git repo that contains Ansible playbooks for and without any configuration or setup of a control server, I am able to run the playbook on the local machine.

Since you can execute Python on Windows, would it be possible to run roles/playbooks on localhost on Windows?

This would be the first step for running Ansible in a datacenter with only Windows where it is not possible to even run Linux in VirtualBox.

like image 632
ajgreyling Avatar asked Jan 19 '17 13:01

ajgreyling


People also ask

Can I run Ansible on localhost?

This is a second method to run ansible playbook locally. You can also explicitly define your localhost in your inventory file. your inventory file can be at the default location /etc/ansible/hosts or a customized ansible_hosts file in your present working directory.


1 Answers

Ansible won't run on a windows control machine, as stated in the documentation:

Reminder: You Must Have a Linux Control Machine

Note running Ansible from a Windows control machine is NOT a goal of the project. Refrain from asking for this feature, as it limits what technologies, features, and code we can use in the main project in the future. A Linux control machine will be required to manage Windows hosts.

Cygwin is not supported, so please do not ask questions about Ansible running from Cygwin.

like image 191
techraf Avatar answered Sep 29 '22 09:09

techraf