diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-01 13:00:45 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-01 14:47:27 -0700 |
commit | 27d73167ae319284d83d6c48baf23e834e8dfe0c (patch) | |
tree | eb5a1496e50ba3a34d3f808f695c6b5124c7fa20 /src/host.lisp | |
parent | 9b67a83b16c200ebea3dca8984867f2c92ceda92 (diff) | |
download | consfigurator-27d73167ae319284d83d6c48baf23e834e8dfe0c.tar.gz |
replace DEFHOSTDEPLOY
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/host.lisp')
-rw-r--r-- | src/host.lisp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/host.lisp b/src/host.lisp index 1f2c22a..f948ec8 100644 --- a/src/host.lisp +++ b/src/host.lisp @@ -40,12 +40,18 @@ be applied to the host."))) :props ,(slot-value host 'propspec))) host) -(defmacro defhost (hostname &body properties) +(defmacro defhost (hostname (&key deploy) &body properties) "Define a host with hostname HOSTNAME and properties PROPERTIES. HOSTNAME can be a string or a symbol. In either case, the host will get a static informational property with its hostname as a string, and the symbol whose name is the hostname will be bound to the host object. +DEPLOY represents the usual way you'll connect to the host to deploy +properties, and if specified, a function named HOSTNAME will be defined to +deploy the host using that connection chain. This is an optional convenience +feature; you can always use DEPLOY and DEPLOY-THESE to apply properties to the +host using an arbitrary chain of connections. + If the first entry in PROPERTIES is a string, it will be considered a human-readable description of the host. Otherwise, PROPERTIES is an unevaluated property application specification. Recall that for atomic @@ -72,4 +78,6 @@ entries." (defparameter ,hostname-sym (%replace-propspec-into-host (make-instance 'host :attrs ',attrs) ,(props properties)) - ,(car (getf attrs :desc)))))) + ,(car (getf attrs :desc))) + ,@(when deploy + `((defdeploy ,hostname-sym (,deploy ,hostname-sym))))))) |