I’m going to follow the steps from the Hashicorp website and create a customised Windows 2019 server and setup winrm, and set the Administrator password.
Once the AMI image is ready, were going to build an instance bases on our new AMI image, then get Ansible to setup the server for us.
Get your copy of the code from my GitHub page: https://github.com/dmccuk/packer_wind...
Don't forget to STAR the repo and give me a follow on GitHub.
This is the Hashicorp link. I'm made some updated to their code like the region in AWS. You can do the same one you clone the code.
Assumptions
I won’t be going into detail on these items:
I’m assuming your have already installed Packer!
I’m also assuming you know how to obtain and use the AWS access and Secret key from the AWS console.
Don’t worry if you don’t know how to do these steps. You can follow my previous video’s where I show you how to do this in details:
Build you’re first EC2 instance: • Getting started with AWS EC2 | Hands-...
Install Packer and create an AMI: • Introduction to DevOps Tools - Instal...
A quick note:
"I make these video’s for you. I hope they help with your learning so feel free to share any of them with your colleagues, on LinkedIn and other social media platforms. I'd really appreciate it if you could Subscribe so you see new content I post and please, like the video".
If you have question, pop them in the comments and I’ll reply as soon as I can. Now, lets get down to it.
Steps
Create the required packer files
Create the AMI image
Build a windows server from the new AMI
Login to test credentials
Open the FW for winrm-HTTPS
Test with Ansible win_ping to confirm connectivity
Now run my test playbook
Let me know how you get on!
Remember to remove all resources
Now that the demo has worked, I'm going to destroy my EC2 instance, the AMI image we created and the snapshot. This way I won't be charged by AWS for any of these resource sticking around. I advise you to do the same as you don't want to be spending any money you don't need to.
Follow my demo and I'll show you how to do all of the steps.
#packer #windows #ansible
Watch video Hashicorp Packer: Build a Windows server in AWS and manage with Ansible online without registration, duration hours minute second in high quality. This video was added by user LondonIAC / Dennis McCarthy / Automation Engineer 11 August 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 5,301 once and liked it 71 people.