Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 1.14 KB

README.md

File metadata and controls

38 lines (23 loc) · 1.14 KB

IaC Adventure Labs - Terraform + Ansible

This project aims to create and configure an infrastructure as a code using Terraform and Ansible

Requirements:

- aws-cli
- Terraform
- Ansible
  • Clone the repo and give the run.sh file permission with chmod +x

Configured the services above, run the script "run.sh". It will display an options menu on the screen In the first option, Infra will be created on AWS. Terraform will create an inventory file with the EC2 IP.

Option menu to be chosen:

    $ sh run.sh 
      Welcome to IaC Adventure
      [ 1 ] Create EC2 on AWS
      [ 2 ] Delete EC2
      [ 3 ] Install Wordpress by Ansible


Configuring the module:

Set the path to your aws .pem key in the terraform/inventory.tmpl file.

ansible_ssh_private_key_file='path/your-key.pem'

This file is responsible for creating the config that the ansible playbook will access, customize with the EC2 username, key address and host group name for example.