This file is indexed.

/usr/share/doc/cdist/html/_sources/cdist-explorer.txt is in cdist-doc 4.4.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Explorer
========

Description
-----------
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.

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.

Explorers can reuse other explorers on the target system by calling

::

    $__explorer/<explorer_name> (general and type explorer)

or

::

    $__type_explorer/<explorer name> (type explorer).

In case of significant errors, the explorer may exit non-zero and return an
error message on stderr, which will cause cdist to abort.

You can also use stderr for debugging purposes while developing a new
explorer.

Examples
--------
A very simple explorer may look like this::

    hostname

Which is in practise the **hostname** explorer.

A type explorer, which could check for the status of a package may look like this:

.. code-block:: sh

    if [ -f "$__object/parameter/name" ]; then
       name="$(cat "$__object/parameter/name")"
    else
       name="$__object_id"
    fi

    # Expect dpkg failing, if package is not known / installed
    dpkg -s "$name" 2>/dev/null || exit 0