As Jon is saying you are trying to run the win_feature module on localhost and not the newly provisioned EC2 server. Here is a very mock playbook that you need to follow to get working. Note this is not tested and some things could potentially be wrong
--- - name: provision new EC2 server hosts: localhost gather_facts: no tasks: - name: provision t2.micro EC2 instance ec2: aws_access_key: '{{ aws_id }}' aws_secret_key: '{{ aws_key }}' region: '{{ aws_region }}' image: ami-e3bb7399 instance_type: t2.micro count: 1 vpc_subnet_id: subnet-112b2c3d assign_public_ip: yes register: ec2_details - name: add new t2.micro EC2 instance to Windows group add_host: name: '{{item.public_ip}}' groups: windows with_items: '{{ec2_details.instances}}' - name: install features on new EC2 server hosts: windows gather_facts: no tasks: - name: wait for connection to be online wait_for_connection: - name: install IIS Web-Server with sub features and management tools win_feature: name: Web-Server state: present include_sub_features: yes include_management_features: yes register: feature_install - name: reboot if feature install requires it win_reboot: when: feature_install.reboot_required Just a few notes about this * Your inventory should contain an empty group calls *windows* that contains the connection vars required for it to connect. After provisioning the EC2 instance, *add_host *will add the public IP of the newly created instances to that group for the next play to work * The 2nd play which runs on the windows group will first wait for the connection to be online, this will actively try and connect over WinRM and will fail if that is unsuccessful after a timeout * The *restart* option of win_feature is deprecated, I've split it out into 2 tasks using the win_reboot action plugin. Thanks Jordan -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fe9eae43-8157-4ea0-8d9b-3eb3d84529a3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.