---### Setup instances
- name: configure iis servers hosts: tag_environment_test:&tag_type_iisserver roles: - iisserver ---### Install iis
- name: Install iis win_feature: name: "Web-Server" state: absent restart: yes include_sub_features: yes include_management_tools: yes- name: Do some stuff to windows servers
hosts: tag_OS_windows2012r2
gather_facts: false
connection: local
tasks:
- name:
win_file:
path: C:\foobar.txt
state: touch
I also created a folder / file group_vars/tag_OS_windows2012r2.yml (note this file name is the same as my hosts in the playbook)
ansible_connection: winrm
ansible_ssh_port: 5986
ansible_ssh_user: Administrator
ansible_ssh_pass: mypassword123
And then call your playbook with ec2.py (and AWS profiles, if you use that)
AWS_PROFILE=main ansible-playbook -i /etc/ansible/ec2.py myplaybook.yml