Link to home
Start Free TrialLog in
Avatar of langdj
langdj

asked on

I Need to Automate the creation EC2 instances (50 of them) with two static private IP address and static hostname

I Need to Automate the creation EC2 Centos7 instances (50 of them)  with two private IP address. I am familiar with Ansible or AWS Cloudformation so I can use either tool. Here are my requirements

- Eth0 needs to be on the 172.30.0.x subnet (Pre-existing subnetA)
- Eh1 needs to be on the 172.20.1.x subnet.  (Pre-existing subnetB)
- The IP address need to be private and controlled for each instance for example for Node 90 The IP for Eth0 is 172.30.0.78 and for Eth1 it is 172.30.1.78.
- The Hostname needs to be changed Node {90 - 140}

The challenge that I am running into is that it is hard to find example  where someone has done something similar. For example I don't know how to

1. Assign a Subnet / Private to one NIC
2. Assign a different Subnet / Private IP to a different NIC --most docs just show support for one NIC
3. Change the Hostname during time of EC2 instance Creation


Most of the stuff I want to is static. Most of the documentation only shows how to create dynamically assigned attribute. Or leverage VPC / Subnets that Cloudformation created and is already aware of (e.g. !REF)

Does anyone know a good article suggestions such that shows how to do this or a good Github example I can use as a template?
Avatar of David Favor
David Favor
Flag of United States of America image

Somewhat off topic.

If you get jammed up + can't figure out how to do this on EC2, because everything's just more difficult with EC2, reach out + I can share how I do this with LXD.

I setup... sometimes 100s of containers in a day... Simple. Fast. They work every time, with zero headache.

I had to abandon EC2 years ago, because everything was some complex... failed oddly... never seemed to operate as expected, especially with complex networking requirements.
Avatar of langdj
langdj

ASKER

No doubt however EC2 is a decision made up higher on the food chain than me. I have to solve this with EC2. Any thoughts?
You can achieve this by writing code on Ansible. I done similiar job 1 yr back using Ansible Tower.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.