20 lines
693 B
Scheme
20 lines
693 B
Scheme
(define-module (ordo cli)
|
|
#:use-module (ice-9 filesystem)
|
|
#:use-module (ice-9 match)
|
|
#:use-module (logging logger)
|
|
#:use-module (ordo logger)
|
|
#:use-module (ordo playbook)
|
|
#:declarative? #f
|
|
#:export (main))
|
|
|
|
(define (main args)
|
|
(match-let (((_ inventory-path playbook-path) args))
|
|
(let ((inventory-path (expand-file-name inventory-path))
|
|
(playbook-path (expand-file-name playbook-path)))
|
|
(setup-logging #:level 'INFO)
|
|
(load inventory-path)
|
|
(log-msg 'DEBUG "Loaded inventory: " inventory-path)
|
|
(let ((playbook (load playbook-path)))
|
|
(log-msg 'DEBUG "Loaded playbook: " playbook-path)
|
|
(run-playbook playbook))
|
|
(quit))))
|