Interacting with AWS Windows instances
When we interacted with our local Windows Vagrant box, it was not using a secure connection; let's look at launching a Windows EC2 instance in an AWS instance and then interacting with it like we did with the CentOS 7 instance in Chapter 10, Highly Available Cloud Deployments.
First of all, we need to create the folder structure for our new playbook:
$ mkdir cloud cloud/group_vars cloud/roles $ touch cloud/production cloud/site.yml cloud/group_vars/common.yml
Once we have the structure, we need to create four roles, starting with the AWS one.
AWS role
Our first role will create the VPC and launch the EC2 instance. To bootstrap the role change, go to the cloud folder and run:
$ cd cloud
$ ansible-galaxy init roles/aws
Let's start with the contents of roles/aws/defaults/main.yml
first:
vpc_cidr_block: "10.0.0.0/16" the_subnets: - { use: 'ec2', az: 'a', subnet: '10.0.10.0/24' } ec2: instance_type: "t2.large" wait_port: "5986" image: base: Windows_Server...