X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-ansible/blobdiff_plain/3f6c599278bae19250f1551830d96d103c1ff38d..7be16879925948d5b4bec73d20b4a674b230d74c:/hosts/host-defs.lisp diff --git a/hosts/host-defs.lisp b/hosts/host-defs.lisp index 7860ab1..ae5fd1e 100644 --- a/hosts/host-defs.lisp +++ b/hosts/host-defs.lisp @@ -1,5 +1,7 @@ ;;; -*-lisp-*- +(cl:in-package #:ansible-inventory-user) + ;; Set `:vm-role' and `:guests' properties based on `:vm-host' backlinks from ;; guests, and propagate `:location' and `:hypervisor' back to the guests. (defhook (prio-props) @@ -24,7 +26,7 @@ (defhook (prio-groups) (dohosts (host) (when (eq (hostprop host :vm-role) :host) - (add-group (intern (concatenate 'string (string host) "-guests")) + (add-group (intern (concatenate 'string (string host) "-GUESTS")) :predicate (lambda (h) (eql (hostprop h :vm-host) host)))))) ;; For each `:os' flavour, define a group of hosts running it. @@ -35,7 +37,7 @@ (when foundp (pushnew os oses)))) (dolist (os-mut oses) (let ((os os-mut)) - (add-group (intern (concatenate 'string (string os) "-hosts")) + (add-group (intern (concatenate 'string (string os) "-HOSTS")) :predicate (lambda (h) (eql (hostprop h :os) os))))))) ;; For each ROLE listed in a `:server' list, define a `ROLE-servers' group. @@ -46,7 +48,7 @@ (pushnew role server-roles))) (dolist (r server-roles) (let ((role r)) - (add-group (intern (concatenate 'string (string role) "-servers")) + (add-group (intern (concatenate 'string (string role) "-SERVERS")) :predicate (lambda (h) (member role (hostprop h :server))))))))