Skip to content

The ansible infrastructure is created through terraform (IAC). All the details are fetching through a bash script. So, you don't need to change anything manually all are working automatically but some values are appending with your answer. Also, the infrastructure includes one ansible master server (Constant Redhat Distributer), two ansible clie…

Notifications You must be signed in to change notification settings

yousafkhamza/ansible_infra_making_terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform used to Create an Ansible-master & Ansible Clients (NB: Ansible master hosts file is automatically generated with client details)

Builds

Description:

The ansible infrastructure is created through terraform (IAC). All the details are fetching through a bash script. So, you don't need to change anything manually all are working automatically but some values are appending with your answer. Also, the infrastructure includes one ansible master server (Constant Redhat Distributer), two ansible client servers (Choosable Redhat/Debian Distributer) please note that both client servers with the same distributor which you opt for. In addition, you can choose both master/client's Instance type would you be like also you can use the infrastructure where you want. Furthermore, Terraform installation is included in the script and It's working with your AWS cloud and your default VPC if anyone needs to connect VPC with the infrastructure please ping me via LinkedIn.

Feutures:

  • Easy to use and create a ansible infrastructure (only two clients)
  • Client operating system is choosable (Debian/Redhat)
  • Instance Type is choosable (Both Master/Client)
  • You can use this code at wherever in AWS Cloud
  • Terraform installation included
  • Ansible installtion is included (Master)
  • Master server creates hosts file (with your two clients private IP) (/root/ -- hosts file location in master)

Used Languages:

  • Terraform - HCL (For Infrastructure Making)
  • Bash (For automating HCL infrastructure making)

Used Resources/ Dependencies:

  • 3 EC2 Instances (1 Ansible Master, 2 Ansible Clients)
  • 2 Security Groups (Open Ports: SSH for Master, SSH,HTTP,MySQL for clients)
  • IAM Role (IAM Role with EC2 Describe)
  • Key Pair (Login to these servers key.pem is the name)
  • Default VPC (On your infrastructure)

How to use the Script:

 git clone https://github.com/yousafkhamza/ansible_infra_making_terraform.git
 cd ansible_infra_making_terraform/
 chmod +x setup.sh
 sh setup.sh

Sample Screenshots

setup.sh script sample screenshots

  • Banner alt text
  • Screenshot 1 alt text
  • Screenshot 2 alt text
  • Screenshot 3 alt text
  • Screenshot 4 alt text
  • Screenshot 5 alt text
  • Screenshot 6 alt text

you can check the ansible master and client connection with the below ansible command (After infrastructure creation)

  • Login to your Ansible-Master server (screenshot 5)
ssh -i key.pem ec2-user@public_ip     <========= this public_ip will be printed so please use that ip with the same
  • Client conncetion checking through Ansible (screenshot 6)
ansible  -i hosts all --list-hosts

ansible -i hosts all -f 1 -m ping

Conclution:

This is only for creating one master and two clients ansible infrastructure.

⚙️ Connect with Me

About

The ansible infrastructure is created through terraform (IAC). All the details are fetching through a bash script. So, you don't need to change anything manually all are working automatically but some values are appending with your answer. Also, the infrastructure includes one ansible master server (Constant Redhat Distributer), two ansible clie…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published