diff --git a/services/external.tf b/services/external.tf new file mode 100644 index 0000000..8f31bf6 --- /dev/null +++ b/services/external.tf @@ -0,0 +1,29 @@ +resource "consul_service" "homeassistant" { + name = "hass" + node = consul_node.homeassistant.name + port = 8123 + tags = [ + "traefik.enable=true", + "traefik.consulcatalog.connect=false", + "traefik.http.routers.hass.entryPoints=websecure", + ] + + check { + check_id = "homeassistant:hass" + status = "passing" + name = "Home Assistant Health Check" + http = "192.168.3.65:8123" + interval = "30s" + timeout = "10s" + } +} + +resource "consul_node" "homeassistant" { + name = "homeassistant" + address = "192.168.3.65" + + meta = { + "external-node" = "true" + "external-probe" = "true" + } +} diff --git a/services/main.tf b/services/main.tf index 4770538..51d80b5 100644 --- a/services/main.tf +++ b/services/main.tf @@ -107,33 +107,3 @@ resource "consul_config_entry" "nzbget_intents" { # ]) # } # } - -resource "consul_service" "homeassistant" { - name = "hass" - node = consul_node.homeassistant.name - port = 8123 - tags = [ - "traefik.enable=true", - "traefik.consulcatalog.connect=false", - "traefik.http.routers.hass.entryPoints=websecure", - ] - - check { - check_id = "homeassistant:hass" - status = "passing" - name = "Home Assistant Health Check" - http = "192.168.3.65:8123" - interval = "30s" - timeout = "10s" - } -} - -resource "consul_node" "homeassistant" { - name = "homeassistant" - address = "192.168.3.65" - - meta = { - "external-node" = "true" - "external-probe" = "true" - } -}