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