Simply run vagrant up
and the 3 mongo instances will be deployed and register in replica set
This file contains 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
const https = require('https'); | |
const fs = require('fs'); | |
// Read environment variables | |
function getEnvVar(name) { | |
if (name in process.env) { | |
return process.env[name] | |
} else { | |
throw new Error(name + ' environment variable is missing') | |
} |
This file contains 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 |
This file contains 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 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 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 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 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 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 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 |
NewerOlder