Hello All:
Please help!
Problem -
I have a hosts file separated out with different branches of an organization as such:
[branch01]
server01
server02
server03
[branch02]
server04
server05
…etc
The problem is that if server01 and server05 are windows, how do I specify to use WinRM?
I’ve tried the following:
-
Using ‘register:’ in https://www.reddit.com/r/ansible/comments/67q35z/is_it_possible_for_an_ansible_playbook_to/ [did not work]
-
Setting [branch:vars] to winrm (and tried to use gather_facts to specify linux instead) [did not work]
-
Gather_facts: True. Then using when: ansible_os_family == windows. [fails because it uses ports 22 rather than 5986
Is there a way to dynamically switch from SSH to WINRM based on the way I have my hosts set up?