Update run to work with new syntax

This commit is contained in:
Ray Miller 2025-07-06 15:00:30 +01:00
parent 69f50fbadb
commit 66a2a887fd
Signed by: ray
GPG key ID: 043F786C4CD681B8

View file

@ -16,12 +16,13 @@ this program. If not, see <https://www.gnu.org/licenses/>.
|# |#
(define-module (ordo cli run) (define-module (ordo cli run)
#:declarative? #f
#:use-module (config) #:use-module (config)
#:use-module (config api) #:use-module (config api)
#:use-module (ice-9 filesystem) #:use-module (ice-9 filesystem)
#:use-module (ordo core)
#:use-module (ordo inventory) #:use-module (ordo inventory)
#:use-module (ordo logger) #:use-module (ordo logger)
#:use-module (ordo playbook)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:export (config handler)) #:export (config handler))
@ -57,12 +58,12 @@ this program. If not, see <https://www.gnu.org/licenses/>.
(arguments (arguments
(list (list
(argument (argument
(name 'playbook) (name 'workflow)
(handler (cut expand-file-name <> #f #t)) (handler (cut expand-file-name <> #f #t))
(example "examples/uptime.scm")
(test file-exists?)))) (test file-exists?))))
(synopsis "Run a playbook"))) (synopsis "Run a workflow")))
(define (handler options) (define (handler options)
(let ((inventory (load-inventory (option-ref options 'inventory))) (load-inventory! (option-ref options 'inventory))
(playbook (load-playbook (option-ref options '(playbook))))) (load (option-ref options '(workflow))))
(run-playbook playbook inventory)))