Simply run vagrant up and the 3 mongo instances will be deployed and register in replica set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # List terraform resources in the current directory and ask their arn to import them into terraform state | |
| RESOURCES_LIST=$(awk -F\" '/^resource "/ {print $2"."$4}' *.tf) | |
| for resource in ${RESOURCES_LIST} | |
| do | |
| read -p "Enter ARN for resource ${resource} (type none to not import it): " arn | |
| if [[ ${arn} != "none" ]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # playbook_cf_stack_update.yml | |
| # update an existing cloudformation stack by changing only the parameters specified into updated_params dict variable | |
| - hosts: localhost | |
| connection: local | |
| gather_facts: False | |
| vars: | |
| stack_name: stack-to-update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name localhost; | |
| location / { | |
| proxy_pass http://gateway:8080; | |
| } | |
| } | |
| server { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| provider "aws" { | |
| region = "${var.region}" | |
| } | |
| resource "aws_ecs_cluster" "ecs_cluster" { | |
| name = "${var.cluster_name}" | |
| } | |
| resource "aws_ecs_task_definition" "task" { | |
| family = "${var.service_name}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # AWS Helpers functions | |
| # | |
| # prerequisites: | |
| # - awscli | |
| # - jq | |
| # parse aws arn | |
| parse_arn() { | |
| echo $1 | sed 's/\"//g;s/^.*\///' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .PHONY : provisioning destroy | |
| SHELL := /bin/bash | |
| # Default commands for Ansible and Terraform using Docker containers | |
| # To use local Ansible and Terraform binaries: make all ANSIBLE_CMD=ansible-playbook TERRAFORM_CMD=terraform | |
| ANSIBLE_CMD := docker run --rm --env="USER_ID=$(shell id -u)" --volume $(shell pwd):/tmp --workdir /tmp ansible/ansible:latest ansible-playbook | |
| TERRAFORM_CMD := docker run --rm --user $(shell id -u) --volume $(shell pwd):/root --workdir /root/ hashicorp/terraform:0.11.11 | |
| # Default region used to launch EC2 instance | |
| region := us-east-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "builders": [{ | |
| "type": "vagrant", | |
| "source_path": "centos/7", | |
| "box_name": "test", | |
| "provider": "virtualbox", | |
| "communicator": "ssh", | |
| "ssh_port": 22, | |
| "ssh_username": "vagrant", | |
| "skip_add": true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - hosts: localhost | |
| vars: | |
| pkg_docker_prerequisites: | |
| - apt-transport-https | |
| - ca-certificates | |
| - curl | |
| - software-properties-common |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| driver: | |
| name: docker | |
| provisioner: | |
| name: ansible_playbook | |
| hosts: localhost | |
| require_ansible_repo: true | |
| ansible_verbose: true | |
| ansible_version: latest |