More work on execution

This commit is contained in:
Ray Miller 2025-07-04 17:13:14 +01:00
parent be28e14d3e
commit ae8c24aa63
Signed by: ray
GPG key ID: 043F786C4CD681B8
5 changed files with 129 additions and 99 deletions

View file

@ -1,23 +1,22 @@
(use-modules (ordo connection)
(ordo inventory))
(list
(host #:name "root@little-rascal"
#:connection (local-connection #:become? #t)
#:tags '(#:linux #:guix))
(defhost "little-rascal"
#:connection (local-connection)
#:tags '(#:linux #:guix))
(host #:name "root@limiting-factor"
#:connection (ssh-connection #:host "limiting-factor" #:user "core" #:become? #t)
#:tags '(#:linux #:coreos))
(defhost "limiting-factor"
#:connection (ssh-connection #:host "limiting-factor" #:user "core")
#:tags '(#:linux #:coreos))
(host #:name "root@screw-loose"
#:connection (ssh-connection #:host "screw-loose" #:user "core" #:become? #t)
#:tags '(#:linux #:coreos))
(defhost "screw-loose"
#:connection (ssh-connection #:host "screw-loose" #:user "core")
#:tags '(#:linux #:coreos))
(host #:name "root@control-surface"
#:connection (ssh-connection #:host "control-surface" #:user "ray" #:become? #t)
#:tags '(#:linux #:debian))
(defhost "control-surface"
#:connection (ssh-connection #:host "control-surface" #:user "ray")
#:tags '(#:linux #:debian))
(host #:name "root@cargo-cult"
#:connection (ssh-connection #:host "cargo-cult" #:user "ray" #:become? #t)
#:tags '(#:linux #:synology)))
(defhost "cargo-cult"
#:connection (ssh-connection #:host "cargo-cult" #:user "ray")
#:tags '(#:linux #:synology))

View file

@ -7,6 +7,9 @@
(define uptime (task #:name "uptime" #:action (cut remote-cmd <> "uptime" #:return car)))
(define flow (workflow
(step #:action uptime #:target "root@limiting-factor" #:continue-on-err? #t)))
(execute uptime "limiting-factor" '(#:sudo #t))))
(define resolver (load-inventory "examples/inventory.scm"))
;; IDEA: have load-inventory! set an *inventory* parameter and remove the execute methods
;; that take a <host-resolver> argument, making this implicit.