Hostname should be part of freyfile

This commit is contained in:
Kevin van Zonneveld 2016-09-28 09:39:40 +02:00
parent 4df66415d6
commit 19a6611a89
2 changed files with 7 additions and 17 deletions

View File

@ -33,15 +33,9 @@ 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_instance tusd {
@ -53,13 +47,11 @@ infra resource aws_instance tusd {
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 = "master.tus.io" }
"Name" = "${var.FREY_DOMAIN}"
}
} }
infra resource "aws_route53_record" www { infra resource "aws_route53_record" www {
name = "${var.FREY_DOMAIN}" name = "master.tus.io"
records = ["${aws_instance.tusd.public_dns}"] records = ["${aws_instance.tusd.public_dns}"]
ttl = "300" ttl = "300"
type = "CNAME" type = "CNAME"
@ -110,7 +102,7 @@ install {
} }
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 master.tus.io' dest=/etc/motd owner=root group=root mode=0644 backup=yes"
} }
tasks { tasks {
name = "Common | Set timezone variables" name = "Common | Set timezone variables"
@ -151,7 +143,7 @@ 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 = "master.tus.io"
} }
tasks { tasks {
file = "path=/mnt/tusd-data state=directory owner=www-data group=www-data mode=0755 recurse=yes" file = "path=/mnt/tusd-data state=directory owner=www-data group=www-data mode=0755 recurse=yes"

View File

@ -2,9 +2,7 @@
# So suitable for adding secret keys and such # So suitable for adding secret keys and such
# export DEBUG="frey:*" # export DEBUG="frey:*"
# export FREY_DOMAIN="master.tus.io"
# export FREY_ENCRYPTION_SECRET="***" # export FREY_ENCRYPTION_SECRET="***"
# source env.sh # source env.sh
# travis encrypt --add env.global "FREY_DOMAIN=${FREY_DOMAIN}"
# travis encrypt --add env.global "FREY_ENCRYPTION_SECRET=${FREY_ENCRYPTION_SECRET}" # travis encrypt --add env.global "FREY_ENCRYPTION_SECRET=${FREY_ENCRYPTION_SECRET}"