62 lines
1.3 KiB
Plaintext
62 lines
1.3 KiB
Plaintext
package unifi
|
|
|
|
import "du5t1n.me/cfg/base/schema/instructions"
|
|
|
|
import "du5t1n.me/cfg/app/caddy"
|
|
|
|
templates: [...instructions.#RenderInstruction] & [
|
|
{
|
|
template: "unifi/unifi.sysusers"
|
|
dest: "/etc/sysusers.d/unifi.conf"
|
|
hooks: changed: [
|
|
{
|
|
run: "systemd-sysusers /etc/sysusers.d/unifi.conf"
|
|
immediate: true
|
|
},
|
|
]
|
|
},
|
|
{
|
|
template: "unifi/unifi_exporter.yml"
|
|
dest: "/etc/unifi_exporter.yml"
|
|
hooks: {
|
|
changed: [{run: "systemctl restart unifi_exporter"}]
|
|
}
|
|
},
|
|
{
|
|
template: "unifi/unifi.pod"
|
|
dest: "/etc/containers/systemd/unifi.pod"
|
|
hooks: {
|
|
changed: [
|
|
{run: "systemctl daemon-reload", immediate: true},
|
|
]
|
|
}
|
|
},
|
|
{
|
|
template: "unifi/unifi.container"
|
|
dest: "/etc/containers/systemd/unifi.container"
|
|
hooks: {
|
|
changed: [
|
|
{run: "systemctl daemon-reload", immediate: true},
|
|
{run: "systemctl restart unifi"},
|
|
]
|
|
}
|
|
},
|
|
{
|
|
template: "unifi/unifi_exporter.container"
|
|
dest: "/etc/containers/systemd/unifi_exporter.container"
|
|
hooks: {
|
|
changed: [
|
|
{run: "systemctl daemon-reload", immediate: true},
|
|
{run: "systemctl restart unifi_exporter"},
|
|
]
|
|
}
|
|
},
|
|
{
|
|
template: "unifi/Caddyfile"
|
|
dest: "/etc/caddy/Caddyfile"
|
|
hooks: {
|
|
changed: [{run: "systemctl restart caddy"}]
|
|
}
|
|
},
|
|
]+caddy.templates
|