Skip to content

Instantly share code, notes, and snippets.

@invidian
Created May 24, 2019 10:53
Show Gist options
  • Save invidian/3a250ceaa5be47128c78ee362d8552fb to your computer and use it in GitHub Desktop.
Save invidian/3a250ceaa5be47128c78ee362d8552fb to your computer and use it in GitHub Desktop.
Quality formatting improvement with terraform 0.12upgrade
provisioner "file" {
@@ -115,96 +115,150 @@ Name = ${element(null_resource.server_names_tinc.*.triggers.name, count.index)}
Device = /dev/net/tun
AddressFamily = ipv4
BindToAddress = ${element(hcloud_server.servers.*.ipv4_address, count.index)}
-${replace(join("\n", formatlist("ConnectTo = %s", split(" ", replace(replace(replace(replace(replace(replace(join(",", null_resource.server_names.*.triggers.name), element(null_resource.server_names.*.triggers.name, count.index), ""), ",,", ","), ".${var.domain}", ""), "-", "_"), ",", " "), "/(^ | $)/", "")))), "/^ConnectTo = $/", "")}
+${replace(
+join(
+"\n",
+formatlist(
+"ConnectTo = %s",
+split(
+" ",
+replace(
+replace(
+replace(
+replace(
+replace(
+replace(
+join(",", null_resource.server_names.*.triggers.name),
+element(null_resource.server_names.*.triggers.name, count.index),
+"",
+),
+",,",
+",",
+),
+".${var.domain}",
+"",
+),
+"-",
+"_",
+),
+",",
+" ",
+),
+"/(^ | $)/",
+"",
+),
+),
+),
+),
+"/^ConnectTo = $/",
+"",
+)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment