pacman_packages answers one package on every node, or each node's counts, its explicit packages no module declares and its foreign ones apart, the versions that differ and the packages on some nodes only, with a node over the bus's cap marked not current. pacman_updates, pacman_installed and pacman_foreign read the keeper's states instead of the machine; pacman_updates says when each node's list last changed.
231 lines
5.2 KiB
JSON
231 lines
5.2 KiB
JSON
{
|
|
"module": "pacman",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"package-manager",
|
|
"service-manager"
|
|
],
|
|
"claims": [
|
|
{
|
|
"name": "node-package-manager",
|
|
"scope": "node"
|
|
}
|
|
],
|
|
"reads": [
|
|
"mesh-controller.declared-packages"
|
|
],
|
|
"config": {
|
|
"upgrade-order": {
|
|
"type": "list",
|
|
"description": "The nodes in the order they upgrade, each by its name: the first opens each week's round on Saturday at 04:00 local time, and each node upgrades after the one before it passed its after-upgrade check (novox/hq ADR 0508 §5). Empty: no round starts, and every node's health says why. Falls back to the mesh-level key of the same name.",
|
|
"trusted": true,
|
|
"predefined": "upgrade-order",
|
|
"default": []
|
|
},
|
|
"record-days": {
|
|
"type": "number",
|
|
"description": "How many days a package record taken before an upgrade is kept on the bus before it is deleted (novox/hq ADR 0508 §2); a rollback can return only to a record still kept.",
|
|
"minimum": 1,
|
|
"trusted": false,
|
|
"default": 180
|
|
},
|
|
"round-start-minutes": {
|
|
"type": "number",
|
|
"description": "How many minutes a node whose turn in the round came may take to start its upgrade before the round is said to stand still, in that node's and the waiting nodes' health (novox/hq ADR 0508 §6).",
|
|
"minimum": 1,
|
|
"trusted": false,
|
|
"default": 120
|
|
}
|
|
},
|
|
"own-secrets": {
|
|
"broker-keeper": {
|
|
"path": "${dir:state}/broker-keeper.secret",
|
|
"owner": "pacman-keeper"
|
|
}
|
|
},
|
|
"state": [
|
|
"installed",
|
|
"updates",
|
|
"runs",
|
|
"records",
|
|
"rounds",
|
|
"asks"
|
|
],
|
|
"emits": [
|
|
"package.changed",
|
|
"upgrade.recorded",
|
|
"upgrade.kernel-held",
|
|
"upgrade.started",
|
|
"upgrade.finished",
|
|
"upgrade.failed",
|
|
"upgrade.checked",
|
|
"rollback.started",
|
|
"rollback.finished"
|
|
],
|
|
"tools": [
|
|
"pacman_search",
|
|
"pacman_info",
|
|
"pacman_installed",
|
|
"pacman_packages",
|
|
"pacman_owns",
|
|
"pacman_files",
|
|
"pacman_updates",
|
|
"pacman_upgrade",
|
|
"pacman_upgrade_health",
|
|
"pacman_upgrades",
|
|
"pacman_orphans",
|
|
"pacman_remove_orphans",
|
|
"pacman_cache",
|
|
"pacman_history",
|
|
"pacman_mirrors",
|
|
"pacman_foreign",
|
|
"pacman_news",
|
|
"pacman_config"
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "package",
|
|
"type": "package",
|
|
"package": "pacman"
|
|
},
|
|
{
|
|
"id": "config",
|
|
"type": "file",
|
|
"path": "/etc/pacman.conf",
|
|
"mode": "0644",
|
|
"template": "files/pacman.conf"
|
|
},
|
|
{
|
|
"id": "contrib",
|
|
"type": "package",
|
|
"package": "pacman-contrib"
|
|
},
|
|
{
|
|
"id": "reflector",
|
|
"type": "package",
|
|
"package": "reflector"
|
|
},
|
|
{
|
|
"id": "mirrors",
|
|
"type": "file",
|
|
"path": "/etc/xdg/reflector/reflector.conf",
|
|
"mode": "0644",
|
|
"template": "files/reflector.conf"
|
|
},
|
|
{
|
|
"id": "mirror-refresh",
|
|
"type": "service",
|
|
"unit": "reflector.timer",
|
|
"state": "running",
|
|
"boot": "enabled",
|
|
"health": {
|
|
"kind": "unit"
|
|
}
|
|
},
|
|
{
|
|
"id": "cache-cleaning",
|
|
"type": "service",
|
|
"unit": "paccache.timer",
|
|
"state": "running",
|
|
"boot": "enabled",
|
|
"health": {
|
|
"kind": "unit"
|
|
}
|
|
},
|
|
{
|
|
"id": "keeper-account",
|
|
"type": "user",
|
|
"name": "pacman-keeper",
|
|
"shell": "/usr/bin/nologin"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0711",
|
|
"place": ".",
|
|
"unknown": "program"
|
|
},
|
|
{
|
|
"id": "keeper-config",
|
|
"type": "file",
|
|
"path": "${dir:state}/keeper.json",
|
|
"mode": "0644",
|
|
"takes-config": [
|
|
"upgrade-order",
|
|
"record-days",
|
|
"round-start-minutes"
|
|
],
|
|
"merge": "json",
|
|
"template": "files/keeper.json",
|
|
"trusted": true
|
|
},
|
|
{
|
|
"id": "keeper",
|
|
"type": "process",
|
|
"name": "pacman-keeper",
|
|
"artifact": "tools",
|
|
"run": [
|
|
"./pacman-tools",
|
|
"keeper"
|
|
],
|
|
"user": "pacman-keeper",
|
|
"env": {
|
|
"PACMAN_KEEPER_BROKER": "${dir:state}/broker-keeper.secret",
|
|
"PACMAN_KEEPER_CONFIG": "${dir:state}/keeper.json"
|
|
},
|
|
"restart-on": [
|
|
"keeper-config"
|
|
],
|
|
"bus": {
|
|
"state": [
|
|
"installed",
|
|
"updates",
|
|
"runs",
|
|
"records",
|
|
"rounds",
|
|
"asks"
|
|
],
|
|
"emits": [
|
|
"package.changed",
|
|
"upgrade.recorded",
|
|
"upgrade.kernel-held",
|
|
"upgrade.started",
|
|
"upgrade.finished",
|
|
"upgrade.failed",
|
|
"upgrade.checked",
|
|
"rollback.started",
|
|
"rollback.finished"
|
|
]
|
|
},
|
|
"health": {
|
|
"kind": "tool",
|
|
"tool": "pacman_upgrade_health",
|
|
"interval": "60s",
|
|
"timeout": "20s",
|
|
"looks": 2,
|
|
"grace": "60s"
|
|
}
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/pacman-tools",
|
|
"binary": "pacman-tools",
|
|
"loads": [
|
|
"pacman-tools"
|
|
]
|
|
},
|
|
{
|
|
"name": "files",
|
|
"kind": "archive",
|
|
"from": "files"
|
|
}
|
|
]
|
|
}
|
|
}
|