Simplify handling of localhost in inventory
This commit is contained in:
parent
93c5cad460
commit
69f50fbadb
1 changed files with 2 additions and 3 deletions
|
@ -51,7 +51,8 @@ this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
(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 <https://www.gnu.org/licenses/>.
|
|||
|
||||
(define-method (resolve-hosts expr)
|
||||
(match expr
|
||||
("localhost" (list (or (find (named? "localhost") *inventory*)
|
||||
(make <host> #:name "localhost" #:connection (local-connection)))))
|
||||
((? string? hostname) (filter (named? hostname) *inventory*))
|
||||
('all *inventory*)
|
||||
(('tagged tag) (filter (tagged-every? (list tag)) *inventory*))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue