aboutsummaryrefslogtreecommitdiff
path: root/doc/properties.rst
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-14 11:00:07 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-14 11:00:07 -0700
commitc10c35a1ed3fc6a4e5027540c9b3bd51d7a8321b (patch)
tree740f292944f4dccb0e4d33cf6ae1450a9ff8a074 /doc/properties.rst
parenteac2f4f4bfd502b3540f5f21bb8307651469c43b (diff)
downloadconsfigurator-c10c35a1ed3fc6a4e5027540c9b3bd51d7a8321b.tar.gz
notes on types of properties and hostattrs subroutine
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'doc/properties.rst')
-rw-r--r--doc/properties.rst31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/properties.rst b/doc/properties.rst
index 705fce4..2f40863 100644
--- a/doc/properties.rst
+++ b/doc/properties.rst
@@ -1,3 +1,14 @@
+Property subroutines
+~~~~~~~~~~~~~~~~~~~~
+
+``:hostattrs`` subroutines
+==========================
+
+Return a list of static informational attributes to add to hosts to which this
+property has been applied or is to be applied. Should not perform any I/O.
+Essentially just a conversion of the arguments to the property to
+informational attributes.
+
``:check`` subroutines
======================
@@ -29,3 +40,23 @@ command actually made a change to a particular file, for example.
Errors in attempting to apply a property are indicated by signalling a
``failed-change`` condition.
+
+``:posix`` vs. ``:lisp`` properties
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``:posix`` properties should not make any assumptions about what localhost is
+-- they may be running in the root Lisp, but they might be running in a Lisp
+process running on an intermediary host. They should perform I/O only by
+calling ``run``, ``readfile``, ``writefile``, requesting prerequisite data,
+and applying or unapplying other ``:posix`` properties. Otherwise, they
+should be pure functions.
+
+In this respect, the code which establishes connections (i.e., implementations
+of the ``connect-and-apply`` generic function) is like a ``:posix`` property
+-- it should restrict its I/O to ``run``, ``readfile`` and ``writefile`` to
+permit the arbitrary nesting of connections.
+
+``:lisp`` properties, by contrast, may assume that they are running in a Lisp
+process on the host to which they are to be applied, so they can perform
+arbitrary I/O in that context. They can also make use of ``run``,
+``readfile`` and ``writefile`` if desired.