Playground state

This commit is contained in:
Kevin van Zonneveld 2016-09-28 20:59:31 +02:00
parent db6c11d6f5
commit c0c2c5fea7
6 changed files with 179 additions and 88 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@ data/
.infra/ssh/frey-tusd.pem .infra/ssh/frey-tusd.pem
node_modules/ node_modules/
.DS_Store .DS_Store
.infra/env.devinfra.sh

View File

@ -1,8 +1,8 @@
{ {
"version": 3, "version": 3,
"terraform_version": "0.7.3", "terraform_version": "0.7.3",
"serial": 28, "serial": 5,
"lineage": "deedcad1-a3e9-4e02-9135-c347bbbe0be0", "lineage": "317b7812-b33a-495e-b08e-0021be934e90",
"modules": [ "modules": [
{ {
"path": [ "path": [
@ -12,56 +12,77 @@
"endpoint": { "endpoint": {
"sensitive": false, "sensitive": false,
"type": "string", "type": "string",
"value": "http://master.tus.io:80/" "value": "http://tus.transloadit.academy:80/"
}, },
"public_address": { "public_address": {
"sensitive": false, "sensitive": false,
"type": "string", "type": "string",
"value": "ec2-54-166-147-2.compute-1.amazonaws.com" "value": "ec2-52-201-254-175.compute-1.amazonaws.com"
}, },
"public_addresses": { "public_addresses": {
"sensitive": false, "sensitive": false,
"type": "string", "type": "string",
"value": "ec2-54-166-147-2.compute-1.amazonaws.com" "value": "ec2-52-201-254-175.compute-1.amazonaws.com"
} }
}, },
"resources": { "resources": {
"aws_instance.tusd": { "aws_instance.tusd": {
"type": "aws_instance", "type": "aws_instance",
"depends_on": [], "depends_on": [
"aws_key_pair.infra-tusd"
],
"primary": { "primary": {
"id": "i-16ef798d", "id": "i-05b661e26171f3070",
"attributes": { "attributes": {
"ami": "ami-9bce7af0", "ami": "ami-8fe79998",
"availability_zone": "us-east-1d", "availability_zone": "us-east-1d",
"disable_api_termination": "false", "disable_api_termination": "false",
"ebs_block_device.#": "0", "ebs_block_device.#": "0",
"ebs_optimized": "false", "ebs_optimized": "false",
"ephemeral_block_device.#": "0", "ephemeral_block_device.#": "0",
"iam_instance_profile": "", "iam_instance_profile": "",
"id": "i-16ef798d", "id": "i-05b661e26171f3070",
"instance_state": "running", "instance_state": "running",
"instance_type": "c3.large", "instance_type": "t2.micro",
"key_name": "infra-tusd", "key_name": "infra-tusd",
"monitoring": "false", "monitoring": "false",
"network_interface_id": "", "network_interface_id": "eni-46d66d40",
"private_dns": "ip-10-99-128-27.ec2.internal", "private_dns": "ip-172-31-14-111.ec2.internal",
"private_ip": "10.99.128.27", "private_ip": "172.31.14.111",
"public_dns": "ec2-54-166-147-2.compute-1.amazonaws.com", "public_dns": "ec2-52-201-254-175.compute-1.amazonaws.com",
"public_ip": "54.166.147.2", "public_ip": "52.201.254.175",
"root_block_device.#": "1", "root_block_device.#": "1",
"root_block_device.0.delete_on_termination": "true", "root_block_device.0.delete_on_termination": "true",
"root_block_device.0.iops": "100", "root_block_device.0.iops": "100",
"root_block_device.0.volume_size": "8", "root_block_device.0.volume_size": "8",
"root_block_device.0.volume_type": "gp2", "root_block_device.0.volume_type": "gp2",
"security_groups.#": "1", "security_groups.#": "0",
"security_groups.1898427277": "fw-tusd-main",
"source_dest_check": "true", "source_dest_check": "true",
"subnet_id": "", "subnet_id": "subnet-1adf3953",
"tags.%": "1", "tags.%": "1",
"tags.Name": "master.tus.io", "tags.Name": "tus.transloadit.academy",
"tenancy": "default", "tenancy": "default",
"vpc_security_group_ids.#": "0" "vpc_security_group_ids.#": "1",
"vpc_security_group_ids.977706528": "sg-efcac894"
},
"meta": {
"schema_version": "1"
},
"tainted": false
},
"deposed": [],
"provider": ""
},
"aws_key_pair.infra-tusd": {
"type": "aws_key_pair",
"depends_on": [],
"primary": {
"id": "infra-tusd",
"attributes": {
"fingerprint": "c8:2d:93:d0:0a:71:c1:e2:c7:43:37:a9:e4:78:03:4c",
"id": "infra-tusd",
"key_name": "infra-tusd",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDb0fMw6fF2ct31UvChO/r17kXAn6AdPS0TLl4QZauvnEd1jyCekxCwJ3ApafapiQo/Z29zy3Uz0KQxvHvMNaYq6JY4qEyfQIlEhBRjrMlQKvNnQcFlX5ETSy6r8qPhYi2ly0GWB17Er5t2UMt2yKQrcPCWGNy0zOIjymdTdWaQlcjO/76XJr64790Y0+BfLyxPkZ0z39EM/9crLdpUq4SMAyup/mKG5daQbh/MpYEoXe6oyHVK/z1aESBO7EAKnoGauHXgzNYGTxqFnzjU/srmKUY/vR2GAqFqZYweZyNiAuhQ5jfkciGSSR2UeMXZ/y3XI8ATQQJJOnrY2OQ9WKKh kvz@tusd.freyproject.io"
}, },
"meta": { "meta": {
"schema_version": "1" "schema_version": "1"
@ -77,18 +98,18 @@
"aws_instance.tusd" "aws_instance.tusd"
], ],
"primary": { "primary": {
"id": "Z3IT8X6U91XY1P_master.tus.io_CNAME", "id": "Z3V9RXR2M8085J_tus.transloadit.academy_CNAME",
"attributes": { "attributes": {
"fqdn": "master.tus.io", "fqdn": "tus.transloadit.academy",
"health_check_id": "", "health_check_id": "",
"id": "Z3IT8X6U91XY1P_master.tus.io_CNAME", "id": "Z3V9RXR2M8085J_tus.transloadit.academy_CNAME",
"name": "master.tus.io", "name": "tus.transloadit.academy",
"records.#": "1", "records.#": "1",
"records.3871998453": "ec2-54-166-147-2.compute-1.amazonaws.com", "records.3180824470": "ec2-52-201-254-175.compute-1.amazonaws.com",
"set_identifier": "", "set_identifier": "",
"ttl": "300", "ttl": "300",
"type": "CNAME", "type": "CNAME",
"zone_id": "Z3IT8X6U91XY1P" "zone_id": "Z3V9RXR2M8085J"
}, },
"meta": { "meta": {
"schema_version": "2" "schema_version": "2"
@ -98,15 +119,23 @@
"deposed": [], "deposed": [],
"provider": "" "provider": ""
}, },
"aws_security_group.fw-tusd-main": { "aws_security_group.fw-tusd": {
"type": "aws_security_group", "type": "aws_security_group",
"depends_on": [], "depends_on": [],
"primary": { "primary": {
"id": "sg-60cc290d", "id": "sg-29386d53",
"attributes": { "attributes": {
"description": "Infra tusd", "description": "Infra tusd",
"egress.#": "0", "egress.#": "1",
"id": "sg-60cc290d", "egress.482069346.cidr_blocks.#": "1",
"egress.482069346.cidr_blocks.0": "0.0.0.0/0",
"egress.482069346.from_port": "0",
"egress.482069346.prefix_list_ids.#": "0",
"egress.482069346.protocol": "-1",
"egress.482069346.security_groups.#": "0",
"egress.482069346.self": "false",
"egress.482069346.to_port": "0",
"id": "sg-29386d53",
"ingress.#": "3", "ingress.#": "3",
"ingress.2214680975.cidr_blocks.#": "1", "ingress.2214680975.cidr_blocks.#": "1",
"ingress.2214680975.cidr_blocks.0": "0.0.0.0/0", "ingress.2214680975.cidr_blocks.0": "0.0.0.0/0",
@ -129,10 +158,10 @@
"ingress.516175195.security_groups.#": "0", "ingress.516175195.security_groups.#": "0",
"ingress.516175195.self": "false", "ingress.516175195.self": "false",
"ingress.516175195.to_port": "8080", "ingress.516175195.to_port": "8080",
"name": "fw-tusd-main", "name": "fw-tusd",
"owner_id": "402421253186", "owner_id": "618066538640",
"tags.%": "0", "tags.%": "0",
"vpc_id": "" "vpc_id": "vpc-cea030a9"
}, },
"meta": {}, "meta": {},
"tainted": false "tainted": false

View File

@ -1,8 +1,8 @@
{ {
"version": 3, "version": 3,
"terraform_version": "0.7.3", "terraform_version": "0.7.3",
"serial": 28, "serial": 5,
"lineage": "deedcad1-a3e9-4e02-9135-c347bbbe0be0", "lineage": "317b7812-b33a-495e-b08e-0021be934e90",
"modules": [ "modules": [
{ {
"path": [ "path": [
@ -12,56 +12,77 @@
"endpoint": { "endpoint": {
"sensitive": false, "sensitive": false,
"type": "string", "type": "string",
"value": "http://master.tus.io:80/" "value": "http://tus.transloadit.academy:80/"
}, },
"public_address": { "public_address": {
"sensitive": false, "sensitive": false,
"type": "string", "type": "string",
"value": "ec2-54-166-147-2.compute-1.amazonaws.com" "value": "ec2-52-201-254-175.compute-1.amazonaws.com"
}, },
"public_addresses": { "public_addresses": {
"sensitive": false, "sensitive": false,
"type": "string", "type": "string",
"value": "ec2-54-166-147-2.compute-1.amazonaws.com" "value": "ec2-52-201-254-175.compute-1.amazonaws.com"
} }
}, },
"resources": { "resources": {
"aws_instance.tusd": { "aws_instance.tusd": {
"type": "aws_instance", "type": "aws_instance",
"depends_on": [], "depends_on": [
"aws_key_pair.infra-tusd"
],
"primary": { "primary": {
"id": "i-16ef798d", "id": "i-05b661e26171f3070",
"attributes": { "attributes": {
"ami": "ami-9bce7af0", "ami": "ami-8fe79998",
"availability_zone": "us-east-1d", "availability_zone": "us-east-1d",
"disable_api_termination": "false", "disable_api_termination": "false",
"ebs_block_device.#": "0", "ebs_block_device.#": "0",
"ebs_optimized": "false", "ebs_optimized": "false",
"ephemeral_block_device.#": "0", "ephemeral_block_device.#": "0",
"iam_instance_profile": "", "iam_instance_profile": "",
"id": "i-16ef798d", "id": "i-05b661e26171f3070",
"instance_state": "running", "instance_state": "running",
"instance_type": "c3.large", "instance_type": "t2.micro",
"key_name": "infra-tusd", "key_name": "infra-tusd",
"monitoring": "false", "monitoring": "false",
"network_interface_id": "", "network_interface_id": "eni-46d66d40",
"private_dns": "ip-10-99-128-27.ec2.internal", "private_dns": "ip-172-31-14-111.ec2.internal",
"private_ip": "10.99.128.27", "private_ip": "172.31.14.111",
"public_dns": "ec2-54-166-147-2.compute-1.amazonaws.com", "public_dns": "ec2-52-201-254-175.compute-1.amazonaws.com",
"public_ip": "54.166.147.2", "public_ip": "52.201.254.175",
"root_block_device.#": "1", "root_block_device.#": "1",
"root_block_device.0.delete_on_termination": "true", "root_block_device.0.delete_on_termination": "true",
"root_block_device.0.iops": "100", "root_block_device.0.iops": "100",
"root_block_device.0.volume_size": "8", "root_block_device.0.volume_size": "8",
"root_block_device.0.volume_type": "gp2", "root_block_device.0.volume_type": "gp2",
"security_groups.#": "1", "security_groups.#": "0",
"security_groups.1898427277": "fw-tusd-main",
"source_dest_check": "true", "source_dest_check": "true",
"subnet_id": "", "subnet_id": "subnet-1adf3953",
"tags.%": "1", "tags.%": "1",
"tags.Name": "master.tus.io", "tags.Name": "tus.transloadit.academy",
"tenancy": "default", "tenancy": "default",
"vpc_security_group_ids.#": "0" "vpc_security_group_ids.#": "1",
"vpc_security_group_ids.977706528": "sg-efcac894"
},
"meta": {
"schema_version": "1"
},
"tainted": false
},
"deposed": [],
"provider": ""
},
"aws_key_pair.infra-tusd": {
"type": "aws_key_pair",
"depends_on": [],
"primary": {
"id": "infra-tusd",
"attributes": {
"fingerprint": "c8:2d:93:d0:0a:71:c1:e2:c7:43:37:a9:e4:78:03:4c",
"id": "infra-tusd",
"key_name": "infra-tusd",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDb0fMw6fF2ct31UvChO/r17kXAn6AdPS0TLl4QZauvnEd1jyCekxCwJ3ApafapiQo/Z29zy3Uz0KQxvHvMNaYq6JY4qEyfQIlEhBRjrMlQKvNnQcFlX5ETSy6r8qPhYi2ly0GWB17Er5t2UMt2yKQrcPCWGNy0zOIjymdTdWaQlcjO/76XJr64790Y0+BfLyxPkZ0z39EM/9crLdpUq4SMAyup/mKG5daQbh/MpYEoXe6oyHVK/z1aESBO7EAKnoGauHXgzNYGTxqFnzjU/srmKUY/vR2GAqFqZYweZyNiAuhQ5jfkciGSSR2UeMXZ/y3XI8ATQQJJOnrY2OQ9WKKh kvz@tusd.freyproject.io"
}, },
"meta": { "meta": {
"schema_version": "1" "schema_version": "1"
@ -77,18 +98,18 @@
"aws_instance.tusd" "aws_instance.tusd"
], ],
"primary": { "primary": {
"id": "Z3IT8X6U91XY1P_master.tus.io_CNAME", "id": "Z3V9RXR2M8085J_tus.transloadit.academy_CNAME",
"attributes": { "attributes": {
"fqdn": "master.tus.io", "fqdn": "tus.transloadit.academy",
"health_check_id": "", "health_check_id": "",
"id": "Z3IT8X6U91XY1P_master.tus.io_CNAME", "id": "Z3V9RXR2M8085J_tus.transloadit.academy_CNAME",
"name": "master.tus.io", "name": "tus.transloadit.academy",
"records.#": "1", "records.#": "1",
"records.3871998453": "ec2-54-166-147-2.compute-1.amazonaws.com", "records.3180824470": "ec2-52-201-254-175.compute-1.amazonaws.com",
"set_identifier": "", "set_identifier": "",
"ttl": "300", "ttl": "300",
"type": "CNAME", "type": "CNAME",
"zone_id": "Z3IT8X6U91XY1P" "zone_id": "Z3V9RXR2M8085J"
}, },
"meta": { "meta": {
"schema_version": "2" "schema_version": "2"
@ -98,15 +119,23 @@
"deposed": [], "deposed": [],
"provider": "" "provider": ""
}, },
"aws_security_group.fw-tusd-main": { "aws_security_group.fw-tusd": {
"type": "aws_security_group", "type": "aws_security_group",
"depends_on": [], "depends_on": [],
"primary": { "primary": {
"id": "sg-60cc290d", "id": "sg-29386d53",
"attributes": { "attributes": {
"description": "Infra tusd", "description": "Infra tusd",
"egress.#": "0", "egress.#": "1",
"id": "sg-60cc290d", "egress.482069346.cidr_blocks.#": "1",
"egress.482069346.cidr_blocks.0": "0.0.0.0/0",
"egress.482069346.from_port": "0",
"egress.482069346.prefix_list_ids.#": "0",
"egress.482069346.protocol": "-1",
"egress.482069346.security_groups.#": "0",
"egress.482069346.self": "false",
"egress.482069346.to_port": "0",
"id": "sg-29386d53",
"ingress.#": "3", "ingress.#": "3",
"ingress.2214680975.cidr_blocks.#": "1", "ingress.2214680975.cidr_blocks.#": "1",
"ingress.2214680975.cidr_blocks.0": "0.0.0.0/0", "ingress.2214680975.cidr_blocks.0": "0.0.0.0/0",
@ -129,10 +158,10 @@
"ingress.516175195.security_groups.#": "0", "ingress.516175195.security_groups.#": "0",
"ingress.516175195.self": "false", "ingress.516175195.self": "false",
"ingress.516175195.to_port": "8080", "ingress.516175195.to_port": "8080",
"name": "fw-tusd-main", "name": "fw-tusd",
"owner_id": "402421253186", "owner_id": "618066538640",
"tags.%": "0", "tags.%": "0",
"vpc_id": "" "vpc_id": "vpc-cea030a9"
}, },
"meta": {}, "meta": {},
"tainted": false "tainted": false

View File

@ -24,7 +24,7 @@ infra variable {
amis { amis {
type = "map" type = "map"
default { default {
"us-east-1" = "ami-9bce7af0" "us-east-1" = "ami-8fe79998"
} }
} }
region { region {
@ -33,32 +33,34 @@ infra variable {
} }
infra output { infra output {
public_address { public_address { value = "${aws_instance.tusd.0.public_dns}" }
value = "${aws_instance.tusd.0.public_dns}" public_addresses { value = "${join("\n", aws_instance.tusd.*.public_dns)}" }
} endpoint { value = "http://${aws_route53_record.www.name}:80/" }
public_addresses {
value = "${join("\n", aws_instance.tusd.*.public_dns)}"
}
endpoint {
value = "http://${aws_route53_record.www.name}:80/"
}
} }
infra resource aws_instance tusd { infra resource aws_key_pair "infra-tusd" {
ami = "${lookup(var.amis, var.region)}" key_name = "infra-tusd"
instance_type = "c3.large" public_key = "${file("{{{config.global.ssh.publickey_file}}}")}"
key_name = "infra-tusd" }
security_groups = ["fw-tusd-main"]
infra resource aws_instance "tusd" {
ami = "${lookup(var.amis, var.region)}"
instance_type = "t2.micro"
key_name = "${aws_key_pair.infra-tusd.key_name}"
// vpc_security_group_ids = ["aws_security_group.fw-tusd.id"]
subnet_id = "subnet-1adf3953"
connection { connection {
key_file = "{{{config.global.ssh.privatekey_file}}}" key_file = "{{{config.global.ssh.privatekey_file}}}"
user = "{{{config.global.ssh.user}}}" user = "{{{config.global.ssh.user}}}"
} }
tags { tags {
"Name" = "${var.FREY_DOMAIN}" Name = "${var.FREY_DOMAIN}"
} }
} }
infra resource "aws_route53_record" www { infra resource aws_route53_record "www" {
name = "${var.FREY_DOMAIN}" name = "${var.FREY_DOMAIN}"
records = ["${aws_instance.tusd.public_dns}"] records = ["${aws_instance.tusd.public_dns}"]
ttl = "300" ttl = "300"
@ -66,57 +68,76 @@ infra resource "aws_route53_record" www {
zone_id = "${var.FREY_AWS_ZONE_ID}" zone_id = "${var.FREY_AWS_ZONE_ID}"
} }
infra resource aws_security_group "fw-tusd-main" { infra resource aws_security_group "fw-tusd" {
description = "Infra tusd" description = "Infra tusd"
name = "fw-tusd-main" name = "fw-tusd"
vpc_id = "vpc-cea030a9"
ingress { ingress {
cidr_blocks = ["0.0.0.0/0"] cidr_blocks = ["0.0.0.0/0"]
from_port = 8080
protocol = "tcp" protocol = "tcp"
from_port = 8080
to_port = 8080 to_port = 8080
} }
ingress { ingress {
cidr_blocks = ["0.0.0.0/0"] cidr_blocks = ["0.0.0.0/0"]
from_port = 80
protocol = "tcp" protocol = "tcp"
from_port = 80
to_port = 80 to_port = 80
} }
ingress { ingress {
cidr_blocks = ["0.0.0.0/0"] cidr_blocks = ["0.0.0.0/0"]
from_port = 22
protocol = "tcp" protocol = "tcp"
from_port = 22
to_port = 22 to_port = 22
} }
// This is for outbound internet access
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = [ "0.0.0.0/0" ]
}
} }
install { install {
playbooks { playbooks {
hosts = "tusd" hosts = "tusd"
name = "Install tusd" name = "Install tusd"
roles { roles {
role = "{{{init.paths.roles_dir}}}/apt/v1.0.0" role = "{{{init.paths.roles_dir}}}/apt/v1.0.0"
apt_packages = ["apg", "build-essential", "curl", "git-core", "htop", "iotop", "libpcre3", "logtail", "mlocate", "mtr", "psmisc", "telnet", "vim", "wget"] apt_packages = ["apg", "build-essential", "curl", "git-core", "htop", "iotop", "libpcre3", "logtail", "mlocate", "mtr", "psmisc", "telnet", "vim", "wget"]
} }
roles { roles {
role = "{{{init.paths.roles_dir}}}/unattended-upgrades/v1.2.0" role = "{{{init.paths.roles_dir}}}/unattended-upgrades/v1.2.0"
} }
tasks { tasks {
lineinfile = "dest=/home/{{{config.global.ssh.user}}}/.bashrc line=\"alias wtf='sudo tail -f /var/log/*{log,err} /var/log/{dmesg,messages,*{,/*}{log,err}}'\" owner={{{config.global.ssh.user}}} group={{{config.global.ssh.user}}} mode=0644 backup=yes" lineinfile = "dest=/home/{{{config.global.ssh.user}}}/.bashrc line=\"alias wtf='sudo tail -f /var/log/*{log,err} /var/log/{dmesg,messages,*{,/*}{log,err}}'\" owner={{{config.global.ssh.user}}} group={{{config.global.ssh.user}}} mode=0644 backup=yes"
name = "Common | Add convenience shortcut wtf" name = "Common | Add convenience shortcut wtf"
} }
tasks { tasks {
lineinfile = "dest=/home/{{{config.global.ssh.user}}}/.bashrc line=\"cd {{{config.global.approot}}}/current || true\" owner={{{config.global.ssh.user}}} group={{{config.global.ssh.user}}} mode=0644 backup=yes" lineinfile = "dest=/home/{{{config.global.ssh.user}}}/.bashrc line=\"cd {{{config.global.approot}}}/current || true\" owner={{{config.global.ssh.user}}} group={{{config.global.ssh.user}}} mode=0644 backup=yes"
name = "Common | Install login" name = "Common | Install login"
} }
tasks { tasks {
name = "Common | Set motd" name = "Common | Set motd"
copy = "content='Welcome to {{lookup('env', 'FREY_DOMAIN')}}' dest=/etc/motd owner=root group=root mode=0644 backup=yes" copy = "content='Welcome to {{lookup('env', 'FREY_DOMAIN')}}' dest=/etc/motd owner=root group=root mode=0644 backup=yes"
} }
tasks { tasks {
name = "Common | Set timezone variables" name = "Common | Set timezone variables"
copy = "content='Etc/UTC' dest=/etc/timezone owner=root group=root mode=0644 backup=yes" copy = "content='Etc/UTC' dest=/etc/timezone owner=root group=root mode=0644 backup=yes"
notify = ["Common | Update timezone"] notify = ["Common | Update timezone"]
} }
handlers { handlers {
name = "Common | Update timezone" name = "Common | Update timezone"
command = "dpkg-reconfigure --frontend noninteractive tzdata" command = "dpkg-reconfigure --frontend noninteractive tzdata"
@ -128,6 +149,7 @@ setup {
playbooks { playbooks {
hosts = "tusd" hosts = "tusd"
name = "Setup tusd" name = "Setup tusd"
roles { roles {
role = "{{{init.paths.roles_dir}}}/upstart/v1.0.0" role = "{{{init.paths.roles_dir}}}/upstart/v1.0.0"
upstart_command = "./tusd -port=8080 -dir=/mnt/tusd-data -store-size=10737418240" upstart_command = "./tusd -port=8080 -dir=/mnt/tusd-data -store-size=10737418240"
@ -139,6 +161,7 @@ setup {
upstart_runtime_root = "{{{config.global.approot}}}/current/tusd_linux_amd64" upstart_runtime_root = "{{{config.global.approot}}}/current/tusd_linux_amd64"
upstart_user = "www-data" upstart_user = "www-data"
} }
roles { roles {
role = "{{{init.paths.roles_dir}}}/rsyslog/v3.0.1" role = "{{{init.paths.roles_dir}}}/rsyslog/v3.0.1"
rsyslog_rsyslog_d_files "49-tusd" { rsyslog_rsyslog_d_files "49-tusd" {
@ -149,14 +172,17 @@ setup {
} }
} }
} }
roles { roles {
role = "{{{init.paths.roles_dir}}}/fqdn/v1.0.0" role = "{{{init.paths.roles_dir}}}/fqdn/v1.0.0"
fqdn = "{{lookup('env', 'FREY_DOMAIN')}}" fqdn = "{{lookup('env', 'FREY_DOMAIN')}}"
} }
tasks { tasks {
file = "path=/mnt/tusd-data state=directory owner=www-data group=ubuntu mode=ug+rwX,o= recurse=yes" file = "path=/mnt/tusd-data state=directory owner=www-data group=ubuntu mode=ug+rwX,o= recurse=yes"
name = "tusd | Create tusd data dir" name = "tusd | Create tusd data dir"
} }
tasks { tasks {
name = "tusd | Create purger crontab (clean up >24h (1400minutes) files)" name = "tusd | Create purger crontab (clean up >24h (1400minutes) files)"
cron { cron {
@ -172,6 +198,7 @@ deploy {
playbooks { playbooks {
hosts = "tusd" hosts = "tusd"
name = "Deploy tusd" name = "Deploy tusd"
roles { roles {
role = "{{{init.paths.roles_dir}}}/deploy/v1.4.0" role = "{{{init.paths.roles_dir}}}/deploy/v1.4.0"
ansistrano_get_url = "https://github.com/tus/tusd/releases/download/0.5.2/tusd_linux_amd64.tar.gz" ansistrano_get_url = "https://github.com/tus/tusd/releases/download/0.5.2/tusd_linux_amd64.tar.gz"
@ -179,6 +206,7 @@ deploy {
ansistrano_deploy_via = "download_unarchive" ansistrano_deploy_via = "download_unarchive"
ansistrano_group = "ubuntu" ansistrano_group = "ubuntu"
} }
tasks { tasks {
name = "tusd | Set file attributes" name = "tusd | Set file attributes"
file = "path={{{config.global.approot}}}/current/tusd_linux_amd64/tusd mode=0755 owner=www-data group=www-data" file = "path={{{config.global.approot}}}/current/tusd_linux_amd64/tusd mode=0755 owner=www-data group=www-data"
@ -190,10 +218,12 @@ restart {
playbooks { playbooks {
hosts = "tusd" hosts = "tusd"
name = "Restart tusd" name = "Restart tusd"
tasks { tasks {
shell = "iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080" shell = "iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080"
name = "tusd | Redirect HTTP traffic to tusd" name = "tusd | Redirect HTTP traffic to tusd"
} }
tasks { tasks {
action = "service name=tusd state=restarted" action = "service name=tusd state=restarted"
name = "tusd | Restart" name = "tusd | Restart"

Binary file not shown.

View File

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDb0fMw6fF2ct31UvChO/r17kXAn6AdPS0TLl4QZauvnEd1jyCekxCwJ3ApafapiQo/Z29zy3Uz0KQxvHvMNaYq6JY4qEyfQIlEhBRjrMlQKvNnQcFlX5ETSy6r8qPhYi2ly0GWB17Er5t2UMt2yKQrcPCWGNy0zOIjymdTdWaQlcjO/76XJr64790Y0+BfLyxPkZ0z39EM/9crLdpUq4SMAyup/mKG5daQbh/MpYEoXe6oyHVK/z1aESBO7EAKnoGauHXgzNYGTxqFnzjU/srmKUY/vR2GAqFqZYweZyNiAuhQ5jfkciGSSR2UeMXZ/y3XI8ATQQJJOnrY2OQ9WKKh kvz@tusd.freyproject.io