Attempt at migrating to a second entrypoint
Diff
main.tf | 8 +++++++-
timemachine/entrypoint.sh.tpl | 8 ++++++++
timemachine/main.tf | 21 +++++++++++++++++++++
timemachine/variables.tf | 5 +++++
4 files changed, 40 insertions(+), 2 deletions(-)
@@ -26,8 +26,12 @@
}
module "timemachine" {
source = "timemachine"
ips = "${var.ips}"
source = "timemachine"
ips = "${var.ips}"
username-1 = "vikalp"
password-1 = "vikalp"
username-2 = "rishav"
password-2 = "vikalp"
}
module "gitea" {
@@ -1,0 +1,8 @@
#!/bin/bash
set -e
add-account ${username-1} ${password-1} "${username-1}-timemachine" "/timemachine/${username-1}-timemachine" 3000
add-account ${username-2} ${password-2} "${username-2}-timemachine" "/timemachine/${username-2}-timemachine" 3000
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
@@ -28,7 +28,28 @@
ip = "${var.ips["eth0"]}"
}
upload {
content = "${data.template_file.timemachine-entrypoint.rendered}"
file = "/entrypoint-custom.sh"
}
entrypoint = [
"/entrypoint-custom.sh",
]
restart = "unless-stopped"
destroy_grace_seconds = 10
must_run = true
}
data "template_file" "timemachine-entrypoint" {
template = "${file("${path.module}/entrypoint.sh.tpl")}"
vars {
username-1 = "${var.username-1}"
password-1 = "${var.password-1}"
username-2 = "${var.username-2}"
password-2 = "${var.password-2}"
}
}
@@ -1,3 +1,8 @@
variable "ips" {
type = "map"
}
variable "username-1" {}
variable "username-2" {}
variable "password-2" {}
variable "password-1" {}