www.nico.schottelius.org/software/cdist/man/2.1.0pre7-48-gc51edff/man7/cdist-explorer.html

29 lines
4.0 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>cdist-explorer(7)</title><link rel="stylesheet" type="text/css" href="docbook-xsl.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.77.1" /></head><body><div xml:lang="en" class="article" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="idp171136"></a>cdist-explorer(7)</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Nico</span> <span class="surname">Schottelius</span></h3><code class="email">&lt;<a class="email" href="mailto:nico-cdist--@--schottelius.org">nico-cdist--@--schottelius.org</a>&gt;</code></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="section"><a href="#_name">1. NAME</a></span></dt><dt><span class="section"><a href="#_description">2. DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_examples">3. EXAMPLES</a></span></dt><dt><span class="section"><a href="#_see_also">4. SEE ALSO</a></span></dt><dt><span class="section"><a href="#_copying">5. COPYING</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name"></a>1. NAME</h2></div></div></div><p>cdist-explorer - Explore the target systems</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description"></a>2. DESCRIPTION</h2></div></div></div><p>Explorer are small shell scripts, which will be executed on the target
host. The aim of the explorer is to give hints to types on how to act on the
target system. An explorer outputs the result to stdout, which is usually
a one liner, but may be empty or multi line especially in the case of
type explorers.</p><p>There are general explorers, which are run in an early stage, and
type explorers. Both work almost exactly the same way, with the difference
that the values of the general explorers are stored in a general location and
the type specific below the object.</p><p>Explorers can reuse other explorers on the target system by calling
$<span class="emphasis"><em>explorer/&lt;explorer_name&gt; (general and type explorer) or
$</em></span>type_explorer/&lt;explorer name&gt; (type explorer).</p><p>In case of significant errors, the explorer may exit non-zero and return an
error message on stderr, which will cause cdist to abort.</p><p>You can also use stderr for debugging purposes while developing a new
explorer.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_examples"></a>3. EXAMPLES</h2></div></div></div><p>A very simple explorer may look like this:</p><pre class="screen">hostname</pre><p>Which is in practise the <span class="strong"><strong><span class="strong"><strong>hostname</strong></span></strong></span> explorer.</p><p>A type explorer, which could check for the status of a package may look like this:</p><pre class="screen">if [ -f "$__object/parameter/name" ]; then
name="$(cat "$__object/parameter/name")"
else
name="$__object_id"
fi
# Except dpkg failing, if package is not known / installed
dpkg -s "$name" 2&gt;/dev/null || exit 0</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also"></a>4. SEE ALSO</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
cdist(1)
</li><li class="listitem">
cdist-reference(7)
</li><li class="listitem">
cdist-stages(7)
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_copying"></a>5. COPYING</h2></div></div></div><p>Copyright (C) 2010-2012 Nico Schottelius. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).</p></div></div></body></html>