This repository contains tooling for deploying efs in Amazon AWS using terraform and ansible.
This repo is part of a parent project to achieve the ability of possibility of controlled deployments in different environments so, that we can rollback
We need infrastructure modules to be pulled by the driver pipeline to be consistent to a standard format so that it can execute them in one job and push their states to output repos.
The solution is to pack the CI, CD, and destroy scripts consuming terraform module in ansible playbooks and provide the consistent interface to driver repo.
- Ansible
- Bash
- Terraform
This project can be run from any type of host with no platform restrictions. However, it was originally intended to be used by a Jenkins job.
- You need to install ansible and terraform first, or use this docker image
$ docker run -it -v ${PWD}:/tmp stakater/pipeline-tools:1.0 sh
$ cd /tmp
- Run these,
$ mkdir -p build
$ touch tfvars.sh
$ touch secrets.sh
- Edit
tfvars.sh
, paste, and modify the following as needed.
Note: S3 backend bucket needs to be created first.
export TF_VAR_stack_name_prefix="stakater"
export TF_VAR_environment="dev"
export TF_VAR_vpc_id="vpc-4065a326"
export TF_VAR_vpc_cidr="10.241.0.0/16"
export TF_VAR_private_subnet_ids="subnet-a051b7c6,subnet-ae15e0e6,subnet-a20e2cf9"
export TF_VAR_region="eu-west-1"
export TF_VAR_s3_bucket="449074299682-stakater-dev-state-store"
export TF_VAR_database_name="stakater123"
export TF_VAR_database_username="root"
export TF_VAR_subnet_ids="subnet-a051b7c6,subnet-a20e2cf9,subnet-ae15e0e6"
Edit secrets.sh
, and provide password for database.
Note: Use secrets.sh only for those secret params that should not be commited to output repo for obvious security concerns. Any other information provided here instead of tfvars.sh would not be recorded anywhere just like passwords should not be
echo "export TF_VAR_database_password=securepassword"
- Run
ansible-playbook configure.yaml create.yaml
Run ansible-playbook configure.yaml delete.yaml
Got a question? File a GitHub issue, send us an email.
Please use the issue tracker to report any bugs or file feature requests.
PRs are welcome. In general, we follow the "fork-and-pull" Git workflow.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
View our closed Pull Requests.
Apache2 © Stakater