Compare commits

...

1 Commits

Author SHA1 Message Date
Nemo fa787e084a files in airsonic 2019-02-19 00:38:48 +05:30
5 changed files with 32 additions and 26 deletions

11
main.tf
View File

@ -67,11 +67,12 @@ module "resilio" {
} }
module "media" { module "media" {
source = "media" source = "media"
domain = "bb8.fun" domain = "bb8.fun"
traefik-labels = "${var.traefik-common-labels}" traefik-labels = "${var.traefik-common-labels}"
ips = "${var.ips}" ips = "${var.ips}"
traefik-network-id = "${module.docker.traefik-network-id}" traefik-network-id = "${module.docker.traefik-network-id}"
airsonic-smtp-password = "notvalid"
} }
module "monitoring" { module "monitoring" {

View File

@ -4,7 +4,8 @@ module "airsonic" {
name = "airsonic" name = "airsonic"
resource { resource {
memory = "1024" memory = "1024"
memory_swap = "1024"
} }
web { web {
@ -25,16 +26,16 @@ module "airsonic" {
container_path = "/dev/snd" container_path = "/dev/snd"
}] }]
# files = [ uploads = [
# "/usr/lib/jvm/java-1.8-openjdk/jre/lib/airsonic.properties", {
# "/usr/lib/jvm/java-1.8-openjdk/jre/lib/sound.properties", content = "${data.template_file.airsonic-properties-file.rendered}"
# ] file = "/usr/lib/jvm/java-1.8-openjdk/jre/lib/airsonic.properties"
},
{
# contents = [ content = "${file("${path.module}/conf/airsonic.sound.properties")}"
# "${data.template_file.airsonic-properties-file.rendered}", file = "/usr/lib/jvm/java-1.8-openjdk/jre/lib/sound.properties"
# "${file("${path.module}/conf/airsonic.sound.properties")}", },
# ] ]
volumes = [ volumes = [
{ {
@ -60,15 +61,12 @@ module "airsonic" {
] ]
} }
# data "template_file" "airsonic-properties-file" { data "template_file" "airsonic-properties-file" {
# template = "${file("${path.module}/conf/airsonic.properties.tpl")}" template = "${file("${path.module}/conf/airsonic.properties.tpl")}"
vars {
smtp-password = "${var.airsonic-smtp-password}"
# vars { # db-password = "${var.airsonic-db-password}"
# smtp-password = "${var.airsonic-smtp-password}" }
}
# # db-password = "${var.airsonic-db-password}"
# }
# }

View File

@ -18,3 +18,4 @@ variable "ips" {
} }
variable "traefik-network-id" {} variable "traefik-network-id" {}
variable "airsonic-smtp-password" {}

View File

@ -23,6 +23,8 @@ resource "docker_container" "container" {
network_mode = "bridge" network_mode = "bridge"
upload = ["${var.uploads}"]
// Only attach the traefik network if // Only attach the traefik network if
// service is exposed to the web // service is exposed to the web
networks = ["${concat(var.networks,compact(split(",",lookup(var.web, "expose", "false") == "false" ? "" :"${data.docker_network.traefik.id}")))}"] networks = ["${concat(var.networks,compact(split(",",lookup(var.web, "expose", "false") == "false" ? "" :"${data.docker_network.traefik.id}")))}"]

View File

@ -94,3 +94,7 @@ variable "devices" {
type = "list" type = "list"
default = [] default = []
} }
variable "uploads" {
default = []
}