Hosts = all, One simple Task - but for multi platform (Windows WinRM + SSH)

26 views
Skip to first unread message

Sassy Natan

unread,
Jun 7, 2015, 5:21:21 PM6/7/15
to ansible...@googlegroups.com
Hi Group,

Wonder if someone have a feedback on the following issue:

I'm creating two machine in EC2 - One is Windows and the other is Linux. 
Once VMs are up and running I run a test on Windows which take like 1 hour, and if run successfully I move on to Linux
and run anther test. Total time of the test are around 2 hours.
Each test is define as a different task under different group as Windows use WINRM and Linux use SSH. 

I was thinking to run both test on the same time, which means I should have one task run on the the same group via hosts = <name_of_the_group>.
However I can't find how to define a condition where the parameters of the connection will be different, so ansible will use SSH for Linux and WINRM for Windows.

I looked here :



And was trying to load {{ansible_os_family}}.yml so Windows will take the following:

ansible_connection: winrm
ansible_ssh_user: Administrator
ansible_ssh_pass: **********
ansible_ssh_port: 5985

However Ansible always use SSH -( !



Maybe I should consider working with Asynchronous Actions and Polling? https://docs.ansible.com/playbooks_async.html

I give it a try - but this also was not working as expected.

Maybe someone have any alternative idea?


Thanks
Sassy





Brian Coca

unread,
Jun 7, 2015, 5:36:19 PM6/7/15
to ansible...@googlegroups.com
try creating a group_vars/windows and put the settings in there, then
make sure the windows machines belong to the 'windows' group.



--
Brian Coca
Reply all
Reply to author
Forward
0 new messages