Skip to content

This repository is a example how using using Terraform and Ansible.

Notifications You must be signed in to change notification settings

czerwonkabartosz/ansible-terraform-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible with Terraform Example

This repository is a example how using using Terraform and Ansible.

Terraform is using to create immutable EC2 instance on AWS and Ansible to install and configure HAProxy.

Setup:

  1. Install:

Usage:

Run Terraform:

terraform init --backend-config="access_key=XXX" --backend-config="secret_key=YYY"
terraform workspace new dev-env
terraform apply 

Run Ansible playbook:

sh ansible_runner.sh ~/.ssh/id_rsa terraform/ dev-env ansible/haproxy.yml

Development:

It is possible to test Ansible scripts locally with use Vagrant.

cd ansibble/
ansible-galaxy install -r requirements.yml

vagrant up

Or if the machine is running then the Ansible changes can be tested using only

vagrant provision

About

This repository is a example how using using Terraform and Ansible.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published