Lychee #6

Merged
nemo merged 5 commits from lychee into master 2017-12-28 19:06:55 +00:00
5 changed files with 60 additions and 33 deletions
Showing only changes of commit 7adef5e80d - Show all commits

View File

@ -30,12 +30,22 @@ resource "docker_container" "mariadb" {
host_path = "${docker_volume.mariadb_volume.mountpoint}"
}
// This is so that other host-only services can share this
ports {
internal = 3306
external = 3306
ip = "${var.ips["eth0"]}"
}
// This is a not-so-great idea
// TODO: Figure out a better way to make terraform SSH and then connect to localhost
ports {
internal = 3306
external = 3306
ip = "${var.ips["tun0"]}"
}
memory = 512
restart = "unless-stopped"
destroy_grace_seconds = 10

View File

@ -28,10 +28,13 @@ resource "docker_container" "lychee" {
"traefik.frontend.headers.customFrameOptionsValue" = "${var.xfo_allow}"
"traefik.frontend.auth.basic" = "${var.basic_auth}"
"traefik.frontend.headers.customResponseHeaders" = "${var.xpoweredby}"
"traefik.frontend.rule" = "Host:airsonic.in.${var.domain},airsonic.${var.domain}"
}
env = [
"PUID=986",
"PGID=984",
]
links = ["mariadb"]
}

10
main.tf
View File

@ -1,13 +1,3 @@
provider "docker" {
host = "tcp://docker.vpn.bb8.fun:2376"
cert_path = "./secrets"
}
provider "cloudflare" {
email = "bb8@captnemo.in"
token = "${var.cloudflare_key}"
}
module "cloudflare" {
source = "cloudflare"
domain = "bb8.fun"

View File

@ -1,25 +1,34 @@
# # This is pending on https://github.com/hashicorp/go-version/pull/34
# provider "mysql" {
# endpoint = "docker.in.captnemo.in:3306"
# username = "root"
# password = "${var.mysql_root_password}"
# }
# # Create a Database
# resource "mysql_database" "kodi" {
# name = "kodi"
# lifecycle {
# prevent_destroy = true
# }
# }
# resource "mysql_user" "kodi" {
# user = "kodi"
# host = "127.0.0.1"
# plaintext_password = "testing"
# }
# resource "mysql_grant" "kodi" {
# user = "${mysql_user.kodi.user}"
# host = "${mysql_user.kodi.host}"
# database = "kodi"
# privileges = ["SUPER"]
# }
# Create a Database
resource "mysql_database" "kodi" {
name = "kodi"
lifecycle {
prevent_destroy = true
}
}
resource "mysql_user" "kodi" {
user = "kodi"
plaintext_password = "testing"
}
resource "mysql_grant" "kodi" {
user = "${mysql_user.kodi.user}"
host = "${mysql_user.kodi.host}"
database = "kodi"
privileges = ["SUPER"]
}
resource "mysql_user" "lychee" {
user = "lychee"
plaintext_password = "testing"
}
resource "mysql_grant" "lychee" {
user = "${mysql_user.lychee.user}"
host = "${mysql_user.lychee.host}"
database = "lychee"
privileges = ["SUPER"]
}

15
providers.tf Normal file
View File

@ -0,0 +1,15 @@
provider "docker" {
host = "tcp://docker.vpn.bb8.fun:2376"
cert_path = "./secrets"
}
provider "cloudflare" {
email = "bb8@captnemo.in"
token = "${var.cloudflare_key}"
}
provider "mysql" {
endpoint = "mysql.vpn.bb8.fun:3306"
username = "root"
password = "${var.mysql_root_password}"
}