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
# Create a vpc | |
resource "aws_vpc" "mod" { | |
cidr_block = "${var.cidr}.0.0/16" | |
enable_dns_hostnames = "${var.enable_dns_hostnames}" | |
enable_dns_support = "${var.enable_dns_support}" | |
tags { Name = "${var.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
#!/bin/bash | |
# Usage: ./init.sh | |
# terraform apply -var-file=./dev.tfvars | |
# TODO: figure out how to use the shared variables in dev_variables.tf across modules | |
tf_env="base" | |
terraform remote config -backend=s3 \ | |
-backend-config="bucket=bucketname" \ |
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
## import base state, add routes from dev to base | |
resource "terraform_remote_state" "base_state" { | |
backend = "s3" | |
config { | |
bucket = "${var.tf_s3_bucket}" | |
region = "${var.aws_region}" | |
key = "${var.base_state_file}" | |
} | |
} |
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
DATE = $(shell date) | |
TF_ENV="base" | |
REGION=eu-west-1 | |
TF_BUCKET=bucket-name | |
PLANNED_STATE_FILE=/tmp/${TF_ENV}-planned.terraform | |
all: init get plan apply | |
restart: minidestroy plan apply |
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
resource "aws_instance" "ftp" { | |
ami = "ami-752dbe06" | |
instance_type = "t2.medium" | |
security_groups = ["${aws_security_group.ftp.name}"] | |
user_data = "${file("cloud-config.yml")}" | |
tags { | |
Name = "carsom-ftp-${count.index + 1}" | |
Env = "carsom" | |
role = "ftp" | |
company = "carsom" |
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
#cloud-config | |
# Add groups to the system | |
# groups: | |
# - provision #: [ansible] | |
# ssh-authorized-keys: | |
# - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsHrUUZAfJeaDJ8gnUIMRPRL+r8LLrPV7jNPE8xFl5XUhhFdwCajta4r2nJ2mpkIIRJGJBWijmN7//r9b5H50KxWu6YBlEimtNomczs9oA2ijP0+o7buvx4xiC+pAo/taRz0E/dpd56Ef0qt3610gJe4yDuWlvgP+S1X1FnOcPcDfrCoxyUd5V9kA1G3/p9AjdlGQOGAN9VB0+IlIpN0EP2Vc5O79U0yQIzrEWLUG151/3/Cq3jFKQPeW0n9qQcTzwjwDMWfn8I5nHu+0o+C2QhBwm2TWhjUwl/LjKXzWtsXasDKaE+mnZsDar8SXnH/L9nuTUBVHaKexmSnyKJyPMcy0GfwbqOzDb16Z7xPsqlnohXa7P53QOalfwQjPkwdhCOdrSR0KL6xdUWg3o5EPtPfUPTIJbYj8uj5js+n93UJgQ5yLcGr/sro524tNmox/TTJOWsh5asWQoa5R/GZ1nwPEENeV7/wgeuFwm498JhnTOGpZG5D2dGI2dlo3vGebNQGRoG39+42aQ/jXZNvWvIsEpMJ1b7cDHdX+eV8cdTyWibGl5SN0JK8sUIGtzm0x/QYuih4Mgr2Nh/jxDIzMmm6FEzCIryc00MGTyTJxdtusf5hRRVYLlK1Q7qNN9jAUWspyMgZ6m+0pQEBN4/huCNPKeUstYqql8K1POu4UHqw== Mark Maas Persgroep | |
# Add users to the system. Users are added after groups are added. |
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
#cloud-config | |
ssh_authorized_keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCxT44A9ysynesmkLWRSnlx5gwaD9poG3qE2QW+8KxsoMskqT4Nlb67zcOvw/YU/rbhVeB30eW05Y4oSCUEDlvjLhxDAAdz1fETHBu+uDK1sHG51rVL6yqatR811J47zKgqo6sSxyS4LaWh2Led51NdkdyPsRR+PGacdfV9NY7hopB/aFKEP1xyPGWq837vHKNyNgGixbS+kD+PcM7HBWwMr965zFL44eLMeC1Kw/CJG3mNjKLFGa2nfHMev2C+v6ucIyn534m3HgSI8EKgV8L7sBO76eQ7vyWWZWFXGehJnBvYIx1Pgq1VQS/oHSmHcw5NKflUMASn49N40cSsSLWxioFVjD+bO+LlvQitWJY5Q3MX7CmOuOiNhkCqWWoC1F6qZkGJkVEWjsk0gHofLl8+gIiPkDr9DsQwGmddXrDy66afH8O9WxWqBi/PALOqXxklTGiPYS4MtTjTylmul9sjUAdTLbbHlugqhWMJkbfmsHrll2w6HnpX1A8WWy7OsS6/WkmTzVS8aAlOFzYM2LWOFK0eiK5XT6ytifgZALM5kW2bNt746HLoOzEqmHO3LIu2veO8olJk9S7L6aVTVgaHafxGzVpCEYWxFz2ZurKMbC9It0Wrr/50Y7TkyqQYzE3CJ6LkLnnutFm7eC6wtu/cmqxqpm+zGHbJ3+rs5u+Pw== ansible@servers | |
# Add groups to the system | |
# groups: | |
# - provision #: [ansible] | |
# ssh-authorized-keys: | |
# - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsHrUUZAfJeaDJ8gnUIMRPRL+r8LLrPV7jNPE8xFl5XUhhFdwCajta4r2nJ2mpkIIRJGJBWijmN7//r9b5H50KxWu6YBlEimtNomczs9oA2ij |
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
--- | |
# This playbook patches dirty cow | |
- hosts: all | |
gather_facts: true | |
tasks: | |
- name: Grouping! | |
group_by: | |
key: "{{ ansible_os_family }}" |
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
// This terraform file will setup an autoscaling group for a grafan server | |
// Deciding which AMI to use | |
// aws ec2 describe-images --owners 099720109477 --filters Name=virtualization-type,Values=paravirtual | |
data "aws_ami" "ubuntu" { | |
most_recent = true | |
filter { | |
name = "name" | |
values = ["ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-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
This program may only be used by Maas-Martin B.V. |
OlderNewer