From 8e52d6a0014e1987611b5a1f9fb911b79ddf7f9d Mon Sep 17 00:00:00 2001 From: yann degat Date: Mon, 16 Mar 2020 15:02:28 +0000 Subject: [PATCH] fix auto provisionning --- .gitignore | 3 ++- main.tf | 2 +- provision.sh | 37 ++++++++++++++++++++++++++----------- variables.tf | 5 +++++ 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 7d5de99..2e4edf4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ +live/* clouds.yaml .terraform terraform.tfstate -.terragrunt-cache \ No newline at end of file +.terragrunt-cache diff --git a/main.tf b/main.tf index b1e9d52..aef526a 100644 --- a/main.tf +++ b/main.tf @@ -86,7 +86,7 @@ locals { ][0] ip_parts = split(".", local.jitsi) - fqdn = format("ip%s.ip-%s-%s-%s.eu", local.ip_parts[3], local.ip_parts[0], local.ip_parts[1], local.ip_parts[2]) + fqdn = var.fqdn != "" ? var.fqdn : format("ip%s.ip-%s-%s-%s.eu", local.ip_parts[3], local.ip_parts[0], local.ip_parts[1], local.ip_parts[2]) user_data = { hostname = local.fqdn diff --git a/provision.sh b/provision.sh index 42f5892..1deb2af 100644 --- a/provision.sh +++ b/provision.sh @@ -14,18 +14,33 @@ sudo apt-get -y update #first install with a self signed cert. then restart with letsencrypt cat > /tmp/jitsi.seeds <