job "hass" { # region = "global" datacenters = ["dc1"] type = "service" # priority = 50 constraint { attribute = "${attr.kernel.name}" value = "linux" } constraint { attribute = "${attr.unique.hostname}" operator = "regexp" value = "odroid.*" } // constraint { // operator = "distinct_hosts" // value = "true" // } affinity { attribute = "${attr.unique.hostname}" value = "odroid2" weight = 80 } update { # Stagger updates every 60 seconds stagger = "10s" max_parallel = 1 healthy_deadline = "15m" progress_deadline = "20m" } group "hass" { count = 1 restart { attempts = 99 interval = "1h" delay = "10s" mode = "delay" } // task "init" { // driver = "docker" // lifecycle { // hook = "prestart" // sidecar = false // } // config { // memory_hard_limit = "2048" // image_pull_timeout = "10m" // force_pull = false // image = "ghcr.io/sstent/rsync" // volumes = [ // "/mnt/configs/${NOMAD_GROUP_NAME}:/config", // "/mnt/Public/config/${NOMAD_GROUP_NAME}:/configbackup", // "/mnt/Public/config/locks:/locks" // ] // } // env { // DB_NAME = "home-assistant_v2.db" // } // resources { // cpu = 20 # 500 MHz // memory = 20 # 128MB // } // // template { // // data = <