(use-modules ((ordo action filesystem) #:prefix fs:) ((ordo action quadlet) #:prefix quadlet:) ((ordo action systemctl) #:prefix systemctl:)) (define* (install-forgejo #:key (version "11")) (list (task "Install configuration directory" #:action fs:install-dir #:args '(#:path "/etc/forgejo") #:trigger '("Restart pod")) (task "Install timezone configuration" #:action fs:install-file #:args '(#:path "/etc/forgejo/timezone" #:local-src "files/timezone") #:trigger '("Restart pod")) (task "Install localtime configuration" #:action fs:install-file #:args '(#:path "/etc/forgejo/localtime" #:local-src "files/localtime") #:trigger '("Restart pod")) (task "Create data volume quadlet" #:action quadlet:create-volume #:args '(#:name "forgejo" #:description "Forgejo data volume") #:trigger '("Reload systemd" "Restart pod")) (task "Create pod quadlet" #:action quadlet:create-pod #:args '(#:name "forgejo" #:pod ((PodName . "forge") (Volume . "forgejo.volume:U,Z") (PodmanArgs . "--userns auto"))) #:trigger '("Reload systemd" "Restart pod")) (task "Create image quadlet" #:action quadlet:create-image #:args `(#:name "forgejo" #:image (Image . ,(format #f "codeberg.org/forgejo/forgejo:~a" version))) #:trigger '("Reload systemd" "Restart pod")) (task "Create container quadlet" #:action quadlet:create-container #:args '(#:name "forgejo" #:container ((Pod . "forgejo.pod") (Image . "forgejo.image") (Network . "services.network") (Volume . "/etc/forgejo/timezone:/etc/timezone:ro,U,Z") (Volume . "/etc/forgejo/localtime:/etc/localtime:ro,U,Z") (Environment . "USER_UID=1000") (Environment . "USER_GID=1000") (Environment . "FORGEJO__service__DISABLE_REGISTRATION=true") (Environment . "FORGEJO__webhook__ALLOWED_HOST_LIST=private"))) #:trigger '("Reload systemd" "Restart pod")) (handler "Reload systemd" #:action systemctl:daemon-reload) (handler "Restart pod" #:action systemctl:restart-unit #:args '((#:unit . "forgejo-pod.service"))))) (playbook "Install Forgejo on limiting-factor" ;; #:vars '((forgejo-version . "11.0.2")) (play #:host "limiting-factor" #:become? #t (install-forgejo #:version "11")))