From 45737ce452ca99cdd9c29b660399f2352abd163f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 8 Mar 2011 20:35:21 +0100 Subject: [PATCH] [DOC] add cdist-type manpage Signed-off-by: Nico Schottelius --- Makefile | 2 +- doc/man/{to_check => }/cdist-type.text | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) rename doc/man/{to_check => }/cdist-type.text (83%) diff --git a/Makefile b/Makefile index ddada4c3..95507337 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,13 @@ MANSRC=$(MANDIR)/cdist-config-layout.text \ $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-terms.text \ - $(MANDIR)/cdist-type.text MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-bin-transfer.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-manifest.text \ $(MANDIR)/cdist-stages.text \ + $(MANDIR)/cdist-type.text \ $(MANDIR)/cdist-type-template.text \ diff --git a/doc/man/to_check/cdist-type.text b/doc/man/cdist-type.text similarity index 83% rename from doc/man/to_check/cdist-type.text rename to doc/man/cdist-type.text index b4df77d7..ad051585 100644 --- a/doc/man/to_check/cdist-type.text +++ b/doc/man/cdist-type.text @@ -98,6 +98,25 @@ to execute it. THE TYPE EXPLORERS ------------------ +If a type needs to explore specific details, it can provide type specific +explorers, which will be executed on the target for every created object. + +The explorers are stored under the "explorer" directory below the type. +It could for instance contain code to check the md5sum of a file on the +client, like this (shortened version from real type __file): + +-------------------------------------------------------------------------------- +if [ -f "$__object/parameter/destination" ]; then + destination="$(cat "$__object/parameter/destination")" +else + destination="/$__object_id" +fi + +if [ -e "$destination" ]; then + md5sum < "$destination" +fi +-------------------------------------------------------------------------------- + WRITING THE GENCODE SCRIPT -------------------------- @@ -132,8 +151,8 @@ If you think your type may be useful for others, ensure it works with the current master branch of cdist and submit the git url containing the type for inclusion to the mailinglist **cdist at cdist -- at -- l.schottelius.org**. -Ensure there is a corresponding manpage named cdist-type-NAME (without -underscores) included. +Ensure a corresponding manpage named cdist-type-NAME (without +underscores) is included. SEE ALSO @@ -144,5 +163,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is +Copyright \(C) 2011 Nico Schottelius. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3).