home directory for Ansible in windows machine using cygwin

84 views
Skip to first unread message

aarathy shenoy

unread,
Dec 23, 2019, 12:55:21 AM12/23/19
to Ansible Project
I am new to ansible.
I have installed Ansible in a windows 10 machine with the help of cwygwin.Ansible is running now.
Is the home directory of Ansible getting set while the installation happens?
Can anyone help me in setting the home directory where I can keep my playbooks to execute?
Is it possible to execute the playbook from a location other than the home directory?

Ankit Vashistha

unread,
Dec 23, 2019, 3:00:13 AM12/23/19
to Ansible Project
What do you mean by home directory?

I think you can keep your playbook anywhere and it will work until you point to the correct file.

ansible-playbook -i <path to inventory> <path to playbook>

EX: ansible-playbook -i myinventory myplaybook will work if  myinventory myplaybook are in current directory or you can specific the absolute path to those directories. 

Regards,
Ankit


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/785a9155-23bb-4e09-aaf4-e692ac185a89%40googlegroups.com.

aarathy shenoy

unread,
Dec 23, 2019, 3:39:56 AM12/23/19
to Ansible Project
inventory files are just for mentioning the host details  am I right?
so if I wish to execute a playbook from D drive of my windows machine will the below syntax be correct?
$ ansible playbook "d:\POC\POC.yml"

Jordan Borean

unread,
Dec 23, 2019, 7:04:15 PM12/23/19
to Ansible Project
If you are using Windows 10, use WSL not Cygwin. WSL is a lot more compatible than Cygwin so I highly recommend you use that instead. In any case to access a Windows drive from cygwin the path is '/cygdrive/<drive letter>/path`, so in your case it would be '/cygdrive/d/POC/POC.yml'.
Reply all
Reply to author
Forward
0 new messages