if node.os != "alpine": raise BundleError(f"{node.name}: OS {node.os} is not supported.") files = { "/usr/bin/resticw": { "source": "resticw", "content_type": "text", "mode": "0755", }, "/usr/bin/resticbackup": { "source": "resticbackup", "content_type": "text", "mode": "0755", }, "/usr/bin/resticrestore": { "source": "resticrestore", "content_type": "text", "mode": "0755", }, "/etc/restic/restic.conf": { "source": "restic.conf", "content_type": "mako", "mode": "0600", }, "/etc/restic/includes": { "source": "includes", "content_type": "mako", "context": { "paths": sorted(node.metadata.get("backup/includes", {})), }, }, "/etc/restic/excludes": { "source": "includes", "content_type": "mako", "context": { "paths": sorted(node.metadata.get("backup/excludes", {})), }, }, "/etc/periodic/weekly/restic-backup": { "source": "cron_job", "content_type": "mako", "mode": "0755", "needs": { "bundle:tgnotify", } }, } actions = { f"initialize_restic_repository": { "command": "resticw init", "unless": "resticw cat config", "needs": { "file:/usr/bin/resticw", "file:/etc/restic/restic.conf", }, "triggered": True, "triggered_by": { "file:/etc/restic/restic.conf", }, } }