From 69f50fbadb71fdf4800f1117ab1509ab83f9f79e Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Sun, 6 Jul 2025 15:00:16 +0100 Subject: [PATCH] Simplify handling of localhost in inventory --- ordo/inventory.scm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ordo/inventory.scm b/ordo/inventory.scm index d82e161..36e4137 100644 --- a/ordo/inventory.scm +++ b/ordo/inventory.scm @@ -51,7 +51,8 @@ this program. If not, see . (eval-string (call-with-input-file filename get-string-all) #:file filename) (when (null? *inventory*) - (log-msg 'NOTICE "Inventory is empty, only localhost will be available"))) + (log-msg 'NOTICE "Inventory is empty, only localhost will be available") + (defhost "localhost" #:connection (local-connection)))) (define (tagged-every? wanted-tags) (lambda (h) @@ -67,8 +68,6 @@ this program. If not, see . (define-method (resolve-hosts expr) (match expr - ("localhost" (list (or (find (named? "localhost") *inventory*) - (make #:name "localhost" #:connection (local-connection))))) ((? string? hostname) (filter (named? hostname) *inventory*)) ('all *inventory*) (('tagged tag) (filter (tagged-every? (list tag)) *inventory*))