Reputation: 4750
From reading the Connect to your Windows instance AWS EC2 docs page, my understanding is that it is not possible to SSH to Windows EC2 instances.
The typical procedure to connect to a Windows EC2 instance manually is to download the remote desktop file, get the password for the instance, and then use the Remote Desktop Connection tool to RDP to the instance (more detail is in the docs page above).
If I am correct that Windows EC2 instances do not support connecting via SSH, how can you connect to a Windows EC2 in an Ansible playbook?
I would prefer to be able to do this without installing any software on the Windows EC2 instance beforehand, but if that is necessary, I can do that.
Upvotes: 1
Views: 2380
Reputation: 4750
I have found you need to do the following to connect to a Windows EC2 instance using Ansible:
ConfigureRemotingForAnsible.ps1
script. This can be done either by setting this as the user data when you create the EC2, or by running this script after the EC2 is created.ansible_connection
variable set to winrm
, and the ansible_winrm_scheme
variable set to http
. This can be done with --extra-args
or any other way that variables are set.hosts
in the playbook, or in a host file passed to ansible-playbook
with -i
.ansible_password
variable for the EC2.Upvotes: 3