Auto refresh blocky lists when template change

This commit is contained in:
IamTheFij 2024-06-26 13:28:45 -07:00
parent 9ee660cb6d
commit c478ba4278

View File

@ -88,6 +88,16 @@ job "blocky" {
ports = ["dns", "api"] ports = ["dns", "api"]
} }
action "refresh-lists" {
command = "/app/blocky"
args = ["lists", "refresh"]
}
action "healthcheck" {
command = "/app/blocky"
args = ["healthcheck"]
}
resources { resources {
cpu = 50 cpu = 50
memory = 75 memory = 75
@ -131,11 +141,17 @@ job "blocky" {
{{- end }} {{- end }}
EOF EOF
destination = "$${NOMAD_TASK_DIR}/block" destination = "$${NOMAD_TASK_DIR}/block"
change_mode = "noop" change_mode = "script"
change_script {
command = "/app/blocky"
args = ["lists", "refresh"]
timeout = "20s"
}
wait { wait {
min = "10s" min = "30s"
max = "20s" max = "1m"
} }
} }
@ -148,11 +164,17 @@ job "blocky" {
{{- end }} {{- end }}
EOF EOF
destination = "$${NOMAD_TASK_DIR}/allow" destination = "$${NOMAD_TASK_DIR}/allow"
change_mode = "noop" change_mode = "script"
change_script {
command = "/app/blocky"
args = ["lists", "refresh"]
timeout = "20s"
}
wait { wait {
min = "10s" min = "30s"
max = "20s" max = "1m"
} }
} }
@ -165,7 +187,13 @@ job "blocky" {
{{- end }} {{- end }}
EOF EOF
destination = "$${NOMAD_TASK_DIR}/smarttv-regex.txt" destination = "$${NOMAD_TASK_DIR}/smarttv-regex.txt"
change_mode = "noop" change_mode = "script"
change_script {
command = "/app/blocky"
args = ["lists", "refresh"]
timeout = "20s"
}
wait { wait {
min = "10s" min = "10s"