I am learning ansible from ansible-beginner to pro by micheal heap. It seems that ansible is not supported on windows. The book suggests running ansible from a virtual machine instead. I started a VMbox using vagrant, which has ubuntu/trusty64 on it. I am successfully able to run my playbooks on it. However, I ran into an issue when creating ansible-galaxy roles.
I could not find a way to create/ initialize a role on windows. I vaguely borrowed ideas from this question How to automatically install Ansible Galaxy roles? and added the following command to my playbook create roles on windows
local_action: command ansible-galaxy init sush.util --init-path roles
---
- hosts: all
gather_facts: false
become: true
tasks:
- name: make sure we can connect
ping:
#ansible-galaxy
- name: Init sush.util
local_action: command ansible-galaxy init sush.util --init-path roles
ignore_errors: true
I also added ignore_errors=true
to ignore the errors if the role has already been created.
Is this the correct approach or is there another/better to do this in windows ?