Update cdist beta docs

This commit is contained in:
Darko Poljak 2020-06-17 12:20:44 +02:00
parent 1b6cad787c
commit a559101180
215 changed files with 18452 additions and 9379 deletions

View file

@ -25,7 +25,7 @@ people, have a look at `cdist best practice <cdist-best-practice.html>`_.
Setup working directory and branch
----------------------------------
I assume you have a fresh copy of the cdist tree in ~/cdist, cloned from
one of the official urls (see `cdist quickstart <cdist-quickstart.html>`_ if you don't).
one of the official URLs (see `cdist quickstart <cdist-quickstart.html>`_ if you don't).
Entering the command "git branch" should show you "* master", which indicates
you are on the **master** branch.

View file

@ -59,7 +59,7 @@ typeorder
Object cache overview
~~~~~~~~~~~~~~~~~~~~~
Each object under :strong:`object` directory has its own structurue.
Each object under :strong:`object` directory has its own structure.
code-local
code generated from gencode-local, present only if something is

View file

@ -21,7 +21,7 @@ precedence. Configuration option value read from source with higher
precedence will overwrite option value, if exists, read from source with
lower precedence. That means that command-line option wins them all.
Users can decide on the local conifguration file location. It can be either
Users can decide on the local configuration file location. It can be either
~/.cdist.cfg or $XDG_CONFIG_HOME/cdist/cdist.cfg. Note that, if both exist,
then ~/.cdist.cfg is used.

View file

@ -9,15 +9,15 @@ Source Host
This is the machine from which you will configure target hosts.
* /bin/sh: A posix like shell (for instance bash, dash, zsh)
* Python >= 3.2
* /bin/sh: A POSIX like shell (for instance bash, dash, zsh)
* Python >= 3.5
* SSH client
* sphinx (for building html docs and/or the man pages)
Target Hosts
~~~~~~~~~~~~
* /bin/sh: A posix like shell (for instance bash, dash, zsh)
* /bin/sh: A POSIX like shell (for instance bash, dash, zsh)
* SSH server
Install cdist

View file

@ -198,7 +198,7 @@ We require package uWSGI present in order to create **/etc/uwsgi/apps-enabled/$u
Installation of uWSGI also creates configuration layout: **/etc/uwsgi/apps-enabled**.
If this directory does not exist then **__file** type would error.
We also use stdin as file content source. For details see `Input from stdin <cdist-type.html#input-from-stdin>`_.
For feading stdin we use here-document (**<<** operator). It allows redirection of subsequent
For feeding stdin we use here-document (**<<** operator). It allows redirection of subsequent
lines read by the shell to the input of a command until a line containing only the delimiter
and a newline, with no blank characters in between (EOF in our case).
@ -546,7 +546,7 @@ we have changed our **wsgi.py** file uWSGI reloads the application.
Our application selects and lists items from **items** table.
Openning application
Opening application
~~~~~~~~~~~~~~~~~~~~
Finally try the application::

View file

@ -306,13 +306,13 @@ usable within a object directory:
files
This directory is reserved for user data and will not be used
by cdist at any time. It can be used freely by the type
by cdist at any time. It can be used freely by the type
(for instance to store template results).
changed
This empty file exists in an object directory, if the object has
code to be executed (either remote or local).
stdin
This file exists and contains data, if data was provided on stdin
This file exists and contains data, if data was provided on stdin
when the type was called.
@ -341,65 +341,89 @@ __cdist_log_level, __cdist_log_level_name
| TRACE | 5 |
+----------------+-----------------+
Available for: initial manifest, explorer, type manifest, type explorer,
type gencode.
__cdist_colored_log
whether or not cdist's log has colors enabled.
Is set to the string true if cdist's output is using colors,
otherwise the variable contains the string false.
Available for: initial manifest, explorer, type manifest, type explorer,
type gencode.
__cdist_dry_run
Is set only when doing dry run (-n flag).
Available for: initial manifest, explorer, type manifest, type explorer,
type gencode.
__explorer
Directory that contains all global explorers.
Available for: initial manifest, explorer, type explorer, shell.
__files
Directory that contains content from the "files" subdirectories
from the configuration directories.
Available for: initial manifest, type manifest, type gencode, shell.
__manifest
Directory that contains the initial manifest.
Available for: initial manifest, type manifest, shell.
__global
Directory that contains generic output like explorer.
Available for: initial manifest, type manifest, type gencode, shell.
__messages_in
File to read messages from.
Available for: initial manifest, type manifest, type gencode.
__messages_out
File to write messages.
Available for: initial manifest, type manifest, type gencode.
__object
Directory that contains the current object.
Available for: type manifest, type explorer, type gencode and code scripts.
__object_id
The type unique object id.
Available for: type manifest, type explorer, type gencode and code scripts.
Note: The leading and the trailing "/" will always be stripped (caused by
the filesystem database and ensured by the core).
Note: Double slashes ("//") will not be fixed and result in an error.
| Note: The leading and the trailing "/" will always be stripped (caused by
the filesystem database and ensured by the core).
| Note: Double slashes ("//") will not be fixed and result in an error.
__object_name
The full qualified name of the current object.
Available for: type manifest, type explorer, type gencode.
__target_host
The host we are deploying to. This is primary variable. It's content is
literally the one user passed in.
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__target_hostname
The hostname of host we are deploying to. This variable is derived from
**__target_host** (using **socket.getaddrinfo(__target_host)** and then
**socket.gethostbyaddr()**).
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__target_fqdn
The fully qualified domain name of the host we are deploying to.
This variable is derived from **__target_host**
(using **socket.getfqdn()**).
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__target_host_tags
Comma separated list of target host tags.
Available for: explorer, initial manifest, type explorer, type manifest, type gencode, shell.
__type
Path to the current type.
Available for: type manifest, type gencode.
__type_explorer
Directory that contains the type explorers.
Available for: type explorer.
Environment variables (for writing)
@ -463,5 +487,10 @@ CDIST_INVENTORY_DIR
CDIST_BETA
Enable beta functionalities.
CDIST_COLORED_OUTPUT
Colorize cdist's output. If enabled, cdist will use different colors for
different log levels.
Recognized values are 'always', 'never', and 'auto' (the default).
CDIST_CACHE_PATH_PATTERN
Custom cache path pattern.

View file

@ -14,7 +14,7 @@ To upgrade cdist in the current branch use
make man
export MANPATH=$MANPATH:$(pwd -P)/doc/man
If you stay on a version branche (i.e. 1.0, 1.1., ...), nothing should break.
If you stay on a version branch (i.e. 1.0, 1.1., ...), nothing should break.
The master branch on the other hand is the development branch and may not be
working, break your setup or eat the tree in your garden.
@ -61,7 +61,7 @@ After that, you can go back and continue the upgrade:
Update the python package
-------------------------
To upgrade to the lastet version do
To upgrade to the latest version do
.. code-block:: sh
@ -158,7 +158,7 @@ Updating from 1.5 to 1.6
* If you used **\_\_package_apt --preseed**, you need to use the new
type **\_\_debconf_set_selections** instead.
* The **\_\_package** types accepted either --state deinstalled or
--state uninstaaled. Starting with 1.6, it was made consistently
--state uninstalled. Starting with 1.6, it was made consistently
to --state removed.
Updating from 1.3 to 1.5

View file

@ -21,7 +21,7 @@ Not only is shell scripting widely known by system engineers,
but it is also a very powerful language. Here are some features
which make daily work easy:
* Configuration can react dynamicly on explored values
* Configuration can react dynamically on explored values
* High level string manipulation (using sed, awk, grep)
* Conditional support (**if, case**)
* Loop support (**for, while**)
@ -44,7 +44,7 @@ Cdist requires very little on a target system. Even better,
in almost all cases all dependencies are usually fulfilled.
Cdist does not require an agent or high level programming
languages on the target host: it will run on any host that
has a **ssh server running** and a posix compatible shell
has a **ssh server running** and a POSIX compatible shell
(**/bin/sh**). Compared to other configuration management systems,
it does not require to open up an additional port.

View file

@ -15,52 +15,51 @@ SYNOPSIS
cdist banner [-h] [-l LOGLEVEL] [-q] [-v]
cdist config [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-g CONFIG_FILE] [-4]
[-6] [-C CACHE_PATH_PATTERN] [-c CONF_DIR] [-i MANIFEST]
[-j [JOBS]] [-n] [-o OUT_PATH] [-P]
[-R [{tar,tgz,tbz2,txz}]] [-r REMOTE_OUT_PATH]
[--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC]
[-S] [-I INVENTORY_DIR] [-A] [-a] [-f HOSTFILE]
[-p [HOST_MAX]] [-s] [-t]
cdist config [-h] [-l LOGLEVEL] [-q] [-v] [-b] [--colors WHEN]
[-g CONFIG_FILE] [-4] [-6] [-C CACHE_PATH_PATTERN]
[-c CONF_DIR] [-i MANIFEST] [-j [JOBS]] [--log-server]
[-n] [-o OUT_PATH] [-P] [-R [{tar,tgz,tbz2,txz}]]
[-r REMOTE_OUT_PATH] [--remote-copy REMOTE_COPY]
[--remote-exec REMOTE_EXEC] [-S] [-I INVENTORY_DIR] [-A]
[-a] [-f HOSTFILE] [-p [HOST_MAX]] [-s] [-t]
[host [host ...]]
cdist install [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-g CONFIG_FILE] [-4]
[-6] [-C CACHE_PATH_PATTERN] [-c CONF_DIR] [-i MANIFEST]
[-j [JOBS]] [-n] [-o OUT_PATH] [-P]
[-R [{tar,tgz,tbz2,txz}]] [-r REMOTE_OUT_PATH]
[--remote-copy REMOTE_COPY] [--remote-exec REMOTE_EXEC]
[-S] [-I INVENTORY_DIR] [-A] [-a] [-f HOSTFILE]
[-p [HOST_MAX]] [-s] [-t]
cdist install [-h] [-l LOGLEVEL] [-q] [-v] [-b] [--colors WHEN]
[-g CONFIG_FILE] [-4] [-6] [-C CACHE_PATH_PATTERN]
[-c CONF_DIR] [-i MANIFEST] [-j [JOBS]] [--log-server]
[-n] [-o OUT_PATH] [-P] [-R [{tar,tgz,tbz2,txz}]]
[-r REMOTE_OUT_PATH] [--remote-copy REMOTE_COPY]
[--remote-exec REMOTE_EXEC] [-S] [-I INVENTORY_DIR] [-A]
[-a] [-f HOSTFILE] [-p [HOST_MAX]] [-s] [-t]
[host [host ...]]
cdist inventory [-h] {add-host,add-tag,del-host,del-tag,list} ...
cdist inventory add-host [-h] [-l LOGLEVEL] [-q] [-v] [-b]
[-g CONFIG_FILE] [-I INVENTORY_DIR]
[-f HOSTFILE]
cdist inventory add-host [-h] [-l LOGLEVEL] [-q] [-v] [-b] [--colors WHEN]
[-g CONFIG_FILE] [-I INVENTORY_DIR] [-f HOSTFILE]
[host [host ...]]
cdist inventory add-tag [-h] [-l LOGLEVEL] [-q] [-v] [-b]
[-g CONFIG_FILE] [-I INVENTORY_DIR]
[-f HOSTFILE] [-T TAGFILE] [-t TAGLIST]
cdist inventory add-tag [-h] [-l LOGLEVEL] [-q] [-v] [-b] [--colors WHEN]
[-g CONFIG_FILE] [-I INVENTORY_DIR] [-f HOSTFILE]
[-T TAGFILE] [-t TAGLIST]
[host [host ...]]
cdist inventory del-host [-h] [-l LOGLEVEL] [-q] [-v] [-b]
cdist inventory del-host [-h] [-l LOGLEVEL] [-q] [-v] [-b] [--colors WHEN]
[-g CONFIG_FILE] [-I INVENTORY_DIR] [-a]
[-f HOSTFILE]
[host [host ...]]
cdist inventory del-tag [-h] [-l LOGLEVEL] [-q] [-v] [-b]
cdist inventory del-tag [-h] [-l LOGLEVEL] [-q] [-v] [-b] [--colors WHEN]
[-g CONFIG_FILE] [-I INVENTORY_DIR] [-a]
[-f HOSTFILE] [-T TAGFILE] [-t TAGLIST]
[host [host ...]]
cdist inventory list [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-g CONFIG_FILE]
[-I INVENTORY_DIR] [-a] [-f HOSTFILE] [-H] [-t]
cdist inventory list [-h] [-l LOGLEVEL] [-q] [-v] [-b] [--colors WHEN]
[-g CONFIG_FILE] [-I INVENTORY_DIR] [-a] [-f HOSTFILE]
[-H] [-t]
[host [host ...]]
cdist preos [-h] [-l LOGLEVEL] [-q] [-v] [-c CONF_DIR] [-g CONFIG_FILE]
[-L]
cdist preos [-h] [-l LOGLEVEL] [-q] [-v] [-c CONF_DIR] [-g CONFIG_FILE] [-L]
[preos] ...
cdist preos [preos-options] debian [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-a ARCH] [-B]
@ -87,9 +86,10 @@ SYNOPSIS
[-y REMOTE_COPY]
target_dir
cdist shell [-h] [-l LOGLEVEL] [-q] [-v] [-s SHELL]
cdist shell [-h] [-l LOGLEVEL] [-q] [-v] [--colors WHEN] [-s SHELL]
cdist info [-h] [-a] [-c CONF_DIR] [-e] [-F] [-f] [-g CONFIG_FILE] [-t] [pattern]
cdist info [-h] [-a] [-c CONF_DIR] [-e] [-F] [-f] [-g CONFIG_FILE] [-t]
[pattern]
cdist trigger [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-g CONFIG_FILE] [-4]
[-6] [-C CACHE_PATH_PATTERN] [-c CONF_DIR] [-i MANIFEST]
@ -105,7 +105,7 @@ cdist is the frontend executable to the cdist configuration management.
It supports different subcommands as explained below.
It is written in Python so it requires :strong:`python`\ (1) to be installed.
It requires a minimal Python version 3.2.
It requires a minimal Python version 3.5.
GENERAL
-------
@ -114,6 +114,14 @@ All commands accept the following options:
**-h, --help**
Show the help screen.
**--colors WHEN**
Colorize cdist's output. If enabled, cdist will use different colors for
different log levels.
WHEN recognizes the values 'always', 'never', and 'auto' (the default).
If the value is 'auto', colored output is enabled if stdout is a TTY
unless the NO_COLOR (https://no-color.org/) environment variable is defined.
**-l LOGLEVEL, --log-level LOGLEVEL**
Set the specified verbosity level. The levels, in
order from the lowest to the highest, are: ERROR (-1),
@ -166,7 +174,7 @@ Install command is currently in beta.
**-b, --beta**
Enable beta functionality.
**-C CACHE_PATH_PATTERN, --cache-path-pattern CACHE_PATH_PATTERN**
Specify custom cache path pattern. If it is not set then
default hostdir is used. For more info on format see
@ -189,7 +197,7 @@ Install command is currently in beta.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist
directory is set up by the following rules: if cdist
configuration resolves this value then specified
directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution
@ -204,6 +212,12 @@ Install command is currently in beta.
are supported. Without argument CPU count is used by
default.
**--log-server**
Start a log server for sub processes to use. This is
mainly useful when running cdist nested from a code-
local script. Log server is always implicitly started
for 'install' command.
**-n, --dry-run**
Do not execute code.
@ -304,7 +318,7 @@ Add host(s) to inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist
directory is set up by the following rules: if cdist
configuration resolves this value then specified
directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution
@ -334,7 +348,7 @@ Add tag(s) to inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist
directory is set up by the following rules: if cdist
configuration resolves this value then specified
directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution
@ -377,7 +391,7 @@ Delete host(s) from inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist
directory is set up by the following rules: if cdist
configuration resolves this value then specified
directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution
@ -411,7 +425,7 @@ Delete tag(s) from inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist
directory is set up by the following rules: if cdist
configuration resolves this value then specified
directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution
@ -458,7 +472,7 @@ List inventory database.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
directory is set up by the following rules: if cdist
directory is set up by the following rules: if cdist
configuration resolves this value then specified
directory is used, if HOME env var is set then
~/.cdit/inventory is used, otherwise distribution
@ -780,6 +794,9 @@ The possible keywords and their meanings are as follows:
:strong:`cache_path_pattern`
Specify cache path pattern.
:strong:`colored_output`
Colorize cdist's output. cf. the :code:`--colors` option.
:strong:`conf_dir`
List of configuration directories separated with the character conventionally
used by the operating system to separate search path components (as in PATH),
@ -833,7 +850,7 @@ The possible keywords and their meanings are as follows:
in the format: YYYYMMDDHHMMSS.us.
:strong:`verbosity`
Set verbosity level. Valid values are:
Set verbosity level. Valid values are:
'ERROR', 'WARNING', 'INFO', 'VERBOSE', 'DEBUG', 'TRACE' and 'OFF'.
@ -865,7 +882,7 @@ cdist/preos
NOTES
-----
cdist detects if host is specified by IPv6 address. If so then remote_copy
command is executed with host address enclosed in square brackets
command is executed with host address enclosed in square brackets
(see :strong:`scp`\ (1)).
EXAMPLES
@ -1008,6 +1025,9 @@ CDIST_BETA
CDIST_CACHE_PATH_PATTERN
Custom cache path pattern.
CDIST_COLORED_OUTPUT
Colorize cdist's output. cf. the :code:`--colors` option.
CDIST_CONFIG_FILE
Custom configuration file.
@ -1070,5 +1090,5 @@ such case and display a warning message. An example of such a case:
COPYING
-------
Copyright \(C) 2011-2019 Nico Schottelius. Free use of this software is
Copyright \(C) 2011-2020 Nico Schottelius. Free use of this software is
granted under the terms of the GNU General Public License v3 or later (GPLv3+).

View file

@ -10,7 +10,7 @@ DESCRIPTION
-----------
Remove files and directories which match the pattern.
Provided path (as __object_id) must be a directory.
Provided path must be a directory.
Patterns are passed to ``find``'s ``-regex`` - see ``find(1)`` for more details.
@ -29,6 +29,9 @@ pattern
OPTIONAL PARAMETERS
-------------------
path
Path which will be cleaned. Defaults to ``$__object_id``.
exclude
Pattern of files which are excluded from removal.
@ -46,6 +49,11 @@ EXAMPLES
--exclude '.+\(charset\.conf\|security\.conf\)' \
--onchange 'service apache2 restart'
__clean_path apache2-conf-enabled \
--path /etc/apache2/conf-enabled \
--pattern '.+' \
--exclude '.+\(charset\.conf\|security\.conf\)' \
--onchange 'service apache2 restart'
AUTHORS
-------

View file

@ -60,6 +60,9 @@ nofile
Don't manage existence, ownership and permissions of the the authorized_keys
file.
remove-unknown
Remove undefined keys.
EXAMPLES
--------
@ -70,6 +73,12 @@ EXAMPLES
__ssh_authorized_keys root \
--key "$(cat ~/.ssh/id_rsa.pub)"
# same as above, but make sure your key is only key in
# root's authorized_keys file
__ssh_authorized_keys root \
--key "$(cat ~/.ssh/id_rsa.pub)" \
--remove-unknown
# allow key to login as user-name
__ssh_authorized_keys user-name \
--key "ssh-rsa AXYZAAB3NzaC1yc2..."

View file

@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -81,10 +81,26 @@ div.sphinxsidebar input {
font-size: 1em;
}
div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
div.sphinxsidebar #searchbox form.search {
overflow: hidden;
}
div.sphinxsidebar #searchbox input[type="text"] {
float: left;
width: 80%;
padding: 0.25em;
box-sizing: border-box;
}
div.sphinxsidebar #searchbox input[type="submit"] {
float: left;
width: 20%;
border-left: none;
padding: 0.25em;
box-sizing: border-box;
}
img {
border: 0;
max-width: 100%;
@ -199,6 +215,11 @@ table.modindextable td {
/* -- general body styles --------------------------------------------------- */
div.body {
min-width: 450px;
max-width: 800px;
}
div.body p, div.body dd, div.body li, div.body blockquote {
-moz-hyphens: auto;
-ms-hyphens: auto;
@ -210,6 +231,16 @@ a.headerlink {
visibility: hidden;
}
a.brackets:before,
span.brackets > a:before{
content: "[";
}
a.brackets:after,
span.brackets > a:after {
content: "]";
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
@ -258,6 +289,12 @@ img.align-center, .figure.align-center, object.align-center {
margin-right: auto;
}
img.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left;
}
@ -266,6 +303,10 @@ img.align-center, .figure.align-center, object.align-center {
text-align: center;
}
.align-default {
text-align: center;
}
.align-right {
text-align: right;
}
@ -332,6 +373,16 @@ table.docutils {
border-collapse: collapse;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
table.align-default {
margin-left: auto;
margin-right: auto;
}
table caption span.caption-number {
font-style: italic;
}
@ -365,6 +416,16 @@ table.citation td {
border-bottom: none;
}
th > p:first-child,
td > p:first-child {
margin-top: 0px;
}
th > p:last-child,
td > p:last-child {
margin-bottom: 0px;
}
/* -- figures --------------------------------------------------------------- */
div.figure {
@ -405,6 +466,13 @@ table.field-list td, table.field-list th {
hyphens: manual;
}
/* -- hlist styles ---------------------------------------------------------- */
table.hlist td {
vertical-align: top;
}
/* -- other body styles ----------------------------------------------------- */
ol.arabic {
@ -427,11 +495,58 @@ ol.upperroman {
list-style: upper-roman;
}
li > p:first-child {
margin-top: 0px;
}
li > p:last-child {
margin-bottom: 0px;
}
dl.footnote > dt,
dl.citation > dt {
float: left;
}
dl.footnote > dd,
dl.citation > dd {
margin-bottom: 0em;
}
dl.footnote > dd:after,
dl.citation > dd:after {
content: "";
clear: both;
}
dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
}
dl.field-list > dt {
font-weight: bold;
word-break: break-word;
padding-left: 0.5em;
padding-right: 5px;
}
dl.field-list > dt:after {
content: ":";
}
dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
margin-left: 0em;
margin-bottom: 0em;
}
dl {
margin-bottom: 15px;
}
dd p {
dd > p:first-child {
margin-top: 0px;
}
@ -504,6 +619,12 @@ dl.glossary dt {
font-style: oblique;
}
.classifier:before {
font-style: normal;
margin: 0.5em;
content: ":";
}
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
@ -551,6 +672,10 @@ div.code-block-caption + div > div.highlight > pre {
margin-top: 0;
}
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
user-select: none;
}
div.code-block-caption span.caption-number {
padding: 0.1em 0.3em;
font-style: italic;

View file

@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@ -70,7 +70,9 @@ jQuery.fn.highlightText = function(text, className) {
if (node.nodeType === 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
if (pos >= 0 &&
!jQuery(node.parentNode).hasClass(className) &&
!jQuery(node.parentNode).hasClass("nohighlight")) {
var span;
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
if (isInSVG) {
@ -85,14 +87,13 @@ jQuery.fn.highlightText = function(text, className) {
node.nextSibling));
node.nodeValue = val.substr(0, pos);
if (isInSVG) {
var bbox = span.getBBox();
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
rect.x.baseVal.value = bbox.x;
var bbox = node.parentElement.getBBox();
rect.x.baseVal.value = bbox.x;
rect.y.baseVal.value = bbox.y;
rect.width.baseVal.value = bbox.width;
rect.height.baseVal.value = bbox.height;
rect.setAttribute('class', className);
var parentOfText = node.parentNode.parentNode;
addItems.push({
"parent": node.parentNode,
"target": rect});
@ -148,7 +149,9 @@ var Documentation = {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
this.initOnKeyListeners();
}
},
/**
@ -204,7 +207,7 @@ var Documentation = {
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash)
if (document.location.hash && $.browser.mozilla)
window.setTimeout(function() {
document.location.href += '';
}, 10);
@ -280,10 +283,11 @@ var Documentation = {
},
initOnKeyListeners: function() {
$(document).keyup(function(event) {
$(document).keydown(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box or textarea
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
&& !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
@ -308,4 +312,4 @@ _ = Documentation.gettext;
$(document).ready(function() {
Documentation.init();
});
});

View file

@ -1,296 +1,12 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '5.0.1',
VERSION: '6.6.0',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
LINK_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false,
SEARCH_LANGUAGE_STOP_WORDS: ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]
};
/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
var Stemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
};
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
}
}
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
var i, j, start, end;
for (i = 0; i < singles.length; i++) {
result[singles[i]] = true;
}
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
for (i = 0; i < ranges.length; i++) {
start = ranges[i][0];
end = ranges[i][1];
for (j = start; j <= end; j++) {
result[j] = true;
}
}
return result;
})();
function splitQuery(query) {
var result = [];
var start = -1;
for (var i = 0; i < query.length; i++) {
if (splitChars[query.charCodeAt(i)]) {
if (start !== -1) {
result.push(query.slice(start, i));
start = -1;
}
} else if (start === -1) {
start = i;
}
}
if (start !== -1) {
result.push(query.slice(start));
}
return result;
}
NAVIGATION_WITH_KEYS: false
};

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,297 @@
/*
* language_data.js
* ~~~~~~~~~~~~~~~~
*
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
var Stemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
};
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
}
}
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
var i, j, start, end;
for (i = 0; i < singles.length; i++) {
result[singles[i]] = true;
}
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
for (i = 0; i < ranges.length; i++) {
start = ranges[i][0];
end = ranges[i][1];
for (j = start; j <= end; j++) {
result[j] = true;
}
}
return result;
})();
function splitQuery(query) {
var result = [];
var start = -1;
for (var i = 0; i < query.length; i++) {
if (splitChars[query.charCodeAt(i)]) {
if (start !== -1) {
result.push(query.slice(start, i));
start = -1;
}
} else if (start === -1) {
start = i;
}
}
if (start !== -1) {
result.push(query.slice(start));
}
return result;
}

View file

@ -1,331 +1,54 @@
/*
* searchtools.js_t
* searchtools.js
* ~~~~~~~~~~~~~~~~
*
* Sphinx JavaScript utilities for the full-text search.
*
* :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
if (!Scorer) {
/**
* Simple result scoring code.
*/
var Scorer = {
// Implement the following function to further tweak the score for each result
// The function takes a result array [filename, title, anchor, descr, score]
// and returns the new score.
/*
score: function(result) {
return result[4];
},
*/
/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
var Stemmer = function() {
// query matches the full name of an object
objNameMatch: 11,
// or matches in the last dotted part of the object name
objPartialMatch: 6,
// Additive scores depending on the priority of the object
objPrio: {0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5}, // used to be unimportantResults
// Used when the priority is not in the mapping.
objPrioDefault: 0,
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
// query found in title
title: 15,
partialTitle: 7,
// query found in terms
term: 5,
partialTerm: 2
};
}
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
if (!splitQuery) {
function splitQuery(query) {
return query.split(/\s+/);
}
}
/**
* Simple result scoring code.
*/
var Scorer = {
// Implement the following function to further tweak the score for each result
// The function takes a result array [filename, title, anchor, descr, score]
// and returns the new score.
/*
score: function(result) {
return result[4];
},
*/
// query matches the full name of an object
objNameMatch: 11,
// or matches in the last dotted part of the object name
objPartialMatch: 6,
// Additive scores depending on the priority of the object
objPrio: {0: 15, // used to be importantResults
1: 5, // used to be objectResults
2: -5}, // used to be unimportantResults
// Used when the priority is not in the mapping.
objPrioDefault: 0,
// query found in title
title: 15,
// query found in terms
term: 5
};
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
var i, j, start, end;
for (i = 0; i < singles.length; i++) {
result[singles[i]] = true;
}
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
for (i = 0; i < ranges.length; i++) {
start = ranges[i][0];
end = ranges[i][1];
for (j = start; j <= end; j++) {
result[j] = true;
}
}
return result;
})();
function splitQuery(query) {
var result = [];
var start = -1;
for (var i = 0; i < query.length; i++) {
if (splitChars[query.charCodeAt(i)]) {
if (start !== -1) {
result.push(query.slice(start, i));
start = -1;
}
} else if (start === -1) {
start = i;
}
}
if (start !== -1) {
result.push(query.slice(start));
}
return result;
}
/**
* Search Module
*/
@ -335,6 +58,19 @@ var Search = {
_queued_query : null,
_pulse_status : -1,
htmlToText : function(htmlString) {
var htmlElement = document.createElement('span');
htmlElement.innerHTML = htmlString;
$(htmlElement).find('.headerlink').remove();
docContent = $(htmlElement).find('[role=main]')[0];
if(docContent === undefined) {
console.warn("Content block not found. Sphinx search tries to obtain it " +
"via '[role=main]'. Could you check your theme or template.");
return "";
}
return docContent.textContent || docContent.innerText;
},
init : function() {
var params = $.getQueryParameters();
if (params.q) {
@ -399,7 +135,7 @@ var Search = {
this.out = $('#search-results');
this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
this.dots = $('<span></span>').appendTo(this.title);
this.status = $('<p style="display: none"></p>').appendTo(this.out);
this.status = $('<p class="search-summary">&nbsp;</p>').appendTo(this.out);
this.output = $('<ul class="search"/>').appendTo(this.out);
$('#search-progress').text(_('Preparing search...'));
@ -417,7 +153,6 @@ var Search = {
*/
query : function(query) {
var i;
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
// stem the searchterms and add them to the correct list
var stemmer = new Stemmer();
@ -515,7 +250,9 @@ var Search = {
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
var requestUrl = "";
var linkUrl = "";
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
// dirhtml builder
var dirname = item[0] + '/';
if (dirname.match(/\/index\/$/)) {
@ -523,15 +260,17 @@ var Search = {
} else if (dirname == 'index/') {
dirname = '';
}
listItem.append($('<a/>').attr('href',
DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
highlightstring + item[2]).html(item[1]));
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
listItem.append($('<a/>').attr('href',
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
highlightstring + item[2]).html(item[1]));
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
}
listItem.append($('<a/>').attr('href',
linkUrl +
highlightstring + item[2]).html(item[1]));
if (item[3]) {
listItem.append($('<span> (' + item[3] + ')</span>'));
Search.output.append(listItem);
@ -539,11 +278,7 @@ var Search = {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
if (suffix === undefined) {
suffix = '.txt';
}
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
$.ajax({url: requestUrl,
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;
@ -593,12 +328,13 @@ var Search = {
for (var prefix in objects) {
for (var name in objects[prefix]) {
var fullname = (prefix ? prefix + '.' : '') + name;
if (fullname.toLowerCase().indexOf(object) > -1) {
var fullnameLower = fullname.toLowerCase()
if (fullnameLower.indexOf(object) > -1) {
var score = 0;
var parts = fullname.split('.');
var parts = fullnameLower.split('.');
// check for different match types: exact matches of full name or
// "last name" (i.e. last dotted part)
if (fullname == object || parts[parts.length - 1] == object) {
if (fullnameLower == object || parts[parts.length - 1] == object) {
score += Scorer.objNameMatch;
// matches in last name
} else if (parts[parts.length - 1].indexOf(object) > -1) {
@ -665,6 +401,19 @@ var Search = {
{files: terms[word], score: Scorer.term},
{files: titleterms[word], score: Scorer.title}
];
// add support for partial matches
if (word.length > 2) {
for (var w in terms) {
if (w.match(word) && !terms[word]) {
_o.push({files: terms[w], score: Scorer.partialTerm})
}
}
for (var w in titleterms) {
if (w.match(word) && !titleterms[word]) {
_o.push({files: titleterms[w], score: Scorer.partialTitle})
}
}
}
// no match but word was a required one
if ($u.every(_o, function(o){return o.files === undefined;})) {
@ -684,7 +433,7 @@ var Search = {
for (j = 0; j < _files.length; j++) {
file = _files[j];
if (!(file in scoreMap))
scoreMap[file] = {}
scoreMap[file] = {};
scoreMap[file][word] = o.score;
}
});
@ -692,7 +441,7 @@ var Search = {
// create the mapping
for (j = 0; j < files.length; j++) {
file = files[j];
if (file in fileMap)
if (file in fileMap && fileMap[file].indexOf(word) === -1)
fileMap[file].push(word);
else
fileMap[file] = [word];
@ -704,8 +453,12 @@ var Search = {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
continue;
var filteredTermCount = // as search terms with length < 3 are discarded: ignore
searchterms.filter(function(term){return term.length > 2}).length
if (
fileMap[file].length != searchterms.length &&
fileMap[file].length != filteredTermCount
) continue;
// ensure that none of the excluded terms is in the search result
for (i = 0; i < excluded.length; i++) {
@ -736,7 +489,8 @@ var Search = {
* words. the first one is used to find the occurrence, the
* latter for highlighting it.
*/
makeSearchSummary : function(text, keywords, hlwords) {
makeSearchSummary : function(htmlText, keywords, hlwords) {
var text = Search.htmlToText(htmlText);
var textLower = text.toLowerCase();
var start = 0;
$.each(keywords, function() {
@ -758,4 +512,4 @@ var Search = {
$(document).ready(function() {
Search.init();
});
});

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>25. Best practice &mdash; cdist 6.5.6 documentation</title>
<title>25. Best practice &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -189,7 +180,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>25. Best practice</li>
<li><span class="section-number">25. </span>Best practice</li>
<li class="wy-breadcrumbs-aside">
@ -209,17 +200,17 @@
<div itemprop="articleBody">
<div class="section" id="best-practice">
<h1>25. Best practice<a class="headerlink" href="#best-practice" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">25. </span>Best practice<a class="headerlink" href="#best-practice" title="Permalink to this headline"></a></h1>
<p>Practices used in real environments</p>
<div class="section" id="passwordless-connections">
<h2>25.1. Passwordless connections<a class="headerlink" href="#passwordless-connections" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.1. </span>Passwordless connections<a class="headerlink" href="#passwordless-connections" title="Permalink to this headline"></a></h2>
<p>It is recommended to run cdist with public key authentication.
This requires a private/public key pair and the entry
&quot;PermitRootLogin without-password&quot; in the sshd server.
See sshd_config(5) and ssh-keygen(1).</p>
</div>
<div class="section" id="speeding-up-ssh-connections">
<h2>25.2. Speeding up ssh connections<a class="headerlink" href="#speeding-up-ssh-connections" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.2. </span>Speeding up ssh connections<a class="headerlink" href="#speeding-up-ssh-connections" title="Permalink to this headline"></a></h2>
<p>When connecting to a new host, the initial delay with ssh connections
is pretty big. As cdist makes many connections to each host successive
connections can be sped up by &quot;sharing of multiple sessions over a single
@ -233,21 +224,21 @@ parallel multiplexed connections this with <cite>MaxSessions N</cite> (N default
for OpenSSH v7.4).</p>
</div>
<div class="section" id="speeding-up-shell-execution">
<h2>25.3. Speeding up shell execution<a class="headerlink" href="#speeding-up-shell-execution" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.3. </span>Speeding up shell execution<a class="headerlink" href="#speeding-up-shell-execution" title="Permalink to this headline"></a></h2>
<p>On the source host, ensure that /bin/sh is <em>not</em> bash: bash is quite slow for
script execution. Instead, you could use dash after installing it:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">ln</span> <span class="o">-</span><span class="n">sf</span> <span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">dash</span> <span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">sh</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ln</span> <span class="o">-</span><span class="n">sf</span> <span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">dash</span> <span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">sh</span>
</pre></div>
</div>
</div>
<div class="section" id="multi-master-or-environment-setups">
<h2>25.4. Multi master or environment setups<a class="headerlink" href="#multi-master-or-environment-setups" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.4. </span>Multi master or environment setups<a class="headerlink" href="#multi-master-or-environment-setups" title="Permalink to this headline"></a></h2>
<p>If you plan to distribute cdist among servers or use different
environments, you can do so easily with the included version
control git. For instance if you plan to use the typical three
environments production, integration and development, you can
realise this with git branches:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Go to cdist checkout</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Go to cdist checkout</span>
<span class="n">cd</span> <span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">cdist</span>
<span class="c1"># Create branches</span>
@ -261,18 +252,18 @@ realise this with git branches:</p>
</div>
<p>Similar if you want to have cdist checked out at multiple machines,
you can clone it multiple times:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">machine</span><span class="o">-</span><span class="n">a</span> <span class="o">%</span> <span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="p">:</span><span class="o">//</span><span class="n">your</span><span class="o">-</span><span class="n">git</span><span class="o">-</span><span class="n">server</span><span class="o">/</span><span class="n">cdist</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">machine</span><span class="o">-</span><span class="n">a</span> <span class="o">%</span> <span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="p">:</span><span class="o">//</span><span class="n">your</span><span class="o">-</span><span class="n">git</span><span class="o">-</span><span class="n">server</span><span class="o">/</span><span class="n">cdist</span>
<span class="n">machine</span><span class="o">-</span><span class="n">b</span> <span class="o">%</span> <span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="p">:</span><span class="o">//</span><span class="n">your</span><span class="o">-</span><span class="n">git</span><span class="o">-</span><span class="n">server</span><span class="o">/</span><span class="n">cdist</span>
</pre></div>
</div>
</div>
<div class="section" id="separating-work-by-groups">
<h2>25.5. Separating work by groups<a class="headerlink" href="#separating-work-by-groups" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.5. </span>Separating work by groups<a class="headerlink" href="#separating-work-by-groups" title="Permalink to this headline"></a></h2>
<p>If you are working with different groups on one cdist-configuration,
you can delegate to other manifests and have the groups edit only
their manifests. You can use the following snippet in
<strong>conf/manifests/init</strong>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Include other groups</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Include other groups</span>
<span class="n">sh</span> <span class="o">-</span><span class="n">e</span> <span class="s2">&quot;$__manifest/systems&quot;</span>
<span class="n">sh</span> <span class="o">-</span><span class="n">e</span> <span class="s2">&quot;$__manifest/cbrg&quot;</span>
@ -280,11 +271,11 @@ their manifests. You can use the following snippet in
</div>
</div>
<div class="section" id="maintaining-multiple-configurations">
<h2>25.6. Maintaining multiple configurations<a class="headerlink" href="#maintaining-multiple-configurations" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.6. </span>Maintaining multiple configurations<a class="headerlink" href="#maintaining-multiple-configurations" title="Permalink to this headline"></a></h2>
<p>When you need to manage multiple sites with cdist, like company_a, company_b
and private for instance, you can easily use git for this purpose.
Including a possible common base that is reused across the different sites:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># create branches</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># create branches</span>
<span class="n">git</span> <span class="n">branch</span> <span class="n">company_a</span> <span class="n">company_b</span> <span class="n">common</span> <span class="n">private</span>
<span class="c1"># make stuff for company a</span>
@ -305,7 +296,7 @@ Including a possible common base that is reused across the different sites:</p>
</pre></div>
</div>
<p>The following <strong>.git/config</strong> is taken from a real world scenario:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Track upstream, merge from time to time</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Track upstream, merge from time to time</span>
<span class="p">[</span><span class="n">remote</span> <span class="s2">&quot;upstream&quot;</span><span class="p">]</span>
<span class="n">url</span> <span class="o">=</span> <span class="n">git</span><span class="p">:</span><span class="o">//</span><span class="n">git</span><span class="o">.</span><span class="n">schottelius</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">cdist</span>
<span class="n">fetch</span> <span class="o">=</span> <span class="o">+</span><span class="n">refs</span><span class="o">/</span><span class="n">heads</span><span class="o">/*</span><span class="p">:</span><span class="n">refs</span><span class="o">/</span><span class="n">remotes</span><span class="o">/</span><span class="n">upstream</span><span class="o">/*</span>
@ -339,23 +330,19 @@ Including a possible common base that is reused across the different sites:</p>
<p>Have a look at git-remote(1) to adjust the remote configuration, which allows</p>
</div>
<div class="section" id="multiple-developers-with-different-trust">
<h2>25.7. Multiple developers with different trust<a class="headerlink" href="#multiple-developers-with-different-trust" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.7. </span>Multiple developers with different trust<a class="headerlink" href="#multiple-developers-with-different-trust" title="Permalink to this headline"></a></h2>
<p>If you are working in an environment that requires different people to
work on the same configuration, but having different privileges, you can
implement this scenario with a gateway host and sudo:</p>
<ul>
<li><p class="first">Create a dedicated user (for instance <strong>cdist</strong>)</p>
</li>
<li><p class="first">Setup the ssh-pubkey for this user that has the right to configure all hosts</p>
</li>
<li><p class="first">Create a wrapper to update the cdist configuration in ~cdist/cdist</p>
</li>
<li><p class="first">Allow every developer to execute this script via sudo as the user cdist</p>
</li>
<li><p class="first">Allow run of cdist as user cdist on specific hosts on a per user/group basis.</p>
<li><p>Create a dedicated user (for instance <strong>cdist</strong>)</p></li>
<li><p>Setup the ssh-pubkey for this user that has the right to configure all hosts</p></li>
<li><p>Create a wrapper to update the cdist configuration in ~cdist/cdist</p></li>
<li><p>Allow every developer to execute this script via sudo as the user cdist</p></li>
<li><p>Allow run of cdist as user cdist on specific hosts on a per user/group basis.</p>
<blockquote>
<div><ul class="simple">
<li>f.i. nico ALL=(ALL) NOPASSWD: /home/cdist/bin/cdist config hostabc</li>
<li><p>f.i. nico ALL=(ALL) NOPASSWD: /home/cdist/bin/cdist config hostabc</p></li>
</ul>
</div></blockquote>
</li>
@ -363,12 +350,12 @@ implement this scenario with a gateway host and sudo:</p>
<p>For more details consult sudoers(5)</p>
</div>
<div class="section" id="templating">
<h2>25.8. Templating<a class="headerlink" href="#templating" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.8. </span>Templating<a class="headerlink" href="#templating" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li>create directory files/ in your type (convention)</li>
<li>create the template as an executable file like files/basic.conf.sh, it will output text using shell variables for the values</li>
<li><p>create directory files/ in your type (convention)</p></li>
<li><p>create the template as an executable file like files/basic.conf.sh, it will output text using shell variables for the values</p></li>
</ul>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="ch">#!/bin/sh</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/bin/sh</span>
<span class="c1"># in the template, use cat &lt;&lt; eof (here document) to output the text</span>
<span class="c1"># and use standard shell variables in the template</span>
<span class="c1"># output everything in the template script to stdout</span>
@ -385,9 +372,9 @@ cat <span class="s">&lt;&lt; EOF</span>
</pre></div>
</div>
<ul class="simple">
<li>in the manifest, export the relevant variables and add the following lines to your manifest:</li>
<li><p>in the manifest, export the relevant variables and add the following lines to your manifest:</p></li>
</ul>
<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">#</span> <span class="nb">export</span> variables needed <span class="k">for</span> the template
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">#</span> <span class="nb">export</span> variables needed <span class="k">for</span> the template
<span class="go"> export SERVERNAME=&#39;test&quot;</span>
<span class="go"> export ROOT=&#39;/var/www/test&#39;</span>
<span class="gp">#</span> render the template
@ -401,12 +388,12 @@ cat <span class="s">&lt;&lt; EOF</span>
</div>
</div>
<div class="section" id="testing-a-new-type">
<h2>25.9. Testing a new type<a class="headerlink" href="#testing-a-new-type" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.9. </span>Testing a new type<a class="headerlink" href="#testing-a-new-type" title="Permalink to this headline"></a></h2>
<p>If you want to test a new type on a node, you can tell cdist to only use an
object of this type: Use the '--initial-manifest' parameter
with - (stdin) as argument and feed object into stdin
of cdist:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Singleton type without parameter</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Singleton type without parameter</span>
<span class="nb">echo</span> __ungleich_munin_server <span class="p">|</span> cdist --initial-manifest - munin.panter.ch
<span class="c1"># Singleton type with parameter</span>
@ -420,7 +407,7 @@ of cdist:</p>
</div>
</div>
<div class="section" id="other-content-in-cdist-repository">
<h2>25.10. Other content in cdist repository<a class="headerlink" href="#other-content-in-cdist-repository" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.10. </span>Other content in cdist repository<a class="headerlink" href="#other-content-in-cdist-repository" title="Permalink to this headline"></a></h2>
<p>Usually the cdist repository contains all configuration
items. Sometimes you may have additional resources that
you would like to store in your central configuration
@ -433,7 +420,7 @@ and also to store all important files in one
repository.</p>
</div>
<div class="section" id="notes-on-cdist-order-dependency">
<h2>25.11. Notes on CDIST_ORDER_DEPENDENCY<a class="headerlink" href="#notes-on-cdist-order-dependency" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">25.11. </span>Notes on CDIST_ORDER_DEPENDENCY<a class="headerlink" href="#notes-on-cdist-order-dependency" title="Permalink to this headline"></a></h2>
<p>With CDIST_ORDER_DEPENDENCY all types are executed in the order in which they
are created in the manifest. The current created object automatically depends
on the previously created object.</p>
@ -441,11 +428,11 @@ on the previously created object.</p>
(like first creating the directory xyz than the file below the directory).</p>
<p>This can be helpful, but one must be aware of its side effects.</p>
<div class="section" id="cdist-order-dependency-kills-parallelization">
<h3>25.11.1. CDIST_ORDER_DEPENDENCY kills parallelization<a class="headerlink" href="#cdist-order-dependency-kills-parallelization" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">25.11.1. </span>CDIST_ORDER_DEPENDENCY kills parallelization<a class="headerlink" href="#cdist-order-dependency-kills-parallelization" title="Permalink to this headline"></a></h3>
<p>Suppose you have defined CDIST_ORDER_DEPENDENCY and then, among other things,
you specify creation of three, by nature independent, files.</p>
<p><strong>init</strong></p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
<span class="nb">export</span> CDIST_ORDER_DEPENDENCY
...
@ -458,7 +445,7 @@ __file /tmp/file3
<p>Due to defined CDIST_ORDER_DEPENDENCY cdist will execute them in specified order.
It is better to use CDIST_ORDER_DEPENDENCY in well defined blocks:</p>
<p><strong>init</strong></p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
<span class="nb">export</span> CDIST_ORDER_DEPENDENCY
...
<span class="nb">unset</span> CDIST_ORDER_DEPENDENCY

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>12. Bootstrap &mdash; cdist 6.5.6 documentation</title>
<title>12. Bootstrap &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -179,7 +170,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>12. Bootstrap</li>
<li><span class="section-number">12. </span>Bootstrap</li>
<li class="wy-breadcrumbs-aside">
@ -199,12 +190,12 @@
<div itemprop="articleBody">
<div class="section" id="bootstrap">
<h1>12. Bootstrap<a class="headerlink" href="#bootstrap" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">12. </span>Bootstrap<a class="headerlink" href="#bootstrap" title="Permalink to this headline"></a></h1>
<p>This document describes the usual steps recommended for a new
cdist setup. It is recommended that you have read and understood
<a class="reference external" href="cdist-quickstart.html">cdist quickstart</a> before digging into this.</p>
<div class="section" id="location">
<h2>12.1. Location<a class="headerlink" href="#location" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">12.1. </span>Location<a class="headerlink" href="#location" title="Permalink to this headline"></a></h2>
<p>First of all, you should think about where to store your configuration
database and who will be accessing or changing it. Secondly you have to
think about where to configure your hosts from, which may be a different
@ -218,16 +209,16 @@ with others.</p>
people, have a look at <a class="reference external" href="cdist-best-practice.html">cdist best practice</a>.</p>
</div>
<div class="section" id="setup-working-directory-and-branch">
<h2>12.2. Setup working directory and branch<a class="headerlink" href="#setup-working-directory-and-branch" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">12.2. </span>Setup working directory and branch<a class="headerlink" href="#setup-working-directory-and-branch" title="Permalink to this headline"></a></h2>
<p>I assume you have a fresh copy of the cdist tree in ~/cdist, cloned from
one of the official urls (see <a class="reference external" href="cdist-quickstart.html">cdist quickstart</a> if you don't).
one of the official URLs (see <a class="reference external" href="cdist-quickstart.html">cdist quickstart</a> if you don't).
Entering the command &quot;git branch&quot; should show you &quot;* master&quot;, which indicates
you are on the <strong>master</strong> branch.</p>
<p>The master branch reflects the latest development of cdist. As this is the
development branch, it may or may not work. There are also version branches
available, which are kept in a stable state. Let's use <strong>git branch -r</strong>
to list all branches:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cdist</span><span class="o">%</span> <span class="n">git</span> <span class="n">branch</span> <span class="o">-</span><span class="n">r</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cdist</span><span class="o">%</span> <span class="n">git</span> <span class="n">branch</span> <span class="o">-</span><span class="n">r</span>
<span class="n">origin</span><span class="o">/</span><span class="mf">1.0</span>
<span class="n">origin</span><span class="o">/</span><span class="mf">1.1</span>
<span class="n">origin</span><span class="o">/</span><span class="mf">1.2</span>
@ -255,7 +246,7 @@ your own work. Now it's time to create your branch, which contains your
local changes. I usually name it by the company/area I am working for:
ethz-systems, localch, customerX, ... But this is pretty much up to you.</p>
<p>In this tutorial I use the branch <strong>mycompany</strong>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cdist</span><span class="o">%</span> <span class="n">git</span> <span class="n">checkout</span> <span class="o">-</span><span class="n">b</span> <span class="n">mycompany</span> <span class="n">origin</span><span class="o">/</span><span class="n">master</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cdist</span><span class="o">%</span> <span class="n">git</span> <span class="n">checkout</span> <span class="o">-</span><span class="n">b</span> <span class="n">mycompany</span> <span class="n">origin</span><span class="o">/</span><span class="n">master</span>
<span class="n">Branch</span> <span class="n">mycompany</span> <span class="nb">set</span> <span class="n">up</span> <span class="n">to</span> <span class="n">track</span> <span class="n">remote</span> <span class="n">branch</span> <span class="n">master</span> <span class="kn">from</span> <span class="nn">origin.</span>
<span class="n">Switched</span> <span class="n">to</span> <span class="n">a</span> <span class="n">new</span> <span class="n">branch</span> <span class="s1">&#39;mycompany&#39;</span>
<span class="n">cdist</span><span class="o">-</span><span class="n">user</span><span class="o">%</span> <span class="n">git</span> <span class="n">branch</span>
@ -266,13 +257,13 @@ ethz-systems, localch, customerX, ... But this is pretty much up to you.</p>
<p>From now on, you can use git as usual to commit your changes in your own branch.</p>
</div>
<div class="section" id="publishing-the-configuration">
<h2>12.3. Publishing the configuration<a class="headerlink" href="#publishing-the-configuration" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">12.3. </span>Publishing the configuration<a class="headerlink" href="#publishing-the-configuration" title="Permalink to this headline"></a></h2>
<p>Usually a development machine like a notebook should be considered
temporary only. For this reason and to enable shareability, the configuration
should be published to another device as early as possible. The following
example shows how to publish the configuration to another host that is
reachable via ssh and has git installed:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Create bare git repository on the host named &quot;loch&quot;</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Create bare git repository on the host named &quot;loch&quot;</span>
<span class="n">cdist</span><span class="o">%</span> <span class="n">ssh</span> <span class="n">loch</span> <span class="s2">&quot;GIT_DIR=/home/nutzer/cdist git init&quot;</span>
<span class="n">Initialized</span> <span class="n">empty</span> <span class="n">Git</span> <span class="n">repository</span> <span class="ow">in</span> <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">nutzer</span><span class="o">/</span><span class="n">cdist</span><span class="o">/</span>
@ -294,9 +285,9 @@ branch with the <strong>master</strong> branch on the host <strong>loch</strong>
as usual in your branch and push out changes by entering <strong>git push</strong>.</p>
</div>
<div class="section" id="updating-from-origin">
<h2>12.4. Updating from origin<a class="headerlink" href="#updating-from-origin" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">12.4. </span>Updating from origin<a class="headerlink" href="#updating-from-origin" title="Permalink to this headline"></a></h2>
<p>Whenever you want to update your cdist installation, you can use git to do so:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Update git repository with latest changes from origin</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Update git repository with latest changes from origin</span>
<span class="n">cdist</span><span class="o">%</span> <span class="n">git</span> <span class="n">fetch</span> <span class="n">origin</span>
<span class="c1"># Update current branch with master branch from origin</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>27. Local cache overview &mdash; cdist 6.5.6 documentation</title>
<title>27. Local cache overview &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -180,7 +171,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>27. Local cache overview</li>
<li><span class="section-number">27. </span>Local cache overview</li>
<li class="wy-breadcrumbs-aside">
@ -200,9 +191,9 @@
<div itemprop="articleBody">
<div class="section" id="local-cache-overview">
<h1>27. Local cache overview<a class="headerlink" href="#local-cache-overview" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">27. </span>Local cache overview<a class="headerlink" href="#local-cache-overview" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>27.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">27.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>While executing, cdist stores data to local cache. Currently this feature is
one way only. That means that cdist does not use stored data for future runs.
Anyway, those data can be used for debugging cdist, debugging types and
@ -216,64 +207,64 @@ environment variable.</p>
section in cdist man page.</p>
</div>
<div class="section" id="cache-overview">
<h2>27.2. Cache overview<a class="headerlink" href="#cache-overview" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">27.2. </span>Cache overview<a class="headerlink" href="#cache-overview" title="Permalink to this headline"></a></h2>
<p>As noted above each configured host has got its subdirectory in local cache.
Entries in host's cache directory are as follows.</p>
<dl class="docutils">
<dt>bin</dt>
<dd>directory with cdist type emulators</dd>
<dt>conf</dt>
<dd>dynamically determined cdist conf directory, union of all specified
conf directories</dd>
<dt>explorer</dt>
<dd>directory containing global explorer named files containing explorer output
after running on target host</dd>
<dt>messages</dt>
<dd>file containing messages</dd>
<dt>object</dt>
<dd>directory containing subdirectory for each cdist object</dd>
<dt>object_marker</dt>
<dd>object marker for this particular cdist run</dd>
<dt>stderr</dt>
<dd>directory containing init manifest and remote stderr stream output</dd>
<dt>stdout</dt>
<dd>directory containing init manifest and remote stdout stream output</dd>
<dt>target_host</dt>
<dd>file containing target host of this cdist run, as specified when running
cdist</dd>
<dt>typeorder</dt>
<dd>file containing types in order of execution.</dd>
<dl class="simple">
<dt>bin</dt><dd><p>directory with cdist type emulators</p>
</dd>
<dt>conf</dt><dd><p>dynamically determined cdist conf directory, union of all specified
conf directories</p>
</dd>
<dt>explorer</dt><dd><p>directory containing global explorer named files containing explorer output
after running on target host</p>
</dd>
<dt>messages</dt><dd><p>file containing messages</p>
</dd>
<dt>object</dt><dd><p>directory containing subdirectory for each cdist object</p>
</dd>
<dt>object_marker</dt><dd><p>object marker for this particular cdist run</p>
</dd>
<dt>stderr</dt><dd><p>directory containing init manifest and remote stderr stream output</p>
</dd>
<dt>stdout</dt><dd><p>directory containing init manifest and remote stdout stream output</p>
</dd>
<dt>target_host</dt><dd><p>file containing target host of this cdist run, as specified when running
cdist</p>
</dd>
<dt>typeorder</dt><dd><p>file containing types in order of execution.</p>
</dd>
</dl>
<div class="section" id="object-cache-overview">
<h3>27.2.1. Object cache overview<a class="headerlink" href="#object-cache-overview" title="Permalink to this headline"></a></h3>
<p>Each object under <strong>object</strong> directory has its own structurue.</p>
<dl class="docutils">
<dt>code-local</dt>
<dd>code generated from gencode-local, present only if something is
generated</dd>
<dt>code-remote</dt>
<dd>code generated from gencode-remote, present only if something is
generated</dd>
<dt>explorer</dt>
<dd>directory containing type explorer named files containing explorer output
after running on target host</dd>
<dt>files</dt>
<dd>directory with object files created during type execution</dd>
<dt>parameter</dt>
<dd>directory containing type parameter named files containing parameter
values</dd>
<dt>source</dt>
<dd>this type's source (init manifest)</dd>
<dt>state</dt>
<dd>this type execution state ('done' when finished)</dd>
<dt>stderr</dt>
<dd>directory containing type's manifest, gencode-* and code-* stderr stream
outputs</dd>
<dt>stdin</dt>
<dd>this type stdin content</dd>
<dt>stdout</dt>
<dd>directory containing type's manifest, gencode-* and code-* stdout stream
outputs.</dd>
<h3><span class="section-number">27.2.1. </span>Object cache overview<a class="headerlink" href="#object-cache-overview" title="Permalink to this headline"></a></h3>
<p>Each object under <strong>object</strong> directory has its own structure.</p>
<dl class="simple">
<dt>code-local</dt><dd><p>code generated from gencode-local, present only if something is
generated</p>
</dd>
<dt>code-remote</dt><dd><p>code generated from gencode-remote, present only if something is
generated</p>
</dd>
<dt>explorer</dt><dd><p>directory containing type explorer named files containing explorer output
after running on target host</p>
</dd>
<dt>files</dt><dd><p>directory with object files created during type execution</p>
</dd>
<dt>parameter</dt><dd><p>directory containing type parameter named files containing parameter
values</p>
</dd>
<dt>source</dt><dd><p>this type's source (init manifest)</p>
</dd>
<dt>state</dt><dd><p>this type execution state ('done' when finished)</p>
</dd>
<dt>stderr</dt><dd><p>directory containing type's manifest, gencode-* and code-* stderr stream
outputs</p>
</dd>
<dt>stdin</dt><dd><p>this type stdin content</p>
</dd>
<dt>stdout</dt><dd><p>directory containing type's manifest, gencode-* and code-* stdout stream
outputs.</p>
</dd>
</dl>
</div>
</div>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>13. Configuration &mdash; cdist 6.5.6 documentation</title>
<title>13. Configuration &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -177,7 +168,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>13. Configuration</li>
<li><span class="section-number">13. </span>Configuration</li>
<li class="wy-breadcrumbs-aside">
@ -197,20 +188,20 @@
<div itemprop="articleBody">
<div class="section" id="configuration">
<h1>13. Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">13. </span>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>13.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">13.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>cdist obtains configuration data from the following sources in the following
order:</p>
<blockquote>
<div><ol class="arabic simple">
<li>command-line options</li>
<li>configuration file specified at command-line using -g command line option</li>
<li>configuration file specified in CDIST_CONFIG_FILE environment variable</li>
<li>environment variables</li>
<li>user's configuration file (first one found of ~/.cdist.cfg, $XDG_CONFIG_HOME/cdist/cdist.cfg, in specified order)</li>
<li>in-distribution configuration file (cdist/conf/cdist.cfg)</li>
<li>system-wide configuration file (/etc/cdist.cfg)</li>
<li><p>command-line options</p></li>
<li><p>configuration file specified at command-line using -g command line option</p></li>
<li><p>configuration file specified in CDIST_CONFIG_FILE environment variable</p></li>
<li><p>environment variables</p></li>
<li><p>user's configuration file (first one found of ~/.cdist.cfg, $XDG_CONFIG_HOME/cdist/cdist.cfg, in specified order)</p></li>
<li><p>in-distribution configuration file (cdist/conf/cdist.cfg)</p></li>
<li><p>system-wide configuration file (/etc/cdist.cfg)</p></li>
</ol>
</div></blockquote>
<p>if one exists.</p>
@ -218,7 +209,7 @@ order:</p>
precedence. Configuration option value read from source with higher
precedence will overwrite option value, if exists, read from source with
lower precedence. That means that command-line option wins them all.</p>
<p>Users can decide on the local conifguration file location. It can be either
<p>Users can decide on the local configuration file location. It can be either
~/.cdist.cfg or $XDG_CONFIG_HOME/cdist/cdist.cfg. Note that, if both exist,
then ~/.cdist.cfg is used.</p>
<p>For a per-project configuration, particular environment variables or better,
@ -226,11 +217,11 @@ CDIST_CONFIG_FILE environment variable or -g CONFIG_FILE command line option,
can be used.</p>
</div>
<div class="section" id="config-file-format">
<h2>13.2. Config file format<a class="headerlink" href="#config-file-format" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">13.2. </span>Config file format<a class="headerlink" href="#config-file-format" title="Permalink to this headline"></a></h2>
<p>cdist configuration file is in the INI file format. Currently it supports
only [GLOBAL] section.</p>
<p>Here you can find configuration file skeleton:</p>
<div class="highlight-ini"><div class="highlight"><pre><span></span><span class="k">[GLOBAL]</span>
<div class="highlight-ini notranslate"><div class="highlight"><pre><span></span><span class="k">[GLOBAL]</span>
<span class="c1"># archiving</span>
<span class="c1"># Use specified archiving. Valid values include:</span>
<span class="c1"># none, tar, tgz, tbz2 and txz.</span>
@ -245,6 +236,14 @@ only [GLOBAL] section.</p>
<span class="c1"># Specify cache path pattern.</span>
<span class="c1"># cache_path_pattern = %h</span>
<span class="c1">#</span>
<span class="c1"># colored_output</span>
<span class="c1"># Colorize cdist&#39;s output. If enabled, cdist will use different colors for</span>
<span class="c1"># different log levels.</span>
<span class="c1"># Recognized values are &#39;always&#39;, &#39;never&#39;, and &#39;auto&#39;.</span>
<span class="c1"># If the value is &#39;auto&#39;, colors are enabled if stdout is a TTY unless</span>
<span class="c1"># the NO_COLOR (https://no-color.org/) environment variable is defined.</span>
<span class="c1"># colored_output = auto</span>
<span class="c1">#</span>
<span class="c1"># conf_dir</span>
<span class="c1"># List of configuration directories separated with the character conventionally</span>
<span class="c1"># used by the operating system to separate search path components (as in PATH),</span>
@ -277,7 +276,7 @@ only [GLOBAL] section.</p>
<span class="c1">#</span>
<span class="c1"># out_path</span>
<span class="c1"># Directory to save cdist output in.</span>
<span class="c1"># out_path = </span>
<span class="c1"># out_path =</span>
<span class="c1">#</span>
<span class="c1"># parallel</span>
<span class="c1"># Process hosts in parallel. If -1 then the default, number of CPU&#39;s in</span>
@ -303,7 +302,7 @@ only [GLOBAL] section.</p>
<span class="c1"># remote_shell = /bin/sh</span>
<span class="c1">#</span>
<span class="c1"># verbosity</span>
<span class="c1"># Set verbosity level. Valid values are: </span>
<span class="c1"># Set verbosity level. Valid values are:</span>
<span class="c1"># ERROR, WARNING, INFO, VERBOSE, DEBUG, TRACE and OFF.</span>
<span class="c1"># verbosity = INFO</span>
</pre></div>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>17. Explorer &mdash; cdist 6.5.6 documentation</title>
<title>17. Explorer &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -177,7 +168,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>17. Explorer</li>
<li><span class="section-number">17. </span>Explorer</li>
<li class="wy-breadcrumbs-aside">
@ -197,9 +188,9 @@
<div itemprop="articleBody">
<div class="section" id="explorer">
<h1>17. Explorer<a class="headerlink" href="#explorer" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">17. </span>Explorer<a class="headerlink" href="#explorer" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>17.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">17.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>Explorers are small shell scripts, which will be executed on the target
host. The aim of each 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
@ -210,11 +201,11 @@ 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</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$__explorer/&lt;explorer_name&gt; (general and type explorer)
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$__explorer/&lt;explorer_name&gt; (general and type explorer)
</pre></div>
</div>
<p>or</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$__type_explorer/&lt;explorer name&gt; (type explorer).
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$__type_explorer/&lt;explorer name&gt; (type explorer).
</pre></div>
</div>
<p>In case of significant errors, the explorer may exit non-zero and return an
@ -223,14 +214,14 @@ error message on stderr, which will cause cdist to abort.</p>
explorer.</p>
</div>
<div class="section" id="examples">
<h2>17.2. Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">17.2. </span>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<p>A very simple explorer may look like this:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">hostname</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">hostname</span>
</pre></div>
</div>
<p>Which is in practise the <strong>hostname</strong> explorer.</p>
<p>A type explorer, which could check for the status of a package may look like this:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="o">[</span> -f <span class="s2">&quot;</span><span class="nv">$__object</span><span class="s2">/parameter/name&quot;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="o">[</span> -f <span class="s2">&quot;</span><span class="nv">$__object</span><span class="s2">/parameter/name&quot;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
<span class="nv">name</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>cat <span class="s2">&quot;</span><span class="nv">$__object</span><span class="s2">/parameter/name&quot;</span><span class="k">)</span><span class="s2">&quot;</span>
<span class="k">else</span>
<span class="nv">name</span><span class="o">=</span><span class="s2">&quot;</span><span class="nv">$__object_id</span><span class="s2">&quot;</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>2. Features &mdash; cdist 6.5.6 documentation</title>
<title>2. Features &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -173,7 +164,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>2. Features</li>
<li><span class="section-number">2. </span>Features</li>
<li class="wy-breadcrumbs-aside">
@ -193,43 +184,42 @@
<div itemprop="articleBody">
<div class="section" id="features">
<h1>2. Features<a class="headerlink" href="#features" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">2. </span>Features<a class="headerlink" href="#features" title="Permalink to this headline"></a></h1>
<p>But cdist ticks differently, here is the feature set that makes it unique:</p>
<dl class="docutils">
<dt>Simplicity</dt>
<dd>There is only one type to extend cdist called <strong>type</strong></dd>
<dt>Design</dt>
<dd><ul class="first last simple">
<li>Type and core cleanly separated</li>
<li>Sticks completely to the KISS (keep it simple and stupid) paradigm</li>
<li>Meaningful error messages - do not lose time debugging error messages</li>
<li>Consistency in behaviour, naming and documentation</li>
<li>No surprise factor: Only do what is obviously clear, no magic</li>
<li>Define target state, do not focus on methods or scripts</li>
<li>Push architecture: Instantly apply your changes</li>
<dl class="simple">
<dt>Simplicity</dt><dd><p>There is only one type to extend cdist called <strong>type</strong></p>
</dd>
<dt>Design</dt><dd><ul class="simple">
<li><p>Type and core cleanly separated</p></li>
<li><p>Sticks completely to the KISS (keep it simple and stupid) paradigm</p></li>
<li><p>Meaningful error messages - do not lose time debugging error messages</p></li>
<li><p>Consistency in behaviour, naming and documentation</p></li>
<li><p>No surprise factor: Only do what is obviously clear, no magic</p></li>
<li><p>Define target state, do not focus on methods or scripts</p></li>
<li><p>Push architecture: Instantly apply your changes</p></li>
</ul>
</dd>
<dt>Small core</dt>
<dd>cdist's core is very small - less code, less bugs</dd>
<dt>Fast development</dt>
<dd>Focus on straightforwardness of type creation is a main development objective
Batteries included: A lot of requirements can be solved using standard types</dd>
<dt>Modern Programming Language</dt>
<dd>cdist is written in Python</dd>
<dt>Requirements, Scalability</dt>
<dd>No central server needed, cdist operates in push mode and can be run from any computer</dd>
<dt>Requirements, Scalability, Upgrade</dt>
<dd>cdist only needs to be updated on the master, not on the target hosts</dd>
<dt>Requirements, Security</dt>
<dd>Uses well-know <a class="reference external" href="http://www.openssh.com/">SSH</a> as transport protocol</dd>
<dt>Requirements, Simplicity</dt>
<dd>Requires only shell and SSH server on the target</dd>
<dt>UNIX</dt>
<dd>Reuse of existing tools like cat, find, mv, ...</dd>
<dt>UNIX, familiar environment, documentation</dt>
<dd>Is available as manpages and HTML</dd>
<dt>UNIX, simplicity, familiar environment</dt>
<dd>cdist is configured in POSIX shell</dd>
<dt>Small core</dt><dd><p>cdist's core is very small - less code, less bugs</p>
</dd>
<dt>Fast development</dt><dd><p>Focus on straightforwardness of type creation is a main development objective
Batteries included: A lot of requirements can be solved using standard types</p>
</dd>
<dt>Modern Programming Language</dt><dd><p>cdist is written in Python</p>
</dd>
<dt>Requirements, Scalability</dt><dd><p>No central server needed, cdist operates in push mode and can be run from any computer</p>
</dd>
<dt>Requirements, Scalability, Upgrade</dt><dd><p>cdist only needs to be updated on the master, not on the target hosts</p>
</dd>
<dt>Requirements, Security</dt><dd><p>Uses well-know <a class="reference external" href="http://www.openssh.com/">SSH</a> as transport protocol</p>
</dd>
<dt>Requirements, Simplicity</dt><dd><p>Requires only shell and SSH server on the target</p>
</dd>
<dt>UNIX</dt><dd><p>Reuse of existing tools like cat, find, mv, ...</p>
</dd>
<dt>UNIX, familiar environment, documentation</dt><dd><p>Is available as manpages and HTML</p>
</dd>
<dt>UNIX, simplicity, familiar environment</dt><dd><p>cdist is configured in POSIX shell</p>
</dd>
</dl>
</div>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>30. Hacking &mdash; cdist 6.5.6 documentation</title>
<title>30. Hacking &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -181,7 +172,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>30. Hacking</li>
<li><span class="section-number">30. </span>Hacking</li>
<li class="wy-breadcrumbs-aside">
@ -201,9 +192,9 @@
<div itemprop="articleBody">
<div class="section" id="hacking">
<h1>30. Hacking<a class="headerlink" href="#hacking" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">30. </span>Hacking<a class="headerlink" href="#hacking" title="Permalink to this headline"></a></h1>
<div class="section" id="welcome">
<h2>30.1. Welcome<a class="headerlink" href="#welcome" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">30.1. </span>Welcome<a class="headerlink" href="#welcome" title="Permalink to this headline"></a></h2>
<p>Welcome dear hacker! I invite you to a tour of pointers to
get into the usable configuration management system, cdist.</p>
<p>The first thing to know is probably that cdist is brought to
@ -212,53 +203,47 @@ twice before merging or implementing a feature: Less features
with good usability are far better than the opposite.</p>
</div>
<div class="section" id="reporting-bugs">
<h2>30.2. Reporting bugs<a class="headerlink" href="#reporting-bugs" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">30.2. </span>Reporting bugs<a class="headerlink" href="#reporting-bugs" title="Permalink to this headline"></a></h2>
<p>If you believe you've found a bug and verified that it is
in the latest version, drop a mail to the cdist mailing list,
subject prefixed with &quot;[BUG] &quot; or create an issue on code.ungleich.ch.</p>
</div>
<div class="section" id="coding-conventions-everywhere">
<h2>30.3. Coding conventions (everywhere)<a class="headerlink" href="#coding-conventions-everywhere" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">30.3. </span>Coding conventions (everywhere)<a class="headerlink" href="#coding-conventions-everywhere" title="Permalink to this headline"></a></h2>
<p>If something should be improved or needs to be fixed, add the word FIXME
nearby, so grepping for FIXME gives all positions that need to be fixed.</p>
<p>Indentation is 4 spaces (welcome to the python world).</p>
</div>
<div class="section" id="how-to-submit-stuff-for-inclusion-into-upstream-cdist">
<h2>30.4. How to submit stuff for inclusion into upstream cdist<a class="headerlink" href="#how-to-submit-stuff-for-inclusion-into-upstream-cdist" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">30.4. </span>How to submit stuff for inclusion into upstream cdist<a class="headerlink" href="#how-to-submit-stuff-for-inclusion-into-upstream-cdist" title="Permalink to this headline"></a></h2>
<p>If you did some cool changes to cdist, which you think might be of benefit to other
cdist users, you're welcome to propose inclusion into upstream.</p>
<p>There are some requirements to ensure your changes don't break other peoples
work nor kill the authors brain:</p>
<ul>
<li><p class="first">All files should contain the usual header (Author, Copying, etc.)</p>
</li>
<li><p class="first">Code submission must be done via git</p>
</li>
<li><p class="first">Do not add cdist/conf/manifest/init - This file should only be touched in your
private branch!</p>
</li>
<li><p class="first">Code to be included should be branched of the upstream &quot;master&quot; branch</p>
<li><p>All files should contain the usual header (Author, Copying, etc.)</p></li>
<li><p>Code submission must be done via git</p></li>
<li><p>Do not add cdist/conf/manifest/init - This file should only be touched in your
private branch!</p></li>
<li><p>Code to be included should be branched of the upstream &quot;master&quot; branch</p>
<blockquote>
<div><ul class="simple">
<li>Exception: Bugfixes to a version branch</li>
<li><p>Exception: Bugfixes to a version branch</p></li>
</ul>
</div></blockquote>
</li>
<li><p class="first">On a merge request, always name the branch I should pull from</p>
</li>
<li><p class="first">Always ensure <strong>all</strong> manpages build. Use <strong>./build man</strong> to test.</p>
</li>
<li><p class="first">If you developed more than <strong>one</strong> feature, consider submitting them in
<li><p>On a merge request, always name the branch I should pull from</p></li>
<li><p>Always ensure <strong>all</strong> manpages build. Use <strong>./build man</strong> to test.</p></li>
<li><p>If you developed more than <strong>one</strong> feature, consider submitting them in
separate branches. This way one feature can already be included, even if
the other needs to be improved.</p>
</li>
the other needs to be improved.</p></li>
</ul>
<p>As soon as your work meets these requirements, write a mail
for inclusion to the mailinglist <strong>cdist-configuration-management at googlegroups.com</strong>
or open a merge request at <a class="reference external" href="https://code.ungleich.ch/ungleich-public/cdist">https://code.ungleich.ch/ungleich-public/cdist</a>.</p>
</div>
<div class="section" id="how-to-submit-a-new-type">
<h2>30.5. How to submit a new type<a class="headerlink" href="#how-to-submit-a-new-type" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">30.5. </span>How to submit a new type<a class="headerlink" href="#how-to-submit-a-new-type" title="Permalink to this headline"></a></h2>
<p>For detailed information about types, see <a class="reference external" href="cdist-type.html">cdist type</a>.</p>
<p>Submitting a type works as described above, with the additional requirement
that a corresponding manpage named man.rst in ReSTructured text format with
@ -270,9 +255,9 @@ code and thus such a type introduces redundant functionality that is given by
core cdist already.</p>
</div>
<div class="section" id="example-git-workflow">
<h2>30.6. Example git workflow<a class="headerlink" href="#example-git-workflow" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">30.6. </span>Example git workflow<a class="headerlink" href="#example-git-workflow" title="Permalink to this headline"></a></h2>
<p>The following workflow works fine for most developers</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># get latest upstream master branch</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># get latest upstream master branch</span>
git clone https://code.ungleich.ch/ungleich-public/cdist.git
<span class="c1"># update if already existing</span>
@ -316,7 +301,7 @@ git merge origin/master
</div>
<p>If at any point you want to go back to the original master branch, you can
use <strong>git stash</strong> to stash your changes away:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">..</span> <span class="n">code</span><span class="o">-</span><span class="n">block</span><span class="p">::</span> <span class="n">sh</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">..</span> <span class="n">code</span><span class="o">-</span><span class="n">block</span><span class="p">::</span> <span class="n">sh</span>
</pre></div>
</div>
<blockquote>
@ -329,7 +314,7 @@ git merge origin/master</p>
</div></blockquote>
<p>Similarly when you want to develop another new feature, you go back
to the master branch and create another branch based on it:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">..</span> <span class="n">code</span><span class="o">-</span><span class="n">block</span><span class="p">::</span> <span class="n">sh</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">..</span> <span class="n">code</span><span class="o">-</span><span class="n">block</span><span class="p">::</span> <span class="n">sh</span>
</pre></div>
</div>
<blockquote>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>4. How to install cdist &mdash; cdist 6.5.6 documentation</title>
<title>4. How to install cdist &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -190,7 +181,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>4. How to install cdist</li>
<li><span class="section-number">4. </span>How to install cdist</li>
<li class="wy-breadcrumbs-aside">
@ -210,40 +201,40 @@
<div itemprop="articleBody">
<div class="section" id="how-to-install-cdist">
<h1>4. How to install cdist<a class="headerlink" href="#how-to-install-cdist" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">4. </span>How to install cdist<a class="headerlink" href="#how-to-install-cdist" title="Permalink to this headline"></a></h1>
<div class="section" id="requirements">
<h2>4.1. Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">4.1. </span>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h2>
<div class="section" id="source-host">
<h3>4.1.1. Source Host<a class="headerlink" href="#source-host" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">4.1.1. </span>Source Host<a class="headerlink" href="#source-host" title="Permalink to this headline"></a></h3>
<p>This is the machine from which you will configure target hosts.</p>
<blockquote>
<div><ul class="simple">
<li>/bin/sh: A posix like shell (for instance bash, dash, zsh)</li>
<li>Python &gt;= 3.2</li>
<li>SSH client</li>
<li>sphinx (for building html docs and/or the man pages)</li>
<li><p>/bin/sh: A POSIX like shell (for instance bash, dash, zsh)</p></li>
<li><p>Python &gt;= 3.5</p></li>
<li><p>SSH client</p></li>
<li><p>sphinx (for building html docs and/or the man pages)</p></li>
</ul>
</div></blockquote>
</div>
<div class="section" id="target-hosts">
<h3>4.1.2. Target Hosts<a class="headerlink" href="#target-hosts" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">4.1.2. </span>Target Hosts<a class="headerlink" href="#target-hosts" title="Permalink to this headline"></a></h3>
<blockquote>
<div><ul class="simple">
<li>/bin/sh: A posix like shell (for instance bash, dash, zsh)</li>
<li>SSH server</li>
<li><p>/bin/sh: A POSIX like shell (for instance bash, dash, zsh)</p></li>
<li><p>SSH server</p></li>
</ul>
</div></blockquote>
</div>
</div>
<div class="section" id="install-cdist">
<h2>4.2. Install cdist<a class="headerlink" href="#install-cdist" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">4.2. </span>Install cdist<a class="headerlink" href="#install-cdist" title="Permalink to this headline"></a></h2>
<div class="section" id="from-git">
<h3>4.2.1. From git<a class="headerlink" href="#from-git" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">4.2.1. </span>From git<a class="headerlink" href="#from-git" title="Permalink to this headline"></a></h3>
<p>Cloning cdist from git gives you the advantage of having
a version control in place for development of your own stuff
immediately.</p>
<p>To install cdist, execute the following commands:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>git clone https://code.ungleich.ch/ungleich-public/cdist.git
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>git clone https://code.ungleich.ch/ungleich-public/cdist.git
<span class="nb">cd</span> cdist
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:<span class="k">$(</span><span class="nb">pwd</span> -P<span class="k">)</span>/bin
</pre></div>
@ -254,46 +245,46 @@ It is assumed that you are familiar with <em>git</em> ways of signing and verifi
<p>You can also get cdist from <a class="reference external" href="https://github.com/ungleich/cdist">github mirror</a>.</p>
<p>To install cdist with distutils from cloned repository, first you have to
create version.py:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>./bin/build-helper version
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>./bin/build-helper version
</pre></div>
</div>
<p>Then you install it with:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>make install
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>make install
</pre></div>
</div>
<p>or with:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>make install-user
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>make install-user
</pre></div>
</div>
<p>to install it into user <em>site-packages</em> directory.
Or directly with distutils:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>python setup.py install
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>python setup.py install
</pre></div>
</div>
<p>Note that <cite>bin/build-helper</cite> script is intended for cdist maintainers.</p>
<div class="section" id="available-versions-in-git">
<h4>4.2.1.1. Available versions in git<a class="headerlink" href="#available-versions-in-git" title="Permalink to this headline"></a></h4>
<h4><span class="section-number">4.2.1.1. </span>Available versions in git<a class="headerlink" href="#available-versions-in-git" title="Permalink to this headline"></a></h4>
<blockquote>
<div><ul class="simple">
<li>The active development takes place in the <strong>master</strong> branch</li>
<li>The released versions can be found in the tags</li>
<li><p>The active development takes place in the <strong>master</strong> branch</p></li>
<li><p>The released versions can be found in the tags</p></li>
</ul>
</div></blockquote>
<p>Other branches may be available for features or bugfixes, but they
may vanish at any point. To select a specific branch use</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Generic code</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Generic code</span>
git checkout -b &lt;localbranchname&gt; origin/&lt;branchname&gt;
</pre></div>
</div>
<p>So for instance if you want to use and stay with version 4.1, you can use</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>git checkout -b <span class="m">4</span>.1 origin/4.1
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>git checkout -b <span class="m">4</span>.1 origin/4.1
</pre></div>
</div>
</div>
<div class="section" id="building-and-using-documentation-man-and-html">
<h4>4.2.1.2. Building and using documentation (man and html)<a class="headerlink" href="#building-and-using-documentation-man-and-html" title="Permalink to this headline"></a></h4>
<h4><span class="section-number">4.2.1.2. </span>Building and using documentation (man and html)<a class="headerlink" href="#building-and-using-documentation-man-and-html" title="Permalink to this headline"></a></h4>
<p>If you want to build and use the documentation, run:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>make docs
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>make docs
</pre></div>
</div>
<p>Documentation comes in two formats, man pages and full HTML
@ -301,7 +292,7 @@ documentation. Documentation is built into distribution's
docs/dist directory. man pages are in docs/dist/man and
HTML documentation in docs/dist/html.</p>
<p>If you want to use man pages, run:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">MANPATH</span><span class="o">=</span><span class="nv">$MANPATH</span>:<span class="k">$(</span><span class="nb">pwd</span> -P<span class="k">)</span>/docs/dist/man
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">MANPATH</span><span class="o">=</span><span class="nv">$MANPATH</span>:<span class="k">$(</span><span class="nb">pwd</span> -P<span class="k">)</span>/docs/dist/man
</pre></div>
</div>
<p>Or you can move man pages from docs/dist/man directory to some
@ -309,20 +300,20 @@ other directory and add it to MANPATH.</p>
<p>Full HTML documentation can be accessed at docs/dist/html/index.html.</p>
<p>You can also build only man pages or only html documentation, for
only man pages run:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>make man
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>make man
</pre></div>
</div>
<p>for only html documentation run:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>make html
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>make html
</pre></div>
</div>
<p>You can also build man pages for types in your ~/.cdist directory:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>make dotman
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>make dotman
</pre></div>
</div>
<p>Built man pages are now in docs/dist/man directory. If you have
some other custom .cdist directory, e.g. /opt/cdist then use:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>make <span class="nv">DOT_CDIST_PATH</span><span class="o">=</span>/opt/cdist dotman
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>make <span class="nv">DOT_CDIST_PATH</span><span class="o">=</span>/opt/cdist dotman
</pre></div>
</div>
<p>Note that <cite>dotman</cite>-target has to be built before a <cite>make docs</cite>-run, otherwise
@ -330,15 +321,15 @@ the custom man-pages are not picked up.</p>
</div>
</div>
<div class="section" id="python-package">
<h3>4.2.2. Python package<a class="headerlink" href="#python-package" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">4.2.2. </span>Python package<a class="headerlink" href="#python-package" title="Permalink to this headline"></a></h3>
<p>Cdist is available as a python package at
<a class="reference external" href="http://pypi.python.org/pypi/cdist/">PyPi</a>. You can install it using</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>pip install cdist
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>pip install cdist
</pre></div>
</div>
</div>
<div class="section" id="installing-from-source-with-signature-verification">
<h3>4.2.3. Installing from source with signature verification<a class="headerlink" href="#installing-from-source-with-signature-verification" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">4.2.3. </span>Installing from source with signature verification<a class="headerlink" href="#installing-from-source-with-signature-verification" title="Permalink to this headline"></a></h3>
<p>If you want to install cdist from signed source and verify it, first you need to
download cdist archive and its detached signature.</p>
<p>Get both, <em>cdist-x.y.z.tar.gz</em> and <em>cdist-x.y.z.tar.gz.asc</em> from release
@ -347,7 +338,7 @@ notes of the desired tag <em>x.y.z</em> at
<p>Get GPG public key used for signing <a class="reference external" href="_static/pgp-key-EFD2AE4EC36B6901.asc">here</a>
and import it into GPG.</p>
<p>Now cdist source archive can be verified using <cite>gpg</cite>, e.g. to verify <cite>cdist-6.2.0</cite>:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ gpg --verify cdist-6.2.0.tar.gz.asc cdist-6.2.0.targ.gz
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ gpg --verify cdist-6.2.0.tar.gz.asc cdist-6.2.0.targ.gz
gpg: Signature made Sat Nov <span class="m">30</span> <span class="m">23</span>:14:19 <span class="m">2019</span> CET
gpg: using RSA key 69767822F3ECC3C349C1EFFFEFD2AE4EC36B6901
gpg: Good signature from <span class="s2">&quot;ungleich GmbH (ungleich FOSS) &lt;foss@ungleich.ch&gt;&quot;</span> <span class="o">[</span>ultimate<span class="o">]</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>23. cdist integration / using cdist as library &mdash; cdist 6.5.6 documentation</title>
<title>23. cdist integration / using cdist as library &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -177,7 +168,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>23. cdist integration / using cdist as library</li>
<li><span class="section-number">23. </span>cdist integration / using cdist as library</li>
<li class="wy-breadcrumbs-aside">
@ -197,16 +188,16 @@
<div itemprop="articleBody">
<div class="section" id="cdist-integration-using-cdist-as-library">
<h1>23. cdist integration / using cdist as library<a class="headerlink" href="#cdist-integration-using-cdist-as-library" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">23. </span>cdist integration / using cdist as library<a class="headerlink" href="#cdist-integration-using-cdist-as-library" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>23.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">23.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>cdist can be integrate with other applications by importing cdist and other
cdist modules and setting all by hand. There are also helper functions which
aim to ease this integration. Just import <strong>cdist.integration</strong> and use its
functions:</p>
<ul class="simple">
<li><strong>cdist.integration.configure_hosts_simple</strong> for configuration</li>
<li><strong>cdist.integration.install_hosts_simple</strong> for installation.</li>
<li><p><strong>cdist.integration.configure_hosts_simple</strong> for configuration</p></li>
<li><p><strong>cdist.integration.install_hosts_simple</strong> for installation.</p></li>
</ul>
<p>Functions require <cite>host</cite> and <cite>manifest</cite> parameters.
<cite>host</cite> can be specified as a string representing host or as iterable
@ -219,8 +210,8 @@ find it first from local lib directory and then in PATH.</p>
<p><strong>WARNING</strong>: cdist integration helper functions are not yet stable!</p>
</div>
<div class="section" id="examples">
<h2>23.2. Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># configure host from python interactive shell</span>
<h2><span class="section-number">23.2. </span>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># configure host from python interactive shell</span>
&gt;&gt;&gt; import cdist.integration
&gt;&gt;&gt; cdist.integration.configure_hosts_simple<span class="o">(</span><span class="s1">&#39;185.203.114.185&#39;</span>,
... <span class="s1">&#39;~/.cdist/manifest/init&#39;</span><span class="o">)</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>20. Inventory &mdash; cdist 6.5.6 documentation</title>
<title>20. Inventory &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -182,7 +173,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>20. Inventory</li>
<li><span class="section-number">20. </span>Inventory</li>
<li class="wy-breadcrumbs-aside">
@ -202,16 +193,16 @@
<div itemprop="articleBody">
<div class="section" id="inventory">
<h1>20. Inventory<a class="headerlink" href="#inventory" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">20. </span>Inventory<a class="headerlink" href="#inventory" title="Permalink to this headline"></a></h1>
<div class="section" id="introduction">
<h2>20.1. Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">20.1. </span>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>cdist comes with simple built-in tag based inventory. It is a simple inventory
with list of hosts and a host has a list of tags.
Inventory functionality is still in <strong>beta</strong> so it can be used only if beta
command line flag is specified (-b, --beta) or setting CDIST_BETA env var.</p>
</div>
<div class="section" id="description">
<h2>20.2. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">20.2. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>The idea is to have simple tagging inventory. There is a list of hosts and for
each host there are tags. Inventory database is a set of files under inventory
database base directory. Filename equals hostname. Each file contains tags for
@ -224,12 +215,12 @@ tags are present.</p>
using cdist inventory interface or using standard UNIX tools.</p>
</div>
<div class="section" id="cdist-inventory-interface">
<h2>20.3. cdist inventory interface<a class="headerlink" href="#cdist-inventory-interface" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">20.3. </span>cdist inventory interface<a class="headerlink" href="#cdist-inventory-interface" title="Permalink to this headline"></a></h2>
<p>With cdist inventory interface you can list host(s) and tag(s), add host(s),
add tag(s), delete host(s) and delete tag(s).</p>
</div>
<div class="section" id="configuring-hosts-using-inventory">
<h2>20.4. Configuring hosts using inventory<a class="headerlink" href="#configuring-hosts-using-inventory" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">20.4. </span>Configuring hosts using inventory<a class="headerlink" href="#configuring-hosts-using-inventory" title="Permalink to this headline"></a></h2>
<p>config command now has new options, <strong>-t</strong>, <strong>-a</strong> and <strong>-A</strong>.</p>
<p><strong>-A</strong> means that all hosts in tag db is selected.</p>
<p><strong>-a</strong> means that selected hosts must contain ALL specified tags.</p>
@ -237,8 +228,8 @@ add tag(s), delete host(s) and delete tag(s).</p>
selected.</p>
</div>
<div class="section" id="examples">
<h2>20.5. Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># List inventory content</span>
<h2><span class="section-number">20.5. </span>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># List inventory content</span>
$ cdist inventory list -b
<span class="c1"># List inventory for specified host localhost</span>
@ -277,8 +268,8 @@ $ cdist config -b -A
</div>
</div>
<div class="section" id="example-of-manipulating-database">
<h2>20.6. Example of manipulating database<a class="headerlink" href="#example-of-manipulating-database" title="Permalink to this headline"></a></h2>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ python3 scripts/cdist inventory list -b
<h2><span class="section-number">20.6. </span>Example of manipulating database<a class="headerlink" href="#example-of-manipulating-database" title="Permalink to this headline"></a></h2>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ python3 scripts/cdist inventory list -b
$ python3 scripts/cdist inventory add-host -b localhost
$ python3 scripts/cdist inventory add-host -b test.mycloud.net
$ python3 scripts/cdist inventory list -b
@ -386,14 +377,14 @@ cloud
<p>For more info about inventory commands and options see <a class="reference external" href="man1/cdist.html">cdist</a>(1).</p>
</div>
<div class="section" id="using-external-inventory">
<h2>20.7. Using external inventory<a class="headerlink" href="#using-external-inventory" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">20.7. </span>Using external inventory<a class="headerlink" href="#using-external-inventory" title="Permalink to this headline"></a></h2>
<p>cdist can be used with any external inventory where external inventory is
some storage or database from which you can get a list of hosts to configure.
cdist can then be fed with this list of hosts through stdin or file using
<strong>-f</strong> option. For example, if your host list is stored in sqlite3 database
hosts.db and you want to select hosts which purpose is <strong>django</strong> then you
can use it with cdist like:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ sqlite3 hosts.db <span class="s2">&quot;select hostname from hosts where purpose = &#39;django&#39;;&quot;</span> <span class="p">|</span> cdist config
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ sqlite3 hosts.db <span class="s2">&quot;select hostname from hosts where purpose = &#39;django&#39;;&quot;</span> <span class="p">|</span> cdist config
</pre></div>
</div>
</div>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>14. Manifest &mdash; cdist 6.5.6 documentation</title>
<title>14. Manifest &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -183,7 +174,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>14. Manifest</li>
<li><span class="section-number">14. </span>Manifest</li>
<li class="wy-breadcrumbs-aside">
@ -203,9 +194,9 @@
<div itemprop="articleBody">
<div class="section" id="manifest">
<h1>14. Manifest<a class="headerlink" href="#manifest" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">14. </span>Manifest<a class="headerlink" href="#manifest" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>14.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>Manifests are used to define which objects to create.
Objects are instances of <strong>types</strong>, like in object oriented programming languages.
An object is represented by the combination of
@ -217,7 +208,7 @@ setup the MANPATH correctly, you can use <strong>man cdist-reference</strong> to
the reference with pointers to the manpages.</p>
<p>Types in manifests are used like normal command line tools. Let's have a look
at an example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Create object of type __package with the parameter state = absent</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Create object of type __package with the parameter state = absent</span>
<span class="n">__package</span> <span class="n">apache2</span> <span class="o">--</span><span class="n">state</span> <span class="n">absent</span>
<span class="c1"># Same with the __directory type</span>
@ -234,14 +225,14 @@ the parameters are exactly the same.</p>
on given conditions.</p>
</div>
<div class="section" id="initial-and-type-manifests">
<h2>14.2. Initial and type manifests<a class="headerlink" href="#initial-and-type-manifests" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.2. </span>Initial and type manifests<a class="headerlink" href="#initial-and-type-manifests" title="Permalink to this headline"></a></h2>
<p>Cdist knows about two types of manifests: The initial manifest and type
manifests. The initial manifest is used to define, which configurations
to apply to which hosts. The type manifests are used to create objects
from types. More about manifests in types can be found in <a class="reference external" href="cdist-type.html">cdist type</a>.</p>
</div>
<div class="section" id="define-state-in-the-initial-manifest">
<h2>14.3. Define state in the initial manifest<a class="headerlink" href="#define-state-in-the-initial-manifest" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.3. </span>Define state in the initial manifest<a class="headerlink" href="#define-state-in-the-initial-manifest" title="Permalink to this headline"></a></h2>
<p>The <strong>initial manifest</strong> is the entry point for cdist to find out, which
<strong>objects</strong> to configure on the selected host.
Cdist expects the initial manifest at <strong>cdist/conf/manifest/init</strong>.</p>
@ -249,7 +240,7 @@ Cdist expects the initial manifest at <strong>cdist/conf/manifest/init</strong>.
created on which host. To distinguish between hosts, you can use the
environment variable <strong>__target_host</strong> and/or <strong>__target_hostname</strong> and/or
<strong>__target_fqdn</strong>. Let's have a look at a simple example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">__cdistmarker</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">__cdistmarker</span>
<span class="n">case</span> <span class="s2">&quot;$__target_host&quot;</span> <span class="ow">in</span>
<span class="n">localhost</span><span class="p">)</span>
@ -268,13 +259,13 @@ utilises cdist types. Every available type can be executed like a normal
command.</p>
</div>
<div class="section" id="splitting-up-the-initial-manifest">
<h2>14.4. Splitting up the initial manifest<a class="headerlink" href="#splitting-up-the-initial-manifest" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.4. </span>Splitting up the initial manifest<a class="headerlink" href="#splitting-up-the-initial-manifest" title="Permalink to this headline"></a></h2>
<p>If you want to split up your initial manifest, you can create other shell
scripts in <strong>cdist/conf/manifest/</strong> and include them in <strong>cdist/conf/manifest/init</strong>.
Cdist provides the environment variable <strong>__manifest</strong> to reference
the directory containing the initial manifest (see <a class="reference external" href="cdist-reference.html">cdist reference</a>).</p>
<p>The following example would include every file with a <strong>.sh</strong> suffix:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span># Include *.sh
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># Include *.sh
for manifest in $__manifest/*.sh; do
# And source scripts into our shell environment
. &quot;$manifest&quot;
@ -283,11 +274,11 @@ done
</div>
</div>
<div class="section" id="dependencies">
<h2>14.5. Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.5. </span>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline"></a></h2>
<p>If you want to describe that something requires something else, just
setup the variable &quot;require&quot; to contain the requirements. Multiple
requirements can be added white space separated.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span> <span class="mi">1</span> <span class="c1"># No dependency</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="mi">1</span> <span class="c1"># No dependency</span>
<span class="mi">2</span> <span class="n">__file</span> <span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">cdist</span><span class="o">-</span><span class="n">configured</span>
<span class="mi">3</span>
<span class="mi">4</span> <span class="c1"># Require above object</span>
@ -312,7 +303,7 @@ if necessary before &quot;__link&quot; proceeds (or to abort execution with an e
export the &quot;require&quot; variable as well. But then, if you need to add extra
dependencies to a specific type, you have to make sure that you append these
to the globally already defined one.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># First of all, update the package index</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># First of all, update the package index</span>
<span class="n">__package_update_index</span>
<span class="c1"># Upgrade all the installed packages afterwards</span>
<span class="n">require</span><span class="o">=</span><span class="s2">&quot;__package_update_index&quot;</span> <span class="n">__package_upgrade_all</span>
@ -334,7 +325,7 @@ cdist jargon.</p>
in <a class="reference external" href="cdist-stages.html">cdist execution stages</a> and of how types work in <a class="reference external" href="cdist-type.html">cdist type</a>.</p>
</div>
<div class="section" id="create-dependencies-from-execution-order">
<h2>14.6. Create dependencies from execution order<a class="headerlink" href="#create-dependencies-from-execution-order" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.6. </span>Create dependencies from execution order<a class="headerlink" href="#create-dependencies-from-execution-order" title="Permalink to this headline"></a></h2>
<p>You can tell cdist to execute all types in the order in which they are created
in the manifest by setting up the variable CDIST_ORDER_DEPENDENCY.
When cdist sees that this variable is setup, the current created object
@ -351,21 +342,21 @@ is used. When order dependency context is defined then cdist executes types in t
order in which they are created in the manifest inside order dependency context.</p>
<p>Sometimes the best way to see how something works is to see examples.</p>
<p>Suppose you have defined <strong>initial manifest</strong>:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>__cycle1 cycle1
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>__cycle1 cycle1
<span class="nb">export</span> <span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
__cycle2 cycle2
__cycle3 cycle3
</pre></div>
</div>
<p>with types <strong>__cycle1</strong>:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
__file /tmp/cycle11
__file /tmp/cycle12
__file /tmp/cycle13
</pre></div>
</div>
<p><strong>__cycle2</strong>:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>__file /tmp/cycle21
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>__file /tmp/cycle21
<span class="nb">export</span> <span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
__file /tmp/cycle22
__file /tmp/cycle23
@ -374,7 +365,7 @@ __file /tmp/cycle24
</pre></div>
</div>
<p><strong>__cycle3</strong>:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>__file /tmp/cycle31
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>__file /tmp/cycle31
__file /tmp/cycle32
<span class="nb">export</span> <span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
__file /tmp/cycle33
@ -383,7 +374,7 @@ __file /tmp/cycle34
</div>
<p>For the above config, cdist results in the following expected <em>dependency graph</em>
(type <em>__cycleX</em> is shown as <em>cX</em>, <em>__file/tmp/cycleXY</em> is shown as <em>fcXY</em>):</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">c1</span><span class="o">----&gt;</span><span class="n">fc11</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">c1</span><span class="o">----&gt;</span><span class="n">fc11</span>
<span class="o">|</span> <span class="o">/</span>\
<span class="o">|</span> <span class="o">|</span>
<span class="o">+-----&gt;</span><span class="n">fc12</span>
@ -416,12 +407,12 @@ __file /tmp/cycle34
</pre></div>
</div>
<p>Before version 6.2.0 the above configuration would result in cycle:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>ERROR: 185.203.112.26: Cycle detected in object dependencies:
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>ERROR: 185.203.112.26: Cycle detected in object dependencies:
__file/tmp/cycle11 -&gt; __cycle3/cycle3 -&gt; __cycle2/cycle2 -&gt; __cycle1/cycle1 -&gt; __file/tmp/cycle11!
</pre></div>
</div>
<p>The following manifest shows an example for order dependency contexts:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>__file /tmp/fileA
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>__file /tmp/fileA
<span class="nb">export</span> <span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span><span class="m">1</span>
__file /tmp/fileB
__file /tmp/fileC
@ -438,14 +429,14 @@ __file /tmp/fileI
</div>
<p>This means:</p>
<ul class="simple">
<li>C depends on B</li>
<li>D depends on C</li>
<li>H depends on G</li>
<li><p>C depends on B</p></li>
<li><p>D depends on C</p></li>
<li><p>H depends on G</p></li>
</ul>
<p>and there are no other dependencies from this manifest.</p>
</div>
<div class="section" id="overrides">
<h2>14.7. Overrides<a class="headerlink" href="#overrides" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.7. </span>Overrides<a class="headerlink" href="#overrides" title="Permalink to this headline"></a></h2>
<p>In some special cases, you would like to create an already defined object
with different parameters. In normal situations this leads to an error in cdist.
If you wish, you can setup the environment variable CDIST_OVERRIDE
@ -459,9 +450,9 @@ CDIST_ORDER_DEPENDENCY will be ignored, because adding a dependency in case of
overrides would result in circular dependencies, which is an error.</p>
</div>
<div class="section" id="examples">
<h2>14.8. Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">14.8. </span>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<p>The initial manifest may for instance contain the following code:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Always create this file, so other sysadmins know cdist is used.</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Always create this file, so other sysadmins know cdist is used.</span>
__file /etc/cdist-configured
<span class="k">case</span> <span class="s2">&quot;</span><span class="nv">$__target_host</span><span class="s2">&quot;</span> in
@ -473,11 +464,11 @@ __file /etc/cdist-configured
</pre></div>
</div>
<p>The manifest of the type &quot;nologin&quot; may look like this:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>__file /etc/nologin --source <span class="s2">&quot;</span><span class="nv">$__type</span><span class="s2">/files/default.nologin&quot;</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>__file /etc/nologin --source <span class="s2">&quot;</span><span class="nv">$__type</span><span class="s2">/files/default.nologin&quot;</span>
</pre></div>
</div>
<p>This example makes use of dependencies:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Ensure that lighttpd is installed</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Ensure that lighttpd is installed</span>
__package lighttpd --state present
<span class="c1"># Ensure that munin makes use of lighttpd instead of the default webserver</span>
<span class="c1"># package as decided by the package manager</span>
@ -485,7 +476,7 @@ __package lighttpd --state present
</pre></div>
</div>
<p>How to override objects:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># for example in the initial manifest</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># for example in the initial manifest</span>
<span class="c1"># create user account foobar with some hash for password</span>
__user foobar --password <span class="s1">&#39;some_fancy_hash&#39;</span> --home /home/foobarexample
@ -504,7 +495,7 @@ __user foobar --password <span class="s1">&#39;some_other_hash&#39;</span>
</pre></div>
</div>
<p>Dependencies defined by execution order work as following:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Tells cdist to execute all types in the order in which they are created ...</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Tells cdist to execute all types in the order in which they are created ...</span>
<span class="nb">export</span> <span class="nv">CDIST_ORDER_DEPENDENCY</span><span class="o">=</span>on
__sample_type <span class="m">1</span>
<span class="nv">require</span><span class="o">=</span><span class="s2">&quot;__some_type_somewhere/id&quot;</span> __sample_type <span class="m">2</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>18. Messaging &mdash; cdist 6.5.6 documentation</title>
<title>18. Messaging &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -178,7 +169,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>18. Messaging</li>
<li><span class="section-number">18. </span>Messaging</li>
<li class="wy-breadcrumbs-aside">
@ -198,9 +189,9 @@
<div itemprop="articleBody">
<div class="section" id="messaging">
<h1>18. Messaging<a class="headerlink" href="#messaging" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">18. </span>Messaging<a class="headerlink" href="#messaging" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>18.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">18.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>cdist has a simple but powerful way of allowing communication between
the initial manifest and types as well as types and types.</p>
<p>Whenever execution is passed from cdist to one of the
@ -218,29 +209,29 @@ between the different objects (see <a class="reference external" href="cdist-man
can only react reliably on messages by objects that you depend on.</p>
</div>
<div class="section" id="availability">
<h2>18.2. Availability<a class="headerlink" href="#availability" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">18.2. </span>Availability<a class="headerlink" href="#availability" title="Permalink to this headline"></a></h2>
<p>Messaging is possible between all <strong>local</strong> scripts:</p>
<ul class="simple">
<li>initial manifest</li>
<li>type/manifest</li>
<li>type/gencode-local</li>
<li>type/gencode-remote</li>
<li><p>initial manifest</p></li>
<li><p>type/manifest</p></li>
<li><p>type/gencode-local</p></li>
<li><p>type/gencode-remote</p></li>
</ul>
</div>
<div class="section" id="examples">
<h2>18.3. Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">18.3. </span>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<p>When you want to emit a message use:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;something&quot;</span> &gt;&gt; <span class="s2">&quot;</span><span class="nv">$__messages_out</span><span class="s2">&quot;</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s2">&quot;something&quot;</span> &gt;&gt; <span class="s2">&quot;</span><span class="nv">$__messages_out</span><span class="s2">&quot;</span>
</pre></div>
</div>
<p>When you want to react on a message use:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="k">if</span> grep -q <span class="s2">&quot;^__your_type/object/id:something&quot;</span> <span class="s2">&quot;</span><span class="nv">$__messages_in</span><span class="s2">&quot;</span><span class="p">;</span> <span class="k">then</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> grep -q <span class="s2">&quot;^__your_type/object/id:something&quot;</span> <span class="s2">&quot;</span><span class="nv">$__messages_in</span><span class="s2">&quot;</span><span class="p">;</span> <span class="k">then</span>
<span class="nb">echo</span> <span class="s2">&quot;I do something else&quot;</span>
<span class="k">fi</span>
</pre></div>
</div>
<p>Some real life examples:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Reacting on changes from block for keepalive</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Reacting on changes from block for keepalive</span>
<span class="k">if</span> grep -q <span class="s2">&quot;^__block/keepalive-vrrp&quot;</span> <span class="s2">&quot;</span><span class="nv">$__messages_in</span><span class="s2">&quot;</span><span class="p">;</span> <span class="k">then</span>
<span class="nb">echo</span> /etc/init.d/keepalived restart
<span class="k">fi</span>
@ -252,7 +243,7 @@ can only react reliably on messages by objects that you depend on.</p>
</pre></div>
</div>
<p>Restart sshd on changes</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="nv">os</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>cat <span class="s2">&quot;</span><span class="nv">$__global</span><span class="s2">/explorer/os&quot;</span><span class="k">)</span><span class="s2">&quot;</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">os</span><span class="o">=</span><span class="s2">&quot;</span><span class="k">$(</span>cat <span class="s2">&quot;</span><span class="nv">$__global</span><span class="s2">/explorer/os&quot;</span><span class="k">)</span><span class="s2">&quot;</span>
<span class="k">case</span> <span class="s2">&quot;</span><span class="nv">$os</span><span class="s2">&quot;</span> in
centos<span class="p">|</span>redhat<span class="p">|</span>suse<span class="o">)</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3. Supported operating systems &mdash; cdist 6.5.6 documentation</title>
<title>3. Supported operating systems &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -173,7 +164,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>3. Supported operating systems</li>
<li><span class="section-number">3. </span>Supported operating systems</li>
<li class="wy-breadcrumbs-aside">
@ -193,23 +184,23 @@
<div itemprop="articleBody">
<div class="section" id="supported-operating-systems">
<h1>3. Supported operating systems<a class="headerlink" href="#supported-operating-systems" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">3. </span>Supported operating systems<a class="headerlink" href="#supported-operating-systems" title="Permalink to this headline"></a></h1>
<p>cdist was tested or is know to run on at least</p>
<ul class="simple">
<li><a class="reference external" href="https://alpinelinux.org">Alpine Linux</a></li>
<li><a class="reference external" href="http://www.archlinux.org">Archlinux</a></li>
<li><a class="reference external" href="http://www.centos.org">CentOS</a></li>
<li><a class="reference external" href="http://www.debian.org">Debian</a></li>
<li><a class="reference external" href="https://devuan.org">Devuan</a></li>
<li><a class="reference external" href="http://fedoraproject.org">Fedora</a></li>
<li><a class="reference external" href="http://www.freebsd.org">FreeBSD</a></li>
<li><a class="reference external" href="http://www.gentoo.org">Gentoo</a></li>
<li><a class="reference external" href="http://www.apple.com/macosx">Mac OS X</a></li>
<li><a class="reference external" href="https://www.netbsd.org">NetBSD</a></li>
<li><a class="reference external" href="http://www.openbsd.org">OpenBSD</a></li>
<li><a class="reference external" href="http://www.redhat.com">Redhat</a></li>
<li><a class="reference external" href="http://www.ubuntu.com">Ubuntu</a></li>
<li><a class="reference external" href="http://www.citrix.com/xenserver">XenServer</a></li>
<li><p><a class="reference external" href="https://alpinelinux.org">Alpine Linux</a></p></li>
<li><p><a class="reference external" href="http://www.archlinux.org">Archlinux</a></p></li>
<li><p><a class="reference external" href="http://www.centos.org">CentOS</a></p></li>
<li><p><a class="reference external" href="http://www.debian.org">Debian</a></p></li>
<li><p><a class="reference external" href="https://devuan.org">Devuan</a></p></li>
<li><p><a class="reference external" href="http://fedoraproject.org">Fedora</a></p></li>
<li><p><a class="reference external" href="http://www.freebsd.org">FreeBSD</a></p></li>
<li><p><a class="reference external" href="http://www.gentoo.org">Gentoo</a></p></li>
<li><p><a class="reference external" href="http://www.apple.com/macosx">Mac OS X</a></p></li>
<li><p><a class="reference external" href="https://www.netbsd.org">NetBSD</a></p></li>
<li><p><a class="reference external" href="http://www.openbsd.org">OpenBSD</a></p></li>
<li><p><a class="reference external" href="http://www.redhat.com">Redhat</a></p></li>
<li><p><a class="reference external" href="http://www.ubuntu.com">Ubuntu</a></p></li>
<li><p><a class="reference external" href="http://www.citrix.com/xenserver">XenServer</a></p></li>
</ul>
</div>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>19. Parallelization &mdash; cdist 6.5.6 documentation</title>
<title>19. Parallelization &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -178,7 +169,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>19. Parallelization</li>
<li><span class="section-number">19. </span>Parallelization</li>
<li class="wy-breadcrumbs-aside">
@ -198,9 +189,9 @@
<div itemprop="articleBody">
<div class="section" id="parallelization">
<h1>19. Parallelization<a class="headerlink" href="#parallelization" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">19. </span>Parallelization<a class="headerlink" href="#parallelization" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>19.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">19.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>cdist has two modes of parallel operation.</p>
<p>One of them is to operate on each host in separate process. This is enabled
with <strong>-p/--parallel</strong> option.</p>
@ -215,8 +206,8 @@ using specified number of parallel jobs.</p>
<p>For more info on those options see <strong>cdist</strong>(1).</p>
</div>
<div class="section" id="examples">
<h2>19.2. Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-sh"><div class="highlight"><pre><span></span><span class="c1"># Configure hosts read from file hosts.file in parallel</span>
<h2><span class="section-number">19.2. </span>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="c1"># Configure hosts read from file hosts.file in parallel</span>
$ cdist config -p -f hosts.file
<span class="c1"># Configure hosts read from file hosts.file sequentially but using default</span>
@ -230,7 +221,7 @@ $ cdist config -j <span class="m">16</span> -p -f hosts.file
</div>
</div>
<div class="section" id="caveats">
<h2>19.3. Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">19.3. </span>Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline"></a></h2>
<p>When operating in parallel, either by operating in parallel for each host
(-p/--parallel) or by parallel jobs within a host (-j/--jobs), and depending
on target SSH server and its configuration you may encounter connection drops.
@ -242,7 +233,7 @@ This limit is controlled with sshd :strong:MaxSessions configuration
options. For more details refer to <strong>sshd_config</strong>(5).</p>
<p>For example, if you reach <strong>MaxSessions</strong> sessions you may get the
following output:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ cdist config -b -j <span class="m">11</span> -v <span class="m">78</span>.47.116.244
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ cdist config -b -j <span class="m">11</span> -v <span class="m">78</span>.47.116.244
INFO: cdist: version <span class="m">4</span>.2.2-55-g640b7f9
INFO: <span class="m">78</span>.47.116.244: Running global explorers
INFO: <span class="m">78</span>.47.116.244: Remote transfer in <span class="m">11</span> parallel <span class="nb">jobs</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>22. PreOS &mdash; cdist 6.5.6 documentation</title>
<title>22. PreOS &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -186,7 +177,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>22. PreOS</li>
<li><span class="section-number">22. </span>PreOS</li>
<li class="wy-breadcrumbs-aside">
@ -206,37 +197,37 @@
<div itemprop="articleBody">
<div class="section" id="preos">
<h1>22. PreOS<a class="headerlink" href="#preos" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">22. </span>PreOS<a class="headerlink" href="#preos" title="Permalink to this headline"></a></h1>
<div class="section" id="description">
<h2>22.1. Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">22.1. </span>Description<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
<p>With cdist you can install and configure new machines. You can use cdist to
create PreOS, minimal OS whose purpose is to boot a new machine.
After PreOS is booted, the machine is ready for installing the desired OS and
afterwards it is ready for configuration.</p>
</div>
<div class="section" id="preos-creation">
<h2>22.2. PreOS creation<a class="headerlink" href="#preos-creation" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">22.2. </span>PreOS creation<a class="headerlink" href="#preos-creation" title="Permalink to this headline"></a></h2>
<p>With cdist you can create PreOS.
Currently supported PreOS-es include:</p>
<ul class="simple">
<li>debian</li>
<li>ubuntu</li>
<li>devuan</li>
<li><p>debian</p></li>
<li><p>ubuntu</p></li>
<li><p>devuan</p></li>
</ul>
<p>PreOS is created using the <code class="docutils literal"><span class="pre">cdist</span> <span class="pre">preos</span></code> command.
<p>PreOS is created using the <code class="docutils literal notranslate"><span class="pre">cdist</span> <span class="pre">preos</span></code> command.
This command has subcommands that determine the desired PreOS.</p>
<p>For example, to create an ubuntu PreOS:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ cdist preos ubuntu /preos/preos-ubuntu -B -C <span class="se">\</span>
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ cdist preos ubuntu /preos/preos-ubuntu -B -C <span class="se">\</span>
-k ~/.ssh/id_rsa.pub -p /preos/pxe-ubuntu <span class="se">\</span>
-t <span class="s2">&quot;/usr/bin/curl 192.168.111.5:3000/cdist/install/&quot;</span>
</pre></div>
</div>
<p>For more info about the available options see the cdist manual page.</p>
<p>This will bootstrap (<code class="docutils literal"><span class="pre">-B</span></code>) ubuntu PreOS in <code class="docutils literal"><span class="pre">/preos/preos-ubuntu</span></code> directory, it
will be configured (<code class="docutils literal"><span class="pre">-C</span></code>) using default built-in initial manifest and with
specified ssh authorized key (<code class="docutils literal"><span class="pre">-k</span></code>) and with specified trigger command (<code class="docutils literal"><span class="pre">-t</span></code>).
<p>This will bootstrap (<code class="docutils literal notranslate"><span class="pre">-B</span></code>) ubuntu PreOS in <code class="docutils literal notranslate"><span class="pre">/preos/preos-ubuntu</span></code> directory, it
will be configured (<code class="docutils literal notranslate"><span class="pre">-C</span></code>) using default built-in initial manifest and with
specified ssh authorized key (<code class="docutils literal notranslate"><span class="pre">-k</span></code>) and with specified trigger command (<code class="docutils literal notranslate"><span class="pre">-t</span></code>).
After bootstrapping and configuration PXE
boot directory will be created (<code class="docutils literal"><span class="pre">-p</span></code>) in <code class="docutils literal"><span class="pre">/preos/pxe-ubuntu</span></code>.</p>
boot directory will be created (<code class="docutils literal notranslate"><span class="pre">-p</span></code>) in <code class="docutils literal notranslate"><span class="pre">/preos/pxe-ubuntu</span></code>.</p>
<p>After PreOS is created, new machines can be booted using the created PXE
(after proper dhcp and tftp settings).</p>
<p>Since PreOS is configured with ssh authorized key it can be accessed through
@ -250,45 +241,45 @@ for installation then cdist trigger server will start install command for the
client host using parameters specified at trigger server startup.</p>
</div>
<div class="section" id="implementing-new-preos-sub-command">
<h2>22.3. Implementing new PreOS sub-command<a class="headerlink" href="#implementing-new-preos-sub-command" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">22.3. </span>Implementing new PreOS sub-command<a class="headerlink" href="#implementing-new-preos-sub-command" title="Permalink to this headline"></a></h2>
<p>preos command is implemented as a plugin system. This plugin system scans for
preos subcommands in the <code class="docutils literal"><span class="pre">cdist/preos/</span></code> distribution directory and also in
<code class="docutils literal"><span class="pre">~/.cdist/preos/</span></code> directory if it exists.</p>
preos subcommands in the <code class="docutils literal notranslate"><span class="pre">cdist/preos/</span></code> distribution directory and also in
<code class="docutils literal notranslate"><span class="pre">~/.cdist/preos/</span></code> directory if it exists.</p>
<p>preos subcommand is a module or a class that satisfies the following:</p>
<ul class="simple">
<li>it has the attribute <code class="docutils literal"><span class="pre">_cdist_preos</span></code> set to <code class="docutils literal"><span class="pre">True</span></code></li>
<li>it defines a function/method <code class="docutils literal"><span class="pre">commandline</span></code>.</li>
<li><p>it has the attribute <code class="docutils literal notranslate"><span class="pre">_cdist_preos</span></code> set to <code class="docutils literal notranslate"><span class="pre">True</span></code></p></li>
<li><p>it defines a function/method <code class="docutils literal notranslate"><span class="pre">commandline</span></code>.</p></li>
</ul>
<p>For a module-based preos subcommand, the <code class="docutils literal"><span class="pre">commandline</span></code> function accepts a
<p>For a module-based preos subcommand, the <code class="docutils literal notranslate"><span class="pre">commandline</span></code> function accepts a
module object as its first argument and the list of command line
arguments (<code class="docutils literal"><span class="pre">sys.argv[2:]</span></code>).</p>
<p>For a class-based preos subcommand <code class="docutils literal"><span class="pre">commandline</span></code> method should be
arguments (<code class="docutils literal notranslate"><span class="pre">sys.argv[2:]</span></code>).</p>
<p>For a class-based preos subcommand <code class="docutils literal notranslate"><span class="pre">commandline</span></code> method should be
static-method and must accept a class as its first argument and the
list of command line arguments (<code class="docutils literal"><span class="pre">sys.argv[2:]</span></code>).</p>
<p>If preos scanning finds a module/class that has <code class="docutils literal"><span class="pre">_cdist_preos</span></code> set
to <code class="docutils literal"><span class="pre">True</span></code> and a function/method <code class="docutils literal"><span class="pre">commandline</span></code> then this module/class is
registered to preos subcommands. The name of the command is set to <code class="docutils literal"><span class="pre">_preos_name</span></code>
list of command line arguments (<code class="docutils literal notranslate"><span class="pre">sys.argv[2:]</span></code>).</p>
<p>If preos scanning finds a module/class that has <code class="docutils literal notranslate"><span class="pre">_cdist_preos</span></code> set
to <code class="docutils literal notranslate"><span class="pre">True</span></code> and a function/method <code class="docutils literal notranslate"><span class="pre">commandline</span></code> then this module/class is
registered to preos subcommands. The name of the command is set to <code class="docutils literal notranslate"><span class="pre">_preos_name</span></code>
attribute if defined in the module/class, defaulting to the module/class name in lowercase.
When a registered preos subcommand is specified, <code class="docutils literal"><span class="pre">commandline</span></code>
When a registered preos subcommand is specified, <code class="docutils literal notranslate"><span class="pre">commandline</span></code>
will be called with the first argument set to module/class and the second
argument set to <code class="docutils literal"><span class="pre">sys.argv[2:]</span></code>.</p>
argument set to <code class="docutils literal notranslate"><span class="pre">sys.argv[2:]</span></code>.</p>
<div class="section" id="example-of-writing-new-dummy-preos-sub-command">
<h3>22.3.1. Example of writing new dummy preos sub-command<a class="headerlink" href="#example-of-writing-new-dummy-preos-sub-command" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">22.3.1. </span>Example of writing new dummy preos sub-command<a class="headerlink" href="#example-of-writing-new-dummy-preos-sub-command" title="Permalink to this headline"></a></h3>
<div class="section" id="module-based-preos">
<h4>22.3.1.1. Module-based preos:<a class="headerlink" href="#module-based-preos" title="Permalink to this headline"></a></h4>
<h4><span class="section-number">22.3.1.1. </span>Module-based preos:<a class="headerlink" href="#module-based-preos" title="Permalink to this headline"></a></h4>
<ol class="arabic simple">
<li>Create directory <code class="docutils literal"><span class="pre">~/.cdist/preos/</span></code> if it does not exist</li>
<li>Create <code class="docutils literal"><span class="pre">~/.cdist/preos/netbsd.py</span></code> with the following contents:</li>
<li><p>Create directory <code class="docutils literal notranslate"><span class="pre">~/.cdist/preos/</span></code> if it does not exist</p></li>
<li><p>Create <code class="docutils literal notranslate"><span class="pre">~/.cdist/preos/netbsd.py</span></code> with the following contents:</p></li>
</ol>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">_preos_name</span> <span class="o">=</span> <span class="s1">&#39;netbsd&#39;</span>
<span class="n">_cdist_preos</span> <span class="o">=</span> <span class="bp">True</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">_preos_name</span> <span class="o">=</span> <span class="s1">&#39;netbsd&#39;</span>
<span class="n">_cdist_preos</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">def</span> <span class="nf">commandline</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;NetBSD PreOS: {}&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;NetBSD PreOS: </span><span class="si">{}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
</pre></div>
</div>
<p>When you try to run this new preos you will get:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ cdist preos -L
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ cdist preos -L
Available PreOS-es:
- debian
- devuan
@ -300,21 +291,21 @@ NetBSD PreOS: <span class="o">[]</span>
</div>
</div>
<div class="section" id="class-based-preos">
<h4>22.3.1.2. Class based preos:<a class="headerlink" href="#class-based-preos" title="Permalink to this headline"></a></h4>
<h4><span class="section-number">22.3.1.2. </span>Class based preos:<a class="headerlink" href="#class-based-preos" title="Permalink to this headline"></a></h4>
<ol class="arabic simple">
<li>Create directory <code class="docutils literal"><span class="pre">~/.cdist/preos/</span></code> if it does not exist</li>
<li>Create <code class="docutils literal"><span class="pre">~/.cdist/preos/freebsd.py</span></code> with the following contents:</li>
<li><p>Create directory <code class="docutils literal notranslate"><span class="pre">~/.cdist/preos/</span></code> if it does not exist</p></li>
<li><p>Create <code class="docutils literal notranslate"><span class="pre">~/.cdist/preos/freebsd.py</span></code> with the following contents:</p></li>
</ol>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">FreeBSD</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="n">_cdist_preos</span> <span class="o">=</span> <span class="bp">True</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">FreeBSD</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="n">_cdist_preos</span> <span class="o">=</span> <span class="kc">True</span>
<span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">commandline</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s2">&quot;FreeBSD dummy preos: {}&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;FreeBSD dummy preos: </span><span class="si">{}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
</pre></div>
</div>
<p>When you try to run this new preos you will get:</p>
<div class="highlight-sh"><div class="highlight"><pre><span></span>$ cdist preos -h
<div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ cdist preos -h
Available PreOS-es:
- debian
- devuan
@ -324,42 +315,37 @@ $ cdist preos freebsd
FreeBSD dummy preos: <span class="o">[]</span>
</pre></div>
</div>
<p>In the <code class="docutils literal"><span class="pre">commandline</span></code> function/method you have all the freedom to actually create
<p>In the <code class="docutils literal notranslate"><span class="pre">commandline</span></code> function/method you have all the freedom to actually create
a PreOS.</p>
</div>
</div>
</div>
<div class="section" id="simple-tipical-use-case-for-using-preos-and-trigger">
<h2>22.4. Simple tipical use case for using PreOS and trigger<a class="headerlink" href="#simple-tipical-use-case-for-using-preos-and-trigger" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">22.4. </span>Simple tipical use case for using PreOS and trigger<a class="headerlink" href="#simple-tipical-use-case-for-using-preos-and-trigger" title="Permalink to this headline"></a></h2>
<p>Tipical use case for using PreOS and trigger command include the following steps.</p>
<ol class="arabic">
<li><p class="first">Create PreOS PXE with ssh key and trigger command for installation.</p>
<li><p>Create PreOS PXE with ssh key and trigger command for installation.</p>
<blockquote>
<div><div class="highlight-sh"><div class="highlight"><pre><span></span>$ cdist preos ubuntu /preos/ubuntu -b -C <span class="se">\</span>
<div><div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ cdist preos ubuntu /preos/ubuntu -b -C <span class="se">\</span>
-k ~/.ssh/id_rsa.pub -p /preos/pxe <span class="se">\</span>
-t <span class="s2">&quot;/usr/bin/curl 192.168.111.5:3000/cdist/install/&quot;</span>
</pre></div>
</div>
</div></blockquote>
</li>
<li><p class="first">Configure dhcp server and tftp server.</p>
</li>
<li><p class="first">On cdist host (192.168.111.5 from above) start trigger command (it will use
<li><p>Configure dhcp server and tftp server.</p></li>
<li><p>On cdist host (192.168.111.5 from above) start trigger command (it will use
default init manifest for installation).</p>
<blockquote>
<div><div class="highlight-sh"><div class="highlight"><pre><span></span>$ cdist trigger -b -v
<div><div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>$ cdist trigger -b -v
</pre></div>
</div>
</div></blockquote>
</li>
<li><p class="first">After all is set up start new machines (PXE boot).</p>
</li>
<li><p class="first">New machine boots and executes trigger command, i.e. triggers installation.</p>
</li>
<li><p class="first">Cdist trigger server starts installing host that has triggered it.</p>
</li>
<li><p class="first">After cdist install is finished new host is installed.</p>
</li>
<li><p>After all is set up start new machines (PXE boot).</p></li>
<li><p>New machine boots and executes trigger command, i.e. triggers installation.</p></li>
<li><p>Cdist trigger server starts installing host that has triggered it.</p></li>
<li><p>After cdist install is finished new host is installed.</p></li>
</ol>
</div>
</div>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>7. Quickstart &mdash; cdist 6.5.6 documentation</title>
<title>7. Quickstart &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -173,7 +164,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>7. Quickstart</li>
<li><span class="section-number">7. </span>Quickstart</li>
<li class="wy-breadcrumbs-aside">
@ -193,7 +184,7 @@
<div itemprop="articleBody">
<div class="section" id="quickstart">
<h1>7. Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">7. </span>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline"></a></h1>
<p>This tutorial is aimed at people learning cdist and shows
typical approaches as well as gives an easy start into
the world of configuration management.</p>
@ -209,7 +200,7 @@ and usually logs into the <strong>target host</strong> as the
of the target host to allow root logins: Edit
the file <strong>/etc/ssh/sshd_config</strong> and add one of the following
lines:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Allow login only via public key</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Allow login only via public key</span>
<span class="n">PermitRootLogin</span> <span class="n">without</span><span class="o">-</span><span class="n">password</span>
<span class="c1"># Allow login via password and public key</span>
@ -218,7 +209,7 @@ lines:</p>
</div>
<p>As cdist uses ssh intensively, it is recommended to setup authentication
with public keys:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Generate pubkey pair as a normal user</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Generate pubkey pair as a normal user</span>
<span class="n">ssh</span><span class="o">-</span><span class="n">keygen</span>
<span class="c1"># Copy pubkey over to target host</span>
@ -227,7 +218,7 @@ with public keys:</p>
</div>
<p>Have a look at ssh-agent(1) and ssh-add(1) on how to cache the password for
your public key. Usually it looks like this:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span># Start agent and export variables
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># Start agent and export variables
eval `ssh-agent`
# Add keys (requires password for every identity file)
@ -241,7 +232,7 @@ documentation.</p>
<p>As soon as you are able to login without password to localhost,
we can use cdist to configure it. You can copy and paste the following
code into your shell to get started and configure localhost:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Get cdist</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Get cdist</span>
<span class="n">git</span> <span class="n">clone</span> <span class="n">git</span><span class="nd">@code</span><span class="o">.</span><span class="n">ungleich</span><span class="o">.</span><span class="n">ch</span><span class="p">:</span><span class="n">ungleich</span><span class="o">-</span><span class="n">public</span><span class="o">/</span><span class="n">cdist</span><span class="o">.</span><span class="n">git</span>
<span class="c1"># Create manifest (maps configuration to host(s)</span>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>8. Dive into real world cdist &mdash; cdist 6.5.6 documentation</title>
<title>8. Dive into real world cdist &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -126,7 +117,7 @@
<li class="toctree-l2"><a class="reference internal" href="#creating-python-bottle-application">8.9. Creating python bottle application</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#preparing-database">8.9.1. Preparing database</a></li>
<li class="toctree-l3"><a class="reference internal" href="#creating-application">8.9.2. Creating application</a></li>
<li class="toctree-l3"><a class="reference internal" href="#openning-application">8.9.3. Openning application</a></li>
<li class="toctree-l3"><a class="reference internal" href="#opening-application">8.9.3. Opening application</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#what-s-next">8.10. What's next?</a></li>
@ -200,7 +191,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>8. Dive into real world cdist</li>
<li><span class="section-number">8. </span>Dive into real world cdist</li>
<li class="wy-breadcrumbs-aside">
@ -220,9 +211,9 @@
<div itemprop="articleBody">
<div class="section" id="dive-into-real-world-cdist">
<h1>8. Dive into real world cdist<a class="headerlink" href="#dive-into-real-world-cdist" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">8. </span>Dive into real world cdist<a class="headerlink" href="#dive-into-real-world-cdist" title="Permalink to this headline"></a></h1>
<div class="section" id="introduction">
<h2>8.1. Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.1. </span>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>This walkthrough shows real world cdist configuration example.</p>
<p>Sample target host is named <strong>test.ungleich.ch</strong>.
Just replace <strong>test.ungleich.ch</strong> with your target hostname.</p>
@ -235,12 +226,12 @@ For HTTPS we will use Let's Encrypt certificate.</p>
<p>For setting up hosting we want to use cdist so we will write a new type
for that. This type will:</p>
<ul class="simple">
<li>install required packages</li>
<li>create OS user, user home directory and application home directory</li>
<li>create PostgreSQL database</li>
<li>configure uWSGI</li>
<li>configure Let's Encrypt certificate</li>
<li>configure nginx.</li>
<li><p>install required packages</p></li>
<li><p>create OS user, user home directory and application home directory</p></li>
<li><p>create PostgreSQL database</p></li>
<li><p>configure uWSGI</p></li>
<li><p>configure Let's Encrypt certificate</p></li>
<li><p>configure nginx.</p></li>
</ul>
<p>Our type will not create the actual python application. Its intention is only
to configure hosting for specified user and project. It is up to the user to
@ -248,11 +239,11 @@ create his/her applications.</p>
<p>So let's start.</p>
</div>
<div class="section" id="creating-type-layout">
<h2>8.2. Creating type layout<a class="headerlink" href="#creating-type-layout" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.2. </span>Creating type layout<a class="headerlink" href="#creating-type-layout" title="Permalink to this headline"></a></h2>
<p>We will create a new custom type. Let's call it <strong>__sample_bottle_hosting</strong>.</p>
<p>Go to <strong>~/.cdist/type</strong> directory (create it if it does not exist) and create
new type layout:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="nb">type</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="nb">type</span>
<span class="n">mkdir</span> <span class="n">__sample_bottle_hosting</span>
<span class="n">cd</span> <span class="n">__sample_bottle_hosting</span>
<span class="n">touch</span> <span class="n">manifest</span> <span class="n">gencode</span><span class="o">-</span><span class="n">remote</span>
@ -262,20 +253,20 @@ new type layout:</p>
</div>
</div>
<div class="section" id="creating-sample-bottle-hosting-type-parameters">
<h2>8.3. Creating __sample_bottle_hosting type parameters<a class="headerlink" href="#creating-sample-bottle-hosting-type-parameters" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.3. </span>Creating __sample_bottle_hosting type parameters<a class="headerlink" href="#creating-sample-bottle-hosting-type-parameters" title="Permalink to this headline"></a></h2>
<p>Our type will be configurable through the means of parameters. Let's define
the following parameters:</p>
<dl class="docutils">
<dt>projectname</dt>
<dd>name for the project, needed for uWSGI ini file</dd>
<dt>user</dt>
<dd>user name</dd>
<dt>domain</dt>
<dd>target host domain, needed for Let's Encrypt certificate.</dd>
<dl class="simple">
<dt>projectname</dt><dd><p>name for the project, needed for uWSGI ini file</p>
</dd>
<dt>user</dt><dd><p>user name</p>
</dd>
<dt>domain</dt><dd><p>target host domain, needed for Let's Encrypt certificate.</p>
</dd>
</dl>
<p>We define parameters to make our type reusable for different projects, user and domain.</p>
<p>Define required parameters:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">printf</span> <span class="s2">&quot;projectname</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">&gt;&gt;</span> <span class="n">parameter</span><span class="o">/</span><span class="n">required</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">printf</span> <span class="s2">&quot;projectname</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">&gt;&gt;</span> <span class="n">parameter</span><span class="o">/</span><span class="n">required</span>
<span class="n">printf</span> <span class="s2">&quot;user</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">&gt;&gt;</span> <span class="n">parameter</span><span class="o">/</span><span class="n">required</span>
<span class="n">printf</span> <span class="s2">&quot;domain</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">&gt;&gt;</span> <span class="n">parameter</span><span class="o">/</span><span class="n">required</span>
</pre></div>
@ -283,12 +274,12 @@ the following parameters:</p>
<p>For details on type parameters see <a class="reference external" href="cdist-type.html#defining-parameters">Defining parameters</a>.</p>
</div>
<div class="section" id="creating-sample-bottle-hosting-type-manifest">
<h2>8.4. Creating __sample_bottle_hosting type manifest<a class="headerlink" href="#creating-sample-bottle-hosting-type-manifest" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.4. </span>Creating __sample_bottle_hosting type manifest<a class="headerlink" href="#creating-sample-bottle-hosting-type-manifest" title="Permalink to this headline"></a></h2>
<p>Next step is to define manifest (~/.cdist/type/__sample_bottle_hosting/manifest).
We also want our type to currently support only Devuan. So we will start by
checking target host OS. We will use <a class="reference external" href="cdist-reference.html#explorers">os</a>
global explorer:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>os=$(cat &quot;$__global/explorer/os&quot;)
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>os=$(cat &quot;$__global/explorer/os&quot;)
case &quot;$os&quot; in
devuan)
@ -309,10 +300,10 @@ configuration locations (e.g. nginx config directory could be in /usr/local tree
If we detected unsupported OS we should error out. cdist will stop configuration
process and output error message.</p>
<div class="section" id="creating-user-and-user-directories">
<h3>8.4.1. Creating user and user directories<a class="headerlink" href="#creating-user-and-user-directories" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.1. </span>Creating user and user directories<a class="headerlink" href="#creating-user-and-user-directories" title="Permalink to this headline"></a></h3>
<p>Then we create user and his/her home directory and application home directory.
We will use existing cdist types <a class="reference external" href="man7/cdist-type__user.html">__user</a> and <a class="reference external" href="man7/cdist-type__directory.html">__directory</a>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>user=&quot;$(cat &quot;$__object/parameter/user&quot;)&quot;
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>user=&quot;$(cat &quot;$__object/parameter/user&quot;)&quot;
home=&quot;/home/$user&quot;
apphome=&quot;$home/app&quot;
@ -333,11 +324,11 @@ home directory is created <strong>after</strong> both user and user home directo
For details on <strong>require</strong> see <a class="reference external" href="cdist-manifest.html#dependencies">Dependencies</a>.</p>
</div>
<div class="section" id="installing-packages">
<h3>8.4.2. Installing packages<a class="headerlink" href="#installing-packages" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.2. </span>Installing packages<a class="headerlink" href="#installing-packages" title="Permalink to this headline"></a></h3>
<p>Install required packages using existing <a class="reference external" href="man7/cdist-type__package.html">__package</a> type.
Before installing package we want to update apt package index using
<a class="reference external" href="man7/cdist-type__apt_update_index.html">__apt_update_index</a>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span># define packages that need to be installed
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># define packages that need to be installed
packages_to_install=&quot;nginx uwsgi-plugin-python3 python3-dev python3-pip postgresql postgresql-contrib libpq-dev python3-venv uwsgi python3-psycopg2&quot;
# update package index
@ -353,7 +344,7 @@ for each member in a list we define in <strong>packages_to_install</strong> vari
This is much nicer then having as many <strong>require=&quot;__apt_update_index&quot; __package</strong>
lines as there are packages we want to install.</p>
<p>For python packages we use <a class="reference external" href="man7/cdist-type__package_pip.html">__package_pip</a>:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span># install pip3 packages
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># install pip3 packages
for package in bottle bottle-pgsql; do
__package_pip --pip pip3 $package
done
@ -361,10 +352,10 @@ done
</div>
</div>
<div class="section" id="creating-postgresql-database">
<h3>8.4.3. Creating PostgreSQL database<a class="headerlink" href="#creating-postgresql-database" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.3. </span>Creating PostgreSQL database<a class="headerlink" href="#creating-postgresql-database" title="Permalink to this headline"></a></h3>
<p>Create PostgreSQL database using <a class="reference external" href="man7/cdist-type__postgres_database.html">__postgres_database</a>
and <a class="reference external" href="man7/cdist-type__postgres_role.html">__postgres_role</a> for creating database user:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>#PostgreSQL db &amp; user
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>#PostgreSQL db &amp; user
postgres_server=postgresql
# create PostgreSQL db user
@ -376,9 +367,9 @@ require=&quot;__postgres_role/$user __package/postgresql&quot; __postgres_databa
</div>
</div>
<div class="section" id="configuring-uwsgi">
<h3>8.4.4. Configuring uWSGI<a class="headerlink" href="#configuring-uwsgi" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.4. </span>Configuring uWSGI<a class="headerlink" href="#configuring-uwsgi" title="Permalink to this headline"></a></h3>
<p>Configure uWSGI using <a class="reference external" href="man7/cdist-type__file.html">__file</a> type:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span># configure uWSGI
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># configure uWSGI
projectname=&quot;$(cat &quot;$__object/parameter/projectname&quot;)&quot;
require=&quot;__package/uwsgi&quot; __file /etc/uwsgi/apps-enabled/$user.ini \
--owner root --group root --mode 0644 \
@ -403,29 +394,29 @@ EOF
Installation of uWSGI also creates configuration layout: <strong>/etc/uwsgi/apps-enabled</strong>.
If this directory does not exist then <strong>__file</strong> type would error.
We also use stdin as file content source. For details see <a class="reference external" href="cdist-type.html#input-from-stdin">Input from stdin</a>.
For feading stdin we use here-document (<strong>&lt;&lt;</strong> operator). It allows redirection of subsequent
For feeding stdin we use here-document (<strong>&lt;&lt;</strong> operator). It allows redirection of subsequent
lines read by the shell to the input of a command until a line containing only the delimiter
and a newline, with no blank characters in between (EOF in our case).</p>
</div>
<div class="section" id="configuring-nginx-for-let-s-encrypt-and-https-redirection">
<h3>8.4.5. Configuring nginx for Let's Encrypt and HTTPS redirection<a class="headerlink" href="#configuring-nginx-for-let-s-encrypt-and-https-redirection" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.5. </span>Configuring nginx for Let's Encrypt and HTTPS redirection<a class="headerlink" href="#configuring-nginx-for-let-s-encrypt-and-https-redirection" title="Permalink to this headline"></a></h3>
<p>Next configure nginx for Let's Encrypt and for HTTP -&gt; HTTPS redirection. For this
purpose we will create new type <strong>__sample_nginx_http_letsencrypt_and_ssl_redirect</strong>
and use it here:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>domain=&quot;$(cat &quot;$__object/parameter/domain&quot;)&quot;
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>domain=&quot;$(cat &quot;$__object/parameter/domain&quot;)&quot;
webroot=&quot;/var/www/html&quot;
__sample_nginx_http_letsencrypt_and_ssl_redirect &quot;$domain&quot; --webroot &quot;$webroot&quot;
</pre></div>
</div>
</div>
<div class="section" id="configuring-certificate-creation">
<h3>8.4.6. Configuring certificate creation<a class="headerlink" href="#configuring-certificate-creation" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.6. </span>Configuring certificate creation<a class="headerlink" href="#configuring-certificate-creation" title="Permalink to this headline"></a></h3>
<p>After HTTP nginx configuration we will create Let's Encrypt certificate using
<a class="reference external" href="man7/cdist-type__letsencrypt_cert.html">__letsencrypt_cert</a> type.
For Let's Encrypt cert configuration ensure that there is a DNS entry for your
domain. We assure that cert creation is applied after nginx HTTP is configured
for Let's Encrypt to work:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># create SSL cert</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># create SSL cert</span>
<span class="n">require</span><span class="o">=</span><span class="s2">&quot;__package/nginx __sample_nginx_http_letsencrypt_and_ssl_redirect/$domain&quot;</span> \
<span class="n">__letsencrypt_cert</span> <span class="o">--</span><span class="n">admin</span><span class="o">-</span><span class="n">email</span> <span class="n">admin</span><span class="nd">@test</span><span class="o">.</span><span class="n">ungleich</span><span class="o">.</span><span class="n">ch</span> \
<span class="o">--</span><span class="n">webroot</span> <span class="s2">&quot;$webroot&quot;</span> \
@ -437,9 +428,9 @@ for Let's Encrypt to work:</p>
</div>
</div>
<div class="section" id="configuring-nginx-https-server-with-uwsgi-upstream">
<h3>8.4.7. Configuring nginx HTTPS server with uWSGI upstream<a class="headerlink" href="#configuring-nginx-https-server-with-uwsgi-upstream" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.7. </span>Configuring nginx HTTPS server with uWSGI upstream<a class="headerlink" href="#configuring-nginx-https-server-with-uwsgi-upstream" title="Permalink to this headline"></a></h3>
<p>Then we can configure nginx HTTPS server that will use created Let's Encrypt certificate:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span># configure nginx
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span># configure nginx
require=&quot;__package/nginx __letsencrypt_cert/$domain&quot; \
__file &quot;/etc/nginx/sites-enabled/https-$domain&quot; \
--source - --mode 0644 &lt;&lt; EOF
@ -476,10 +467,10 @@ EOF
<p>Now our manifest is finished.</p>
</div>
<div class="section" id="complete-sample-bottle-hosting-type-manifest-listing">
<h3>8.4.8. Complete __sample_bottle_hosting type manifest listing<a class="headerlink" href="#complete-sample-bottle-hosting-type-manifest-listing" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.4.8. </span>Complete __sample_bottle_hosting type manifest listing<a class="headerlink" href="#complete-sample-bottle-hosting-type-manifest-listing" title="Permalink to this headline"></a></h3>
<p>Here is complete __sample_bottle_hosting type manifest listing,
located in ~/.cdist/type/__sample_bottle_hosting/manifest:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>#!/bin/sh
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>#!/bin/sh
os=$(cat &quot;$__global/explorer/os&quot;)
@ -600,20 +591,20 @@ EOF
</div>
</div>
<div class="section" id="creating-sample-bottle-hosting-type-gencode-remote">
<h2>8.5. Creating __sample_bottle_hosting type gencode-remote<a class="headerlink" href="#creating-sample-bottle-hosting-type-gencode-remote" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.5. </span>Creating __sample_bottle_hosting type gencode-remote<a class="headerlink" href="#creating-sample-bottle-hosting-type-gencode-remote" title="Permalink to this headline"></a></h2>
<p>Now define <strong>gencode-remote</strong> script: ~/.cdist/type/__sample_bottle_hosting/gencode-remote.
After manifest is applied it should restart uWSGI and nginx services so that our
configuration is active. Our gencode-remote looks like the following:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">echo</span> <span class="s2">&quot;service uwsgi restart&quot;</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">echo</span> <span class="s2">&quot;service uwsgi restart&quot;</span>
<span class="n">echo</span> <span class="s2">&quot;service nginx restart&quot;</span>
</pre></div>
</div>
<p>Our <strong>__sample_bottle_hosting</strong> type is now finished.</p>
</div>
<div class="section" id="creating-sample-nginx-http-letsencrypt-and-ssl-redirect-type">
<h2>8.6. Creating __sample_nginx_http_letsencrypt_and_ssl_redirect type<a class="headerlink" href="#creating-sample-nginx-http-letsencrypt-and-ssl-redirect-type" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.6. </span>Creating __sample_nginx_http_letsencrypt_and_ssl_redirect type<a class="headerlink" href="#creating-sample-nginx-http-letsencrypt-and-ssl-redirect-type" title="Permalink to this headline"></a></h2>
<p>Let's now create <strong>__sample_nginx_http_letsencrypt_and_ssl_redirect</strong> type:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="nb">type</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="nb">type</span>
<span class="n">mkdir</span> <span class="n">__sample_nginx_http_letsencrypt_and_ssl_redirect</span>
<span class="n">cd</span> <span class="n">__sample_nginx_http_letsencrypt_and_ssl_redirect</span>
<span class="n">mkdir</span> <span class="n">parameter</span>
@ -623,7 +614,7 @@ configuration is active. Our gencode-remote looks like the following:</p>
</pre></div>
</div>
<p>Edit manifest:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>domain=&quot;$__object_id&quot;
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>domain=&quot;$__object_id&quot;
webroot=&quot;$(cat &quot;$__object/parameter/webroot&quot;)&quot;
# make sure we have nginx package
__package nginx
@ -651,14 +642,14 @@ EOF
</pre></div>
</div>
<p>Edit gencode-remote:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">echo</span> <span class="s2">&quot;service nginx reload&quot;</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">echo</span> <span class="s2">&quot;service nginx reload&quot;</span>
</pre></div>
</div>
</div>
<div class="section" id="creating-init-manifest">
<h2>8.7. Creating init manifest<a class="headerlink" href="#creating-init-manifest" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.7. </span>Creating init manifest<a class="headerlink" href="#creating-init-manifest" title="Permalink to this headline"></a></h2>
<p>Next create init manifest:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="n">manifest</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="n">manifest</span>
<span class="n">printf</span> <span class="s2">&quot;__sample_bottle_hosting --projectname sample --user app --domain \$__target_host sample</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">&gt;</span> <span class="n">sample</span>
</pre></div>
</div>
@ -670,28 +661,28 @@ Here the last positional argument <em>sample</em> is type's object id. For detai
reference.</p>
</div>
<div class="section" id="configuring-host">
<h2>8.8. Configuring host<a class="headerlink" href="#configuring-host" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.8. </span>Configuring host<a class="headerlink" href="#configuring-host" title="Permalink to this headline"></a></h2>
<p>Finally configure test.ungleich.ch:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cdist</span> <span class="n">config</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">i</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="n">manifest</span><span class="o">/</span><span class="n">sample</span> <span class="n">test</span><span class="o">.</span><span class="n">ungleich</span><span class="o">.</span><span class="n">ch</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cdist</span> <span class="n">config</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">i</span> <span class="o">~/.</span><span class="n">cdist</span><span class="o">/</span><span class="n">manifest</span><span class="o">/</span><span class="n">sample</span> <span class="n">test</span><span class="o">.</span><span class="n">ungleich</span><span class="o">.</span><span class="n">ch</span>
</pre></div>
</div>
<p>After cdist configuration is successfully finished our host is ready.</p>
</div>
<div class="section" id="creating-python-bottle-application">
<h2>8.9. Creating python bottle application<a class="headerlink" href="#creating-python-bottle-application" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.9. </span>Creating python bottle application<a class="headerlink" href="#creating-python-bottle-application" title="Permalink to this headline"></a></h2>
<p>We now need to create Bottle application. As you remember from the beginning
of this walkthrough our type does not create the actual python application,
its intention is only to configure hosting for specified user and project.
It is up to the user to create his/her applications.</p>
<p>Become app user:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">su</span> <span class="o">-</span><span class="n">l</span> <span class="n">app</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">su</span> <span class="o">-</span><span class="n">l</span> <span class="n">app</span>
</pre></div>
</div>
<div class="section" id="preparing-database">
<h3>8.9.1. Preparing database<a class="headerlink" href="#preparing-database" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.9.1. </span>Preparing database<a class="headerlink" href="#preparing-database" title="Permalink to this headline"></a></h3>
<p>We need to prepare database for our application. Create table and
insert some items:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">psql</span> <span class="o">-</span><span class="n">c</span> <span class="s2">&quot;create table items (item varchar(255));&quot;</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">psql</span> <span class="o">-</span><span class="n">c</span> <span class="s2">&quot;create table items (item varchar(255));&quot;</span>
<span class="n">psql</span> <span class="o">-</span><span class="n">c</span> <span class="s2">&quot;insert into items(item) values(&#39;spam&#39;);&quot;</span>
<span class="n">psql</span> <span class="o">-</span><span class="n">c</span> <span class="s2">&quot;insert into items(item) values(&#39;eggs&#39;);&quot;</span>
@ -700,15 +691,15 @@ insert some items:</p>
</div>
</div>
<div class="section" id="creating-application">
<h3>8.9.2. Creating application<a class="headerlink" href="#creating-application" title="Permalink to this headline"></a></h3>
<h3><span class="section-number">8.9.2. </span>Creating application<a class="headerlink" href="#creating-application" title="Permalink to this headline"></a></h3>
<p>Next create sample app:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">app</span><span class="o">/</span><span class="n">app</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">app</span><span class="o">/</span><span class="n">app</span>
<span class="n">mkdir</span> <span class="n">sample</span>
<span class="n">cd</span> <span class="n">sample</span>
</pre></div>
</div>
<p>Create app.py with the following content:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python3</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="ch">#!/usr/bin/env python3</span>
<span class="kn">import</span> <span class="nn">bottle</span>
<span class="kn">import</span> <span class="nn">bottle_pgsql</span>
@ -732,7 +723,7 @@ insert some items:</p>
</pre></div>
</div>
<p>Create wsgi.py with the following content:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os</span>
<span class="n">os</span><span class="o">.</span><span class="n">chdir</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="vm">__file__</span><span class="p">))</span>
@ -744,10 +735,10 @@ insert some items:</p>
we have changed our <strong>wsgi.py</strong> file uWSGI reloads the application.</p>
<p>Our application selects and lists items from <strong>items</strong> table.</p>
</div>
<div class="section" id="openning-application">
<h3>8.9.3. Openning application<a class="headerlink" href="#openning-application" title="Permalink to this headline"></a></h3>
<div class="section" id="opening-application">
<h3><span class="section-number">8.9.3. </span>Opening application<a class="headerlink" href="#opening-application" title="Permalink to this headline"></a></h3>
<p>Finally try the application:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">test</span><span class="o">.</span><span class="n">ungleich</span><span class="o">.</span><span class="n">ch</span><span class="o">/</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">test</span><span class="o">.</span><span class="n">ungleich</span><span class="o">.</span><span class="n">ch</span><span class="o">/</span>
</pre></div>
</div>
<p>It should redirect to HTTPS and return:</p>
@ -762,7 +753,7 @@ we have changed our <strong>wsgi.py</strong> file uWSGI reloads the application.
</div>
</div>
<div class="section" id="what-s-next">
<h2>8.10. What's next?<a class="headerlink" href="#what-s-next" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">8.10. </span>What's next?<a class="headerlink" href="#what-s-next" title="Permalink to this headline"></a></h2>
<p>Continue reading next sections ;)</p>
</div>
</div>

View file

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>24. Reference &mdash; cdist 6.5.6 documentation</title>
<title>24. Reference &mdash; cdist 6.6.0 documentation</title>
@ -20,20 +20,11 @@
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'6.5.6',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
@ -72,7 +63,7 @@
<div class="version">
6.5.6
6.6.0
</div>
@ -181,7 +172,7 @@
<li><a href="index.html">Docs</a> &raquo;</li>
<li>24. Reference</li>
<li><span class="section-number">24. </span>Reference</li>
<li class="wy-breadcrumbs-aside">
@ -201,471 +192,481 @@
<div itemprop="articleBody">
<div class="section" id="reference">
<h1>24. Reference<a class="headerlink" href="#reference" title="Permalink to this headline"></a></h1>
<h1><span class="section-number">24. </span>Reference<a class="headerlink" href="#reference" title="Permalink to this headline"></a></h1>
<p>Variable, path and type reference for cdist</p>
<div class="section" id="explorers">
<h2>24.1. Explorers<a class="headerlink" href="#explorers" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">24.1. </span>Explorers<a class="headerlink" href="#explorers" title="Permalink to this headline"></a></h2>
<p>The following global explorers are available:</p>
<ul class="simple">
<li>cpu_cores</li>
<li>cpu_sockets</li>
<li>disks</li>
<li>hostname</li>
<li>init</li>
<li>interfaces</li>
<li>is-freebsd-jail</li>
<li>kernel_name</li>
<li>lsb_codename</li>
<li>lsb_description</li>
<li>lsb_id</li>
<li>lsb_release</li>
<li>machine</li>
<li>machine_type</li>
<li>memory</li>
<li>os</li>
<li>os_release</li>
<li>os_version</li>
<li>runlevel</li>
<li><p>cpu_cores</p></li>
<li><p>cpu_sockets</p></li>
<li><p>disks</p></li>
<li><p>hostname</p></li>
<li><p>init</p></li>
<li><p>interfaces</p></li>
<li><p>is-freebsd-jail</p></li>
<li><p>kernel_name</p></li>
<li><p>lsb_codename</p></li>
<li><p>lsb_description</p></li>
<li><p>lsb_id</p></li>
<li><p>lsb_release</p></li>
<li><p>machine</p></li>
<li><p>machine_type</p></li>
<li><p>memory</p></li>
<li><p>os</p></li>
<li><p>os_release</p></li>
<li><p>os_version</p></li>
<li><p>runlevel</p></li>
</ul>
</div>
<div class="section" id="paths">
<h2>24.2. Paths<a class="headerlink" href="#paths" title="Permalink to this headline"></a></h2>
<dl class="docutils">
<dt>$HOME/.cdist</dt>
<dd>The standard cdist configuration directory relative to your home directory.
This is usually the place you want to store your site specific configuration.</dd>
<dt>cdist/conf/</dt>
<dd>The distribution configuration directory.
This contains types and explorers to be used.</dd>
<dt>cdist/inventory/</dt>
<dd>The distribution inventory directory.
This path is relative to cdist installation directory.</dd>
<dt>cdist/preos/</dt>
<dd>The distribution PreOS plugins directory.</dd>
<dt>confdir</dt>
<dd>Cdist will use all available configuration directories and create
<h2><span class="section-number">24.2. </span>Paths<a class="headerlink" href="#paths" title="Permalink to this headline"></a></h2>
<dl class="simple">
<dt>$HOME/.cdist</dt><dd><p>The standard cdist configuration directory relative to your home directory.
This is usually the place you want to store your site specific configuration.</p>
</dd>
<dt>cdist/conf/</dt><dd><p>The distribution configuration directory.
This contains types and explorers to be used.</p>
</dd>
<dt>cdist/inventory/</dt><dd><p>The distribution inventory directory.
This path is relative to cdist installation directory.</p>
</dd>
<dt>cdist/preos/</dt><dd><p>The distribution PreOS plugins directory.</p>
</dd>
<dt>confdir</dt><dd><p>Cdist will use all available configuration directories and create
a temporary confdir containing links to the real configuration directories.
This way it is possible to merge configuration directories.
By default it consists of everything in $HOME/.cdist and cdist/conf/.
For more details see cdist(1).</dd>
<dt>confdir/files/</dt>
<dd>Cdist does not care about this directory besides providing access to it.
It is thought to be a general file storage area.</dd>
<dt>confdir/manifest/init</dt>
<dd>This is the central entry point.
For more details see cdist(1).</p>
</dd>
<dt>confdir/files/</dt><dd><p>Cdist does not care about this directory besides providing access to it.
It is thought to be a general file storage area.</p>
</dd>
<dt>confdir/manifest/init</dt><dd><p>This is the central entry point.
It is an executable (+x bit set) shell script that can use
values from the explorers to decide which configuration to create
for the specified target host.
Its intent is to used to define mapping from configurations to hosts.</dd>
<dt>confdir/manifest/*</dt>
<dd>All other files in this directory are not directly used by cdist, but you
Its intent is to used to define mapping from configurations to hosts.</p>
</dd>
<dt>confdir/manifest/*</dt><dd><p>All other files in this directory are not directly used by cdist, but you
can separate configuration mappings, if you have a lot of code in the
conf/manifest/init file. This may also be helpful to have different admins
maintain different groups of hosts.</dd>
<dt>confdir/explorer/&lt;name&gt;</dt>
<dd>Contains explorers to be run on the target hosts, see <a class="reference external" href="cdist-explorer.html">cdist explorer</a>.</dd>
<dt>confdir/type/</dt>
<dd>Contains all available types, which are used to provide
some kind of functionality. See <a class="reference external" href="cdist-type.html">cdist type</a>.</dd>
<dt>confdir/type/&lt;name&gt;/</dt>
<dd>Home of the type &lt;name&gt;.
This directory is referenced by the variable __type (see below).</dd>
<dt>confdir/type/&lt;name&gt;/man.rst</dt>
<dd>Manpage in reStructuredText format (required for inclusion into upstream).</dd>
<dt>confdir/type/&lt;name&gt;/manifest</dt>
<dd>Used to generate additional objects from a type.</dd>
<dt>confdir/type/&lt;name&gt;/gencode-local</dt>
<dd>Used to generate code to be executed on the source host.</dd>
<dt>confdir/type/&lt;name&gt;/gencode-remote</dt>
<dd>Used to generate code to be executed on the target host.</dd>
<dt>confdir/type/&lt;name&gt;/parameter/required</dt>
<dd>Parameters required by type, n separated list.</dd>
<dt>confdir/type/&lt;name&gt;/parameter/optional</dt>
<dd>Parameters optionally accepted by type, n separated list.</dd>
<dt>confdir/type/&lt;name&gt;/parameter/default/*</dt>
<dd>Default values for optional parameters.
maintain different groups of hosts.</p>
</dd>
<dt>confdir/explorer/&lt;name&gt;</dt><dd><p>Contains explorers to be run on the target hosts, see <a class="reference external" href="cdist-explorer.html">cdist explorer</a>.</p>
</dd>
<dt>confdir/type/</dt><dd><p>Contains all available types, which are used to provide
some kind of functionality. See <a class="reference external" href="cdist-type.html">cdist type</a>.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/</dt><dd><p>Home of the type &lt;name&gt;.
This directory is referenced by the variable __type (see below).</p>
</dd>
<dt>confdir/type/&lt;name&gt;/man.rst</dt><dd><p>Manpage in reStructuredText format (required for inclusion into upstream).</p>
</dd>
<dt>confdir/type/&lt;name&gt;/manifest</dt><dd><p>Used to generate additional objects from a type.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/gencode-local</dt><dd><p>Used to generate code to be executed on the source host.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/gencode-remote</dt><dd><p>Used to generate code to be executed on the target host.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/parameter/required</dt><dd><p>Parameters required by type, n separated list.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/parameter/optional</dt><dd><p>Parameters optionally accepted by type, n separated list.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/parameter/default/*</dt><dd><p>Default values for optional parameters.
Assuming an optional parameter name of 'foo', it's default value would
be read from the file confdir/type/&lt;name&gt;/parameter/default/foo.</dd>
<dt>confdir/type/&lt;name&gt;/parameter/boolean</dt>
<dd>Boolean parameters accepted by type, n separated list.</dd>
<dt>confdir/type/&lt;name&gt;/explorer</dt>
<dd>Location of the type specific explorers.
be read from the file confdir/type/&lt;name&gt;/parameter/default/foo.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/parameter/boolean</dt><dd><p>Boolean parameters accepted by type, n separated list.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/explorer</dt><dd><p>Location of the type specific explorers.
This directory is referenced by the variable __type_explorer (see below).
See <a class="reference external" href="cdist-explorer.html">cdist explorer</a>.</dd>
<dt>confdir/type/&lt;name&gt;/files</dt>
<dd>This directory is reserved for user data and will not be used
See <a class="reference external" href="cdist-explorer.html">cdist explorer</a>.</p>
</dd>
<dt>confdir/type/&lt;name&gt;/files</dt><dd><p>This directory is reserved for user data and will not be used
by cdist at any time. It can be used for storing supplementary
files (like scripts to act as a template or configuration files).</dd>
<dt>out/</dt>
<dd>This directory contains output of cdist and is usually located
files (like scripts to act as a template or configuration files).</p>
</dd>
<dt>out/</dt><dd><p>This directory contains output of cdist and is usually located
in a temporary directory and thus will be removed after the run.
This directory is referenced by the variable __global (see below).</dd>
<dt>out/explorer</dt>
<dd>Output of general explorers.</dd>
<dt>out/object</dt>
<dd>Objects created for the host.</dd>
<dt>out/object/&lt;object&gt;</dt>
<dd>Contains all object specific information.
This directory is referenced by the variable __object (see below).</dd>
<dt>out/object/&lt;object&gt;/explorers</dt>
<dd>Output of type specific explorers, per object.</dd>
This directory is referenced by the variable __global (see below).</p>
</dd>
<dt>out/explorer</dt><dd><p>Output of general explorers.</p>
</dd>
<dt>out/object</dt><dd><p>Objects created for the host.</p>
</dd>
<dt>out/object/&lt;object&gt;</dt><dd><p>Contains all object specific information.
This directory is referenced by the variable __object (see below).</p>
</dd>
<dt>out/object/&lt;object&gt;/explorers</dt><dd><p>Output of type specific explorers, per object.</p>
</dd>
</dl>
</div>
<div class="section" id="types">
<h2>24.3. Types<a class="headerlink" href="#types" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">24.3. </span>Types<a class="headerlink" href="#types" title="Permalink to this headline"></a></h2>
<p>The following types are available:</p>
<ul class="simple">
<li>__acl (<a class="reference external" href="man7/cdist-type__acl.html">cdist-type__acl(7)</a>)</li>
<li>__apt_default_release (<a class="reference external" href="man7/cdist-type__apt_default_release.html">cdist-type__apt_default_release(7)</a>)</li>
<li>__apt_key (<a class="reference external" href="man7/cdist-type__apt_key.html">cdist-type__apt_key(7)</a>)</li>
<li>__apt_key_uri (<a class="reference external" href="man7/cdist-type__apt_key_uri.html">cdist-type__apt_key_uri(7)</a>)</li>
<li>__apt_mark (<a class="reference external" href="man7/cdist-type__apt_mark.html">cdist-type__apt_mark(7)</a>)</li>
<li>__apt_norecommends (<a class="reference external" href="man7/cdist-type__apt_norecommends.html">cdist-type__apt_norecommends(7)</a>)</li>
<li>__apt_ppa (<a class="reference external" href="man7/cdist-type__apt_ppa.html">cdist-type__apt_ppa(7)</a>)</li>
<li>__apt_source (<a class="reference external" href="man7/cdist-type__apt_source.html">cdist-type__apt_source(7)</a>)</li>
<li>__apt_unattended_upgrades (<a class="reference external" href="man7/cdist-type__apt_unattended_upgrades.html">cdist-type__apt_unattended_upgrades(7)</a>)</li>
<li>__apt_update_index (<a class="reference external" href="man7/cdist-type__apt_update_index.html">cdist-type__apt_update_index(7)</a>)</li>
<li>__block (<a class="reference external" href="man7/cdist-type__block.html">cdist-type__block(7)</a>)</li>
<li>__ccollect_source (<a class="reference external" href="man7/cdist-type__ccollect_source.html">cdist-type__ccollect_source(7)</a>)</li>
<li>__cdist (<a class="reference external" href="man7/cdist-type__cdist.html">cdist-type__cdist(7)</a>)</li>
<li>__cdist_preos_trigger (<a class="reference external" href="man7/cdist-type__cdist_preos_trigger.html">cdist-type__cdist_preos_trigger(7)</a>)</li>
<li>__cdistmarker (<a class="reference external" href="man7/cdist-type__cdistmarker.html">cdist-type__cdistmarker(7)</a>)</li>
<li>__check_messages (<a class="reference external" href="man7/cdist-type__check_messages.html">cdist-type__check_messages(7)</a>)</li>
<li>__chroot_mount (<a class="reference external" href="man7/cdist-type__chroot_mount.html">cdist-type__chroot_mount(7)</a>)</li>
<li>__chroot_umount (<a class="reference external" href="man7/cdist-type__chroot_umount.html">cdist-type__chroot_umount(7)</a>)</li>
<li>__clean_path (<a class="reference external" href="man7/cdist-type__clean_path.html">cdist-type__clean_path(7)</a>)</li>
<li>__config_file (<a class="reference external" href="man7/cdist-type__config_file.html">cdist-type__config_file(7)</a>)</li>
<li>__consul (<a class="reference external" href="man7/cdist-type__consul.html">cdist-type__consul(7)</a>)</li>
<li>__consul_agent (<a class="reference external" href="man7/cdist-type__consul_agent.html">cdist-type__consul_agent(7)</a>)</li>
<li>__consul_check (<a class="reference external" href="man7/cdist-type__consul_check.html">cdist-type__consul_check(7)</a>)</li>
<li>__consul_reload (<a class="reference external" href="man7/cdist-type__consul_reload.html">cdist-type__consul_reload(7)</a>)</li>
<li>__consul_service (<a class="reference external" href="man7/cdist-type__consul_service.html">cdist-type__consul_service(7)</a>)</li>
<li>__consul_template (<a class="reference external" href="man7/cdist-type__consul_template.html">cdist-type__consul_template(7)</a>)</li>
<li>__consul_template_template (<a class="reference external" href="man7/cdist-type__consul_template_template.html">cdist-type__consul_template_template(7)</a>)</li>
<li>__consul_watch_checks (<a class="reference external" href="man7/cdist-type__consul_watch_checks.html">cdist-type__consul_watch_checks(7)</a>)</li>
<li>__consul_watch_event (<a class="reference external" href="man7/cdist-type__consul_watch_event.html">cdist-type__consul_watch_event(7)</a>)</li>
<li>__consul_watch_key (<a class="reference external" href="man7/cdist-type__consul_watch_key.html">cdist-type__consul_watch_key(7)</a>)</li>
<li>__consul_watch_keyprefix (<a class="reference external" href="man7/cdist-type__consul_watch_keyprefix.html">cdist-type__consul_watch_keyprefix(7)</a>)</li>
<li>__consul_watch_nodes (<a class="reference external" href="man7/cdist-type__consul_watch_nodes.html">cdist-type__consul_watch_nodes(7)</a>)</li>
<li>__consul_watch_service (<a class="reference external" href="man7/cdist-type__consul_watch_service.html">cdist-type__consul_watch_service(7)</a>)</li>
<li>__consul_watch_services (<a class="reference external" href="man7/cdist-type__consul_watch_services.html">cdist-type__consul_watch_services(7)</a>)</li>
<li>__cron (<a class="reference external" href="man7/cdist-type__cron.html">cdist-type__cron(7)</a>)</li>
<li>__daemontools (<a class="reference external" href="man7/cdist-type__daemontools.html">cdist-type__daemontools(7)</a>)</li>
<li>__daemontools_service (<a class="reference external" href="man7/cdist-type__daemontools_service.html">cdist-type__daemontools_service(7)</a>)</li>
<li>__debconf_set_selections (<a class="reference external" href="man7/cdist-type__debconf_set_selections.html">cdist-type__debconf_set_selections(7)</a>)</li>
<li>__directory (<a class="reference external" href="man7/cdist-type__directory.html">cdist-type__directory(7)</a>)</li>
<li>__docker (<a class="reference external" href="man7/cdist-type__docker.html">cdist-type__docker(7)</a>)</li>
<li>__docker_compose (<a class="reference external" href="man7/cdist-type__docker_compose.html">cdist-type__docker_compose(7)</a>)</li>
<li>__docker_config (<a class="reference external" href="man7/cdist-type__docker_config.html">cdist-type__docker_config(7)</a>)</li>
<li>__docker_secret (<a class="reference external" href="man7/cdist-type__docker_secret.html">cdist-type__docker_secret(7)</a>)</li>
<li>__docker_stack (<a class="reference external" href="man7/cdist-type__docker_stack.html">cdist-type__docker_stack(7)</a>)</li>
<li>__docker_swarm (<a class="reference external" href="man7/cdist-type__docker_swarm.html">cdist-type__docker_swarm(7)</a>)</li>
<li>__dog_vdi (<a class="reference external" href="man7/cdist-type__dog_vdi.html">cdist-type__dog_vdi(7)</a>)</li>
<li>__dot_file (<a class="reference external" href="man7/cdist-type__dot_file.html">cdist-type__dot_file(7)</a>)</li>
<li>__file_old (<a class="reference external" href="man7/cdist-type__file_old.html">cdist-type__file_old(7)</a>)</li>
<li>__filesystem (<a class="reference external" href="man7/cdist-type__filesystem.html">cdist-type__filesystem(7)</a>)</li>
<li>__firewalld_rule (<a class="reference external" href="man7/cdist-type__firewalld_rule.html">cdist-type__firewalld_rule(7)</a>)</li>
<li>__firewalld_start (<a class="reference external" href="man7/cdist-type__firewalld_start.html">cdist-type__firewalld_start(7)</a>)</li>
<li>__git (<a class="reference external" href="man7/cdist-type__git.html">cdist-type__git(7)</a>)</li>
<li>__go_get (<a class="reference external" href="man7/cdist-type__go_get.html">cdist-type__go_get(7)</a>)</li>
<li>__golang_from_vendor (<a class="reference external" href="man7/cdist-type__golang_from_vendor.html">cdist-type__golang_from_vendor(7)</a>)</li>
<li>__grafana_dashboard (<a class="reference external" href="man7/cdist-type__grafana_dashboard.html">cdist-type__grafana_dashboard(7)</a>)</li>
<li>__group (<a class="reference external" href="man7/cdist-type__group.html">cdist-type__group(7)</a>)</li>
<li>__hostname (<a class="reference external" href="man7/cdist-type__hostname.html">cdist-type__hostname(7)</a>)</li>
<li>__hosts (<a class="reference external" href="man7/cdist-type__hosts.html">cdist-type__hosts(7)</a>)</li>
<li>__install_bootloader_grub (<a class="reference external" href="man7/cdist-type__install_bootloader_grub.html">cdist-type__install_bootloader_grub(7)</a>)</li>
<li>__install_chroot_mount (<a class="reference external" href="man7/cdist-type__install_chroot_mount.html">cdist-type__install_chroot_mount(7)</a>)</li>
<li>__install_chroot_umount (<a class="reference external" href="man7/cdist-type__install_chroot_umount.html">cdist-type__install_chroot_umount(7)</a>)</li>
<li>__install_config (<a class="reference external" href="man7/cdist-type__install_config.html">cdist-type__install_config(7)</a>)</li>
<li>__install_coreos (<a class="reference external" href="man7/cdist-type__install_coreos.html">cdist-type__install_coreos(7)</a>)</li>
<li>__install_directory (<a class="reference external" href="man7/cdist-type__install_directory.html">cdist-type__install_directory(7)</a>)</li>
<li>__install_file (<a class="reference external" href="man7/cdist-type__install_file.html">cdist-type__install_file(7)</a>)</li>
<li>__install_fstab (<a class="reference external" href="man7/cdist-type__install_fstab.html">cdist-type__install_fstab(7)</a>)</li>
<li>__install_generate_fstab (<a class="reference external" href="man7/cdist-type__install_generate_fstab.html">cdist-type__install_generate_fstab(7)</a>)</li>
<li>__install_mkfs (<a class="reference external" href="man7/cdist-type__install_mkfs.html">cdist-type__install_mkfs(7)</a>)</li>
<li>__install_mount (<a class="reference external" href="man7/cdist-type__install_mount.html">cdist-type__install_mount(7)</a>)</li>
<li>__install_partition_msdos (<a class="reference external" href="man7/cdist-type__install_partition_msdos.html">cdist-type__install_partition_msdos(7)</a>)</li>
<li>__install_partition_msdos_apply (<a class="reference external" href="man7/cdist-type__install_partition_msdos_apply.html">cdist-type__install_partition_msdos_apply(7)</a>)</li>
<li>__install_reboot (<a class="reference external" href="man7/cdist-type__install_reboot.html">cdist-type__install_reboot(7)</a>)</li>
<li>__install_reset_disk (<a class="reference external" href="man7/cdist-type__install_reset_disk.html">cdist-type__install_reset_disk(7)</a>)</li>
<li>__install_stage (<a class="reference external" href="man7/cdist-type__install_stage.html">cdist-type__install_stage(7)</a>)</li>
<li>__install_umount (<a class="reference external" href="man7/cdist-type__install_umount.html">cdist-type__install_umount(7)</a>)</li>
<li>__iptables_apply (<a class="reference external" href="man7/cdist-type__iptables_apply.html">cdist-type__iptables_apply(7)</a>)</li>
<li>__iptables_rule (<a class="reference external" href="man7/cdist-type__iptables_rule.html">cdist-type__iptables_rule(7)</a>)</li>
<li>__issue (<a class="reference external" href="man7/cdist-type__issue.html">cdist-type__issue(7)</a>)</li>
<li>__jail (<a class="reference external" href="man7/cdist-type__jail.html">cdist-type__jail(7)</a>)</li>
<li>__jail_freebsd10 (<a class="reference external" href="man7/cdist-type__jail_freebsd10.html">cdist-type__jail_freebsd10(7)</a>)</li>
<li>__jail_freebsd9 (<a class="reference external" href="man7/cdist-type__jail_freebsd9.html">cdist-type__jail_freebsd9(7)</a>)</li>
<li>__key_value (<a class="reference external" href="man7/cdist-type__key_value.html">cdist-type__key_value(7)</a>)</li>
<li>__keyboard (<a class="reference external" href="man7/cdist-type__keyboard.html">cdist-type__keyboard(7)</a>)</li>
<li>__letsencrypt_cert (<a class="reference external" href="man7/cdist-type__letsencrypt_cert.html">cdist-type__letsencrypt_cert(7)</a>)</li>
<li>__line (<a class="reference external" href="man7/cdist-type__line.html">cdist-type__line(7)</a>)</li>
<li>__link (<a class="reference external" href="man7/cdist-type__link.html">cdist-type__link(7)</a>)</li>
<li>__locale (<a class="reference external" href="man7/cdist-type__locale.html">cdist-type__locale(7)</a>)</li>
<li>__locale_system (<a class="reference external" href="man7/cdist-type__locale_system.html">cdist-type__locale_system(7)</a>)</li>
<li>__motd (<a class="reference external" href="man7/cdist-type__motd.html">cdist-type__motd(7)</a>)</li>
<li>__mount (<a class="reference external" href="man7/cdist-type__mount.html">cdist-type__mount(7)</a>)</li>
<li>__mysql_database (<a class="reference external" href="man7/cdist-type__mysql_database.html">cdist-type__mysql_database(7)</a>)</li>
<li>__mysql_privileges (<a class="reference external" href="man7/cdist-type__mysql_privileges.html">cdist-type__mysql_privileges(7)</a>)</li>
<li>__mysql_user (<a class="reference external" href="man7/cdist-type__mysql_user.html">cdist-type__mysql_user(7)</a>)</li>
<li>__openldap_server (<a class="reference external" href="man7/cdist-type__openldap_server.html">cdist-type__openldap_server(7)</a>)</li>
<li>__package (<a class="reference external" href="man7/cdist-type__package.html">cdist-type__package(7)</a>)</li>
<li>__package_apk (<a class="reference external" href="man7/cdist-type__package_apk.html">cdist-type__package_apk(7)</a>)</li>
<li>__package_apt (<a class="reference external" href="man7/cdist-type__package_apt.html">cdist-type__package_apt(7)</a>)</li>
<li>__package_dpkg (<a class="reference external" href="man7/cdist-type__package_dpkg.html">cdist-type__package_dpkg(7)</a>)</li>
<li>__package_emerge (<a class="reference external" href="man7/cdist-type__package_emerge.html">cdist-type__package_emerge(7)</a>)</li>
<li>__package_emerge_dependencies (<a class="reference external" href="man7/cdist-type__package_emerge_dependencies.html">cdist-type__package_emerge_dependencies(7)</a>)</li>
<li>__package_luarocks (<a class="reference external" href="man7/cdist-type__package_luarocks.html">cdist-type__package_luarocks(7)</a>)</li>
<li>__package_opkg (<a class="reference external" href="man7/cdist-type__package_opkg.html">cdist-type__package_opkg(7)</a>)</li>
<li>__package_pacman (<a class="reference external" href="man7/cdist-type__package_pacman.html">cdist-type__package_pacman(7)</a>)</li>
<li>__package_pip (<a class="reference external" href="man7/cdist-type__package_pip.html">cdist-type__package_pip(7)</a>)</li>
<li>__package_pkg_freebsd (<a class="reference external" href="man7/cdist-type__package_pkg_freebsd.html">cdist-type__package_pkg_freebsd(7)</a>)</li>
<li>__package_pkg_openbsd (<a class="reference external" href="man7/cdist-type__package_pkg_openbsd.html">cdist-type__package_pkg_openbsd(7)</a>)</li>
<li>__package_pkgng_freebsd (<a class="reference external" href="man7/cdist-type__package_pkgng_freebsd.html">cdist-type__package_pkgng_freebsd(7)</a>)</li>
<li>__package_rubygem (<a class="reference external" href="man7/cdist-type__package_rubygem.html">cdist-type__package_rubygem(7)</a>)</li>
<li>__package_update_index (<a class="reference external" href="man7/cdist-type__package_update_index.html">cdist-type__package_update_index(7)</a>)</li>
<li>__package_upgrade_all (<a class="reference external" href="man7/cdist-type__package_upgrade_all.html">cdist-type__package_upgrade_all(7)</a>)</li>
<li>__package_yum (<a class="reference external" href="man7/cdist-type__package_yum.html">cdist-type__package_yum(7)</a>)</li>
<li>__package_zypper (<a class="reference external" href="man7/cdist-type__package_zypper.html">cdist-type__package_zypper(7)</a>)</li>
<li>__pacman_conf (<a class="reference external" href="man7/cdist-type__pacman_conf.html">cdist-type__pacman_conf(7)</a>)</li>
<li>__pacman_conf_integrate (<a class="reference external" href="man7/cdist-type__pacman_conf_integrate.html">cdist-type__pacman_conf_integrate(7)</a>)</li>
<li>__pf_apply (<a class="reference external" href="man7/cdist-type__pf_apply.html">cdist-type__pf_apply(7)</a>)</li>
<li>__pf_apply_anchor (<a class="reference external" href="man7/cdist-type__pf_apply_anchor.html">cdist-type__pf_apply_anchor(7)</a>)</li>
<li>__pf_ruleset (<a class="reference external" href="man7/cdist-type__pf_ruleset.html">cdist-type__pf_ruleset(7)</a>)</li>
<li>__ping (<a class="reference external" href="man7/cdist-type__ping.html">cdist-type__ping(7)</a>)</li>
<li>__postfix (<a class="reference external" href="man7/cdist-type__postfix.html">cdist-type__postfix(7)</a>)</li>
<li>__postfix_master (<a class="reference external" href="man7/cdist-type__postfix_master.html">cdist-type__postfix_master(7)</a>)</li>
<li>__postfix_postconf (<a class="reference external" href="man7/cdist-type__postfix_postconf.html">cdist-type__postfix_postconf(7)</a>)</li>
<li>__postfix_postmap (<a class="reference external" href="man7/cdist-type__postfix_postmap.html">cdist-type__postfix_postmap(7)</a>)</li>
<li>__postfix_reload (<a class="reference external" href="man7/cdist-type__postfix_reload.html">cdist-type__postfix_reload(7)</a>)</li>
<li>__postgres_database (<a class="reference external" href="man7/cdist-type__postgres_database.html">cdist-type__postgres_database(7)</a>)</li>
<li>__postgres_extension (<a class="reference external" href="man7/cdist-type__postgres_extension.html">cdist-type__postgres_extension(7)</a>)</li>
<li>__postgres_role (<a class="reference external" href="man7/cdist-type__postgres_role.html">cdist-type__postgres_role(7)</a>)</li>
<li>__process (<a class="reference external" href="man7/cdist-type__process.html">cdist-type__process(7)</a>)</li>
<li>__prometheus_alertmanager (<a class="reference external" href="man7/cdist-type__prometheus_alertmanager.html">cdist-type__prometheus_alertmanager(7)</a>)</li>
<li>__prometheus_exporter (<a class="reference external" href="man7/cdist-type__prometheus_exporter.html">cdist-type__prometheus_exporter(7)</a>)</li>
<li>__prometheus_server (<a class="reference external" href="man7/cdist-type__prometheus_server.html">cdist-type__prometheus_server(7)</a>)</li>
<li>__pyvenv (<a class="reference external" href="man7/cdist-type__pyvenv.html">cdist-type__pyvenv(7)</a>)</li>
<li>__qemu_img (<a class="reference external" href="man7/cdist-type__qemu_img.html">cdist-type__qemu_img(7)</a>)</li>
<li>__rbenv (<a class="reference external" href="man7/cdist-type__rbenv.html">cdist-type__rbenv(7)</a>)</li>
<li>__rsync (<a class="reference external" href="man7/cdist-type__rsync.html">cdist-type__rsync(7)</a>)</li>
<li>__rvm (<a class="reference external" href="man7/cdist-type__rvm.html">cdist-type__rvm(7)</a>)</li>
<li>__rvm_gem (<a class="reference external" href="man7/cdist-type__rvm_gem.html">cdist-type__rvm_gem(7)</a>)</li>
<li>__rvm_gemset (<a class="reference external" href="man7/cdist-type__rvm_gemset.html">cdist-type__rvm_gemset(7)</a>)</li>
<li>__rvm_ruby (<a class="reference external" href="man7/cdist-type__rvm_ruby.html">cdist-type__rvm_ruby(7)</a>)</li>
<li>__sensible_editor (<a class="reference external" href="man7/cdist-type__sensible_editor.html">cdist-type__sensible_editor(7)</a>)</li>
<li>__service (<a class="reference external" href="man7/cdist-type__service.html">cdist-type__service(7)</a>)</li>
<li>__ssh_authorized_key (<a class="reference external" href="man7/cdist-type__ssh_authorized_key.html">cdist-type__ssh_authorized_key(7)</a>)</li>
<li>__ssh_authorized_keys (<a class="reference external" href="man7/cdist-type__ssh_authorized_keys.html">cdist-type__ssh_authorized_keys(7)</a>)</li>
<li>__ssh_dot_ssh (<a class="reference external" href="man7/cdist-type__ssh_dot_ssh.html">cdist-type__ssh_dot_ssh(7)</a>)</li>
<li>__staged_file (<a class="reference external" href="man7/cdist-type__staged_file.html">cdist-type__staged_file(7)</a>)</li>
<li>__start_on_boot (<a class="reference external" href="man7/cdist-type__start_on_boot.html">cdist-type__start_on_boot(7)</a>)</li>
<li>__sysctl (<a class="reference external" href="man7/cdist-type__sysctl.html">cdist-type__sysctl(7)</a>)</li>
<li>__systemd_service (<a class="reference external" href="man7/cdist-type__systemd_service.html">cdist-type__systemd_service(7)</a>)</li>
<li>__systemd_unit (<a class="reference external" href="man7/cdist-type__systemd_unit.html">cdist-type__systemd_unit(7)</a>)</li>
<li>__timezone (<a class="reference external" href="man7/cdist-type__timezone.html">cdist-type__timezone(7)</a>)</li>
<li>__ufw (<a class="reference external" href="man7/cdist-type__ufw.html">cdist-type__ufw(7)</a>)</li>
<li>__ufw_rule (<a class="reference external" href="man7/cdist-type__ufw_rule.html">cdist-type__ufw_rule(7)</a>)</li>
<li>__update_alternatives (<a class="reference external" href="man7/cdist-type__update_alternatives.html">cdist-type__update_alternatives(7)</a>)</li>
<li>__user (<a class="reference external" href="man7/cdist-type__user.html">cdist-type__user(7)</a>)</li>
<li>__user_groups (<a class="reference external" href="man7/cdist-type__user_groups.html">cdist-type__user_groups(7)</a>)</li>
<li>__xymon_apache (<a class="reference external" href="man7/cdist-type__xymon_apache.html">cdist-type__xymon_apache(7)</a>)</li>
<li>__xymon_client (<a class="reference external" href="man7/cdist-type__xymon_client.html">cdist-type__xymon_client(7)</a>)</li>
<li>__xymon_config (<a class="reference external" href="man7/cdist-type__xymon_config.html">cdist-type__xymon_config(7)</a>)</li>
<li>__xymon_server (<a class="reference external" href="man7/cdist-type__xymon_server.html">cdist-type__xymon_server(7)</a>)</li>
<li>__yum_repo (<a class="reference external" href="man7/cdist-type__yum_repo.html">cdist-type__yum_repo(7)</a>)</li>
<li>__zypper_repo (<a class="reference external" href="man7/cdist-type__zypper_repo.html">cdist-type__zypper_repo(7)</a>)</li>
<li>__zypper_service (<a class="reference external" href="man7/cdist-type__zypper_service.html">cdist-type__zypper_service(7)</a>)</li>
<li><p>__acl (<a class="reference external" href="man7/cdist-type__acl.html">cdist-type__acl(7)</a>)</p></li>
<li><p>__apt_default_release (<a class="reference external" href="man7/cdist-type__apt_default_release.html">cdist-type__apt_default_release(7)</a>)</p></li>
<li><p>__apt_key (<a class="reference external" href="man7/cdist-type__apt_key.html">cdist-type__apt_key(7)</a>)</p></li>
<li><p>__apt_key_uri (<a class="reference external" href="man7/cdist-type__apt_key_uri.html">cdist-type__apt_key_uri(7)</a>)</p></li>
<li><p>__apt_mark (<a class="reference external" href="man7/cdist-type__apt_mark.html">cdist-type__apt_mark(7)</a>)</p></li>
<li><p>__apt_norecommends (<a class="reference external" href="man7/cdist-type__apt_norecommends.html">cdist-type__apt_norecommends(7)</a>)</p></li>
<li><p>__apt_ppa (<a class="reference external" href="man7/cdist-type__apt_ppa.html">cdist-type__apt_ppa(7)</a>)</p></li>
<li><p>__apt_source (<a class="reference external" href="man7/cdist-type__apt_source.html">cdist-type__apt_source(7)</a>)</p></li>
<li><p>__apt_unattended_upgrades (<a class="reference external" href="man7/cdist-type__apt_unattended_upgrades.html">cdist-type__apt_unattended_upgrades(7)</a>)</p></li>
<li><p>__apt_update_index (<a class="reference external" href="man7/cdist-type__apt_update_index.html">cdist-type__apt_update_index(7)</a>)</p></li>
<li><p>__block (<a class="reference external" href="man7/cdist-type__block.html">cdist-type__block(7)</a>)</p></li>
<li><p>__ccollect_source (<a class="reference external" href="man7/cdist-type__ccollect_source.html">cdist-type__ccollect_source(7)</a>)</p></li>
<li><p>__cdist (<a class="reference external" href="man7/cdist-type__cdist.html">cdist-type__cdist(7)</a>)</p></li>
<li><p>__cdist_preos_trigger (<a class="reference external" href="man7/cdist-type__cdist_preos_trigger.html">cdist-type__cdist_preos_trigger(7)</a>)</p></li>
<li><p>__cdistmarker (<a class="reference external" href="man7/cdist-type__cdistmarker.html">cdist-type__cdistmarker(7)</a>)</p></li>
<li><p>__check_messages (<a class="reference external" href="man7/cdist-type__check_messages.html">cdist-type__check_messages(7)</a>)</p></li>
<li><p>__chroot_mount (<a class="reference external" href="man7/cdist-type__chroot_mount.html">cdist-type__chroot_mount(7)</a>)</p></li>
<li><p>__chroot_umount (<a class="reference external" href="man7/cdist-type__chroot_umount.html">cdist-type__chroot_umount(7)</a>)</p></li>
<li><p>__clean_path (<a class="reference external" href="man7/cdist-type__clean_path.html">cdist-type__clean_path(7)</a>)</p></li>
<li><p>__config_file (<a class="reference external" href="man7/cdist-type__config_file.html">cdist-type__config_file(7)</a>)</p></li>
<li><p>__consul (<a class="reference external" href="man7/cdist-type__consul.html">cdist-type__consul(7)</a>)</p></li>
<li><p>__consul_agent (<a class="reference external" href="man7/cdist-type__consul_agent.html">cdist-type__consul_agent(7)</a>)</p></li>
<li><p>__consul_check (<a class="reference external" href="man7/cdist-type__consul_check.html">cdist-type__consul_check(7)</a>)</p></li>
<li><p>__consul_reload (<a class="reference external" href="man7/cdist-type__consul_reload.html">cdist-type__consul_reload(7)</a>)</p></li>
<li><p>__consul_service (<a class="reference external" href="man7/cdist-type__consul_service.html">cdist-type__consul_service(7)</a>)</p></li>
<li><p>__consul_template (<a class="reference external" href="man7/cdist-type__consul_template.html">cdist-type__consul_template(7)</a>)</p></li>
<li><p>__consul_template_template (<a class="reference external" href="man7/cdist-type__consul_template_template.html">cdist-type__consul_template_template(7)</a>)</p></li>
<li><p>__consul_watch_checks (<a class="reference external" href="man7/cdist-type__consul_watch_checks.html">cdist-type__consul_watch_checks(7)</a>)</p></li>
<li><p>__consul_watch_event (<a class="reference external" href="man7/cdist-type__consul_watch_event.html">cdist-type__consul_watch_event(7)</a>)</p></li>
<li><p>__consul_watch_key (<a class="reference external" href="man7/cdist-type__consul_watch_key.html">cdist-type__consul_watch_key(7)</a>)</p></li>
<li><p>__consul_watch_keyprefix (<a class="reference external" href="man7/cdist-type__consul_watch_keyprefix.html">cdist-type__consul_watch_keyprefix(7)</a>)</p></li>
<li><p>__consul_watch_nodes (<a class="reference external" href="man7/cdist-type__consul_watch_nodes.html">cdist-type__consul_watch_nodes(7)</a>)</p></li>
<li><p>__consul_watch_service (<a class="reference external" href="man7/cdist-type__consul_watch_service.html">cdist-type__consul_watch_service(7)</a>)</p></li>
<li><p>__consul_watch_services (<a class="reference external" href="man7/cdist-type__consul_watch_services.html">cdist-type__consul_watch_services(7)</a>)</p></li>
<li><p>__cron (<a class="reference external" href="man7/cdist-type__cron.html">cdist-type__cron(7)</a>)</p></li>
<li><p>__daemontools (<a class="reference external" href="man7/cdist-type__daemontools.html">cdist-type__daemontools(7)</a>)</p></li>
<li><p>__daemontools_service (<a class="reference external" href="man7/cdist-type__daemontools_service.html">cdist-type__daemontools_service(7)</a>)</p></li>
<li><p>__debconf_set_selections (<a class="reference external" href="man7/cdist-type__debconf_set_selections.html">cdist-type__debconf_set_selections(7)</a>)</p></li>
<li><p>__directory (<a class="reference external" href="man7/cdist-type__directory.html">cdist-type__directory(7)</a>)</p></li>
<li><p>__docker (<a class="reference external" href="man7/cdist-type__docker.html">cdist-type__docker(7)</a>)</p></li>
<li><p>__docker_compose (<a class="reference external" href="man7/cdist-type__docker_compose.html">cdist-type__docker_compose(7)</a>)</p></li>
<li><p>__docker_config (<a class="reference external" href="man7/cdist-type__docker_config.html">cdist-type__docker_config(7)</a>)</p></li>
<li><p>__docker_secret (<a class="reference external" href="man7/cdist-type__docker_secret.html">cdist-type__docker_secret(7)</a>)</p></li>
<li><p>__docker_stack (<a class="reference external" href="man7/cdist-type__docker_stack.html">cdist-type__docker_stack(7)</a>)</p></li>
<li><p>__docker_swarm (<a class="reference external" href="man7/cdist-type__docker_swarm.html">cdist-type__docker_swarm(7)</a>)</p></li>
<li><p>__dog_vdi (<a class="reference external" href="man7/cdist-type__dog_vdi.html">cdist-type__dog_vdi(7)</a>)</p></li>
<li><p>__dot_file (<a class="reference external" href="man7/cdist-type__dot_file.html">cdist-type__dot_file(7)</a>)</p></li>
<li><p>__file_old (<a class="reference external" href="man7/cdist-type__file_old.html">cdist-type__file_old(7)</a>)</p></li>
<li><p>__filesystem (<a class="reference external" href="man7/cdist-type__filesystem.html">cdist-type__filesystem(7)</a>)</p></li>
<li><p>__firewalld_rule (<a class="reference external" href="man7/cdist-type__firewalld_rule.html">cdist-type__firewalld_rule(7)</a>)</p></li>
<li><p>__firewalld_start (<a class="reference external" href="man7/cdist-type__firewalld_start.html">cdist-type__firewalld_start(7)</a>)</p></li>
<li><p>__git (<a class="reference external" href="man7/cdist-type__git.html">cdist-type__git(7)</a>)</p></li>
<li><p>__go_get (<a class="reference external" href="man7/cdist-type__go_get.html">cdist-type__go_get(7)</a>)</p></li>
<li><p>__golang_from_vendor (<a class="reference external" href="man7/cdist-type__golang_from_vendor.html">cdist-type__golang_from_vendor(7)</a>)</p></li>
<li><p>__grafana_dashboard (<a class="reference external" href="man7/cdist-type__grafana_dashboard.html">cdist-type__grafana_dashboard(7)</a>)</p></li>
<li><p>__group (<a class="reference external" href="man7/cdist-type__group.html">cdist-type__group(7)</a>)</p></li>
<li><p>__hostname (<a class="reference external" href="man7/cdist-type__hostname.html">cdist-type__hostname(7)</a>)</p></li>
<li><p>__hosts (<a class="reference external" href="man7/cdist-type__hosts.html">cdist-type__hosts(7)</a>)</p></li>
<li><p>__install_bootloader_grub (<a class="reference external" href="man7/cdist-type__install_bootloader_grub.html">cdist-type__install_bootloader_grub(7)</a>)</p></li>
<li><p>__install_chroot_mount (<a class="reference external" href="man7/cdist-type__install_chroot_mount.html">cdist-type__install_chroot_mount(7)</a>)</p></li>
<li><p>__install_chroot_umount (<a class="reference external" href="man7/cdist-type__install_chroot_umount.html">cdist-type__install_chroot_umount(7)</a>)</p></li>
<li><p>__install_config (<a class="reference external" href="man7/cdist-type__install_config.html">cdist-type__install_config(7)</a>)</p></li>
<li><p>__install_coreos (<a class="reference external" href="man7/cdist-type__install_coreos.html">cdist-type__install_coreos(7)</a>)</p></li>
<li><p>__install_directory (<a class="reference external" href="man7/cdist-type__install_directory.html">cdist-type__install_directory(7)</a>)</p></li>
<li><p>__install_file (<a class="reference external" href="man7/cdist-type__install_file.html">cdist-type__install_file(7)</a>)</p></li>
<li><p>__install_fstab (<a class="reference external" href="man7/cdist-type__install_fstab.html">cdist-type__install_fstab(7)</a>)</p></li>
<li><p>__install_generate_fstab (<a class="reference external" href="man7/cdist-type__install_generate_fstab.html">cdist-type__install_generate_fstab(7)</a>)</p></li>
<li><p>__install_mkfs (<a class="reference external" href="man7/cdist-type__install_mkfs.html">cdist-type__install_mkfs(7)</a>)</p></li>
<li><p>__install_mount (<a class="reference external" href="man7/cdist-type__install_mount.html">cdist-type__install_mount(7)</a>)</p></li>
<li><p>__install_partition_msdos (<a class="reference external" href="man7/cdist-type__install_partition_msdos.html">cdist-type__install_partition_msdos(7)</a>)</p></li>
<li><p>__install_partition_msdos_apply (<a class="reference external" href="man7/cdist-type__install_partition_msdos_apply.html">cdist-type__install_partition_msdos_apply(7)</a>)</p></li>
<li><p>__install_reboot (<a class="reference external" href="man7/cdist-type__install_reboot.html">cdist-type__install_reboot(7)</a>)</p></li>
<li><p>__install_reset_disk (<a class="reference external" href="man7/cdist-type__install_reset_disk.html">cdist-type__install_reset_disk(7)</a>)</p></li>
<li><p>__install_stage (<a class="reference external" href="man7/cdist-type__install_stage.html">cdist-type__install_stage(7)</a>)</p></li>
<li><p>__install_umount (<a class="reference external" href="man7/cdist-type__install_umount.html">cdist-type__install_umount(7)</a>)</p></li>
<li><p>__iptables_apply (<a class="reference external" href="man7/cdist-type__iptables_apply.html">cdist-type__iptables_apply(7)</a>)</p></li>
<li><p>__iptables_rule (<a class="reference external" href="man7/cdist-type__iptables_rule.html">cdist-type__iptables_rule(7)</a>)</p></li>
<li><p>__issue (<a class="reference external" href="man7/cdist-type__issue.html">cdist-type__issue(7)</a>)</p></li>
<li><p>__jail (<a class="reference external" href="man7/cdist-type__jail.html">cdist-type__jail(7)</a>)</p></li>
<li><p>__jail_freebsd10 (<a class="reference external" href="man7/cdist-type__jail_freebsd10.html">cdist-type__jail_freebsd10(7)</a>)</p></li>
<li><p>__jail_freebsd9 (<a class="reference external" href="man7/cdist-type__jail_freebsd9.html">cdist-type__jail_freebsd9(7)</a>)</p></li>
<li><p>__key_value (<a class="reference external" href="man7/cdist-type__key_value.html">cdist-type__key_value(7)</a>)</p></li>
<li><p>__keyboard (<a class="reference external" href="man7/cdist-type__keyboard.html">cdist-type__keyboard(7)</a>)</p></li>
<li><p>__letsencrypt_cert (<a class="reference external" href="man7/cdist-type__letsencrypt_cert.html">cdist-type__letsencrypt_cert(7)</a>)</p></li>
<li><p>__line (<a class="reference external" href="man7/cdist-type__line.html">cdist-type__line(7)</a>)</p></li>
<li><p>__link (<a class="reference external" href="man7/cdist-type__link.html">cdist-type__link(7)</a>)</p></li>
<li><p>__locale (<a class="reference external" href="man7/cdist-type__locale.html">cdist-type__locale(7)</a>)</p></li>
<li><p>__locale_system (<a class="reference external" href="man7/cdist-type__locale_system.html">cdist-type__locale_system(7)</a>)</p></li>
<li><p>__motd (<a class="reference external" href="man7/cdist-type__motd.html">cdist-type__motd(7)</a>)</p></li>
<li><p>__mount (<a class="reference external" href="man7/cdist-type__mount.html">cdist-type__mount(7)</a>)</p></li>
<li><p>__mysql_database (<a class="reference external" href="man7/cdist-type__mysql_database.html">cdist-type__mysql_database(7)</a>)</p></li>
<li><p>__mysql_privileges (<a class="reference external" href="man7/cdist-type__mysql_privileges.html">cdist-type__mysql_privileges(7)</a>)</p></li>
<li><p>__mysql_user (<a class="reference external" href="man7/cdist-type__mysql_user.html">cdist-type__mysql_user(7)</a>)</p></li>
<li><p>__openldap_server (<a class="reference external" href="man7/cdist-type__openldap_server.html">cdist-type__openldap_server(7)</a>)</p></li>
<li><p>__package (<a class="reference external" href="man7/cdist-type__package.html">cdist-type__package(7)</a>)</p></li>
<li><p>__package_apk (<a class="reference external" href="man7/cdist-type__package_apk.html">cdist-type__package_apk(7)</a>)</p></li>
<li><p>__package_apt (<a class="reference external" href="man7/cdist-type__package_apt.html">cdist-type__package_apt(7)</a>)</p></li>
<li><p>__package_dpkg (<a class="reference external" href="man7/cdist-type__package_dpkg.html">cdist-type__package_dpkg(7)</a>)</p></li>
<li><p>__package_emerge (<a class="reference external" href="man7/cdist-type__package_emerge.html">cdist-type__package_emerge(7)</a>)</p></li>
<li><p>__package_emerge_dependencies (<a class="reference external" href="man7/cdist-type__package_emerge_dependencies.html">cdist-type__package_emerge_dependencies(7)</a>)</p></li>
<li><p>__package_luarocks (<a class="reference external" href="man7/cdist-type__package_luarocks.html">cdist-type__package_luarocks(7)</a>)</p></li>
<li><p>__package_opkg (<a class="reference external" href="man7/cdist-type__package_opkg.html">cdist-type__package_opkg(7)</a>)</p></li>
<li><p>__package_pacman (<a class="reference external" href="man7/cdist-type__package_pacman.html">cdist-type__package_pacman(7)</a>)</p></li>
<li><p>__package_pip (<a class="reference external" href="man7/cdist-type__package_pip.html">cdist-type__package_pip(7)</a>)</p></li>
<li><p>__package_pkg_freebsd (<a class="reference external" href="man7/cdist-type__package_pkg_freebsd.html">cdist-type__package_pkg_freebsd(7)</a>)</p></li>
<li><p>__package_pkg_openbsd (<a class="reference external" href="man7/cdist-type__package_pkg_openbsd.html">cdist-type__package_pkg_openbsd(7)</a>)</p></li>
<li><p>__package_pkgng_freebsd (<a class="reference external" href="man7/cdist-type__package_pkgng_freebsd.html">cdist-type__package_pkgng_freebsd(7)</a>)</p></li>
<li><p>__package_rubygem (<a class="reference external" href="man7/cdist-type__package_rubygem.html">cdist-type__package_rubygem(7)</a>)</p></li>
<li><p>__package_update_index (<a class="reference external" href="man7/cdist-type__package_update_index.html">cdist-type__package_update_index(7)</a>)</p></li>
<li><p>__package_upgrade_all (<a class="reference external" href="man7/cdist-type__package_upgrade_all.html">cdist-type__package_upgrade_all(7)</a>)</p></li>
<li><p>__package_yum (<a class="reference external" href="man7/cdist-type__package_yum.html">cdist-type__package_yum(7)</a>)</p></li>
<li><p>__package_zypper (<a class="reference external" href="man7/cdist-type__package_zypper.html">cdist-type__package_zypper(7)</a>)</p></li>
<li><p>__pacman_conf (<a class="reference external" href="man7/cdist-type__pacman_conf.html">cdist-type__pacman_conf(7)</a>)</p></li>
<li><p>__pacman_conf_integrate (<a class="reference external" href="man7/cdist-type__pacman_conf_integrate.html">cdist-type__pacman_conf_integrate(7)</a>)</p></li>
<li><p>__pf_apply (<a class="reference external" href="man7/cdist-type__pf_apply.html">cdist-type__pf_apply(7)</a>)</p></li>
<li><p>__pf_apply_anchor (<a class="reference external" href="man7/cdist-type__pf_apply_anchor.html">cdist-type__pf_apply_anchor(7)</a>)</p></li>
<li><p>__pf_ruleset (<a class="reference external" href="man7/cdist-type__pf_ruleset.html">cdist-type__pf_ruleset(7)</a>)</p></li>
<li><p>__ping (<a class="reference external" href="man7/cdist-type__ping.html">cdist-type__ping(7)</a>)</p></li>
<li><p>__postfix (<a class="reference external" href="man7/cdist-type__postfix.html">cdist-type__postfix(7)</a>)</p></li>
<li><p>__postfix_master (<a class="reference external" href="man7/cdist-type__postfix_master.html">cdist-type__postfix_master(7)</a>)</p></li>
<li><p>__postfix_postconf (<a class="reference external" href="man7/cdist-type__postfix_postconf.html">cdist-type__postfix_postconf(7)</a>)</p></li>
<li><p>__postfix_postmap (<a class="reference external" href="man7/cdist-type__postfix_postmap.html">cdist-type__postfix_postmap(7)</a>)</p></li>
<li><p>__postfix_reload (<a class="reference external" href="man7/cdist-type__postfix_reload.html">cdist-type__postfix_reload(7)</a>)</p></li>
<li><p>__postgres_database (<a class="reference external" href="man7/cdist-type__postgres_database.html">cdist-type__postgres_database(7)</a>)</p></li>
<li><p>__postgres_extension (<a class="reference external" href="man7/cdist-type__postgres_extension.html">cdist-type__postgres_extension(7)</a>)</p></li>
<li><p>__postgres_role (<a class="reference external" href="man7/cdist-type__postgres_role.html">cdist-type__postgres_role(7)</a>)</p></li>
<li><p>__process (<a class="reference external" href="man7/cdist-type__process.html">cdist-type__process(7)</a>)</p></li>
<li><p>__prometheus_alertmanager (<a class="reference external" href="man7/cdist-type__prometheus_alertmanager.html">cdist-type__prometheus_alertmanager(7)</a>)</p></li>
<li><p>__prometheus_exporter (<a class="reference external" href="man7/cdist-type__prometheus_exporter.html">cdist-type__prometheus_exporter(7)</a>)</p></li>
<li><p>__prometheus_server (<a class="reference external" href="man7/cdist-type__prometheus_server.html">cdist-type__prometheus_server(7)</a>)</p></li>
<li><p>__pyvenv (<a class="reference external" href="man7/cdist-type__pyvenv.html">cdist-type__pyvenv(7)</a>)</p></li>
<li><p>__qemu_img (<a class="reference external" href="man7/cdist-type__qemu_img.html">cdist-type__qemu_img(7)</a>)</p></li>
<li><p>__rbenv (<a class="reference external" href="man7/cdist-type__rbenv.html">cdist-type__rbenv(7)</a>)</p></li>
<li><p>__rsync (<a class="reference external" href="man7/cdist-type__rsync.html">cdist-type__rsync(7)</a>)</p></li>
<li><p>__rvm (<a class="reference external" href="man7/cdist-type__rvm.html">cdist-type__rvm(7)</a>)</p></li>
<li><p>__rvm_gem (<a class="reference external" href="man7/cdist-type__rvm_gem.html">cdist-type__rvm_gem(7)</a>)</p></li>
<li><p>__rvm_gemset (<a class="reference external" href="man7/cdist-type__rvm_gemset.html">cdist-type__rvm_gemset(7)</a>)</p></li>
<li><p>__rvm_ruby (<a class="reference external" href="man7/cdist-type__rvm_ruby.html">cdist-type__rvm_ruby(7)</a>)</p></li>
<li><p>__sensible_editor (<a class="reference external" href="man7/cdist-type__sensible_editor.html">cdist-type__sensible_editor(7)</a>)</p></li>
<li><p>__service (<a class="reference external" href="man7/cdist-type__service.html">cdist-type__service(7)</a>)</p></li>
<li><p>__ssh_authorized_key (<a class="reference external" href="man7/cdist-type__ssh_authorized_key.html">cdist-type__ssh_authorized_key(7)</a>)</p></li>
<li><p>__ssh_authorized_keys (<a class="reference external" href="man7/cdist-type__ssh_authorized_keys.html">cdist-type__ssh_authorized_keys(7)</a>)</p></li>
<li><p>__ssh_dot_ssh (<a class="reference external" href="man7/cdist-type__ssh_dot_ssh.html">cdist-type__ssh_dot_ssh(7)</a>)</p></li>
<li><p>__staged_file (<a class="reference external" href="man7/cdist-type__staged_file.html">cdist-type__staged_file(7)</a>)</p></li>
<li><p>__start_on_boot (<a class="reference external" href="man7/cdist-type__start_on_boot.html">cdist-type__start_on_boot(7)</a>)</p></li>
<li><p>__sysctl (<a class="reference external" href="man7/cdist-type__sysctl.html">cdist-type__sysctl(7)</a>)</p></li>
<li><p>__systemd_service (<a class="reference external" href="man7/cdist-type__systemd_service.html">cdist-type__systemd_service(7)</a>)</p></li>
<li><p>__systemd_unit (<a class="reference external" href="man7/cdist-type__systemd_unit.html">cdist-type__systemd_unit(7)</a>)</p></li>
<li><p>__timezone (<a class="reference external" href="man7/cdist-type__timezone.html">cdist-type__timezone(7)</a>)</p></li>
<li><p>__ufw (<a class="reference external" href="man7/cdist-type__ufw.html">cdist-type__ufw(7)</a>)</p></li>
<li><p>__ufw_rule (<a class="reference external" href="man7/cdist-type__ufw_rule.html">cdist-type__ufw_rule(7)</a>)</p></li>
<li><p>__update_alternatives (<a class="reference external" href="man7/cdist-type__update_alternatives.html">cdist-type__update_alternatives(7)</a>)</p></li>
<li><p>__user (<a class="reference external" href="man7/cdist-type__user.html">cdist-type__user(7)</a>)</p></li>
<li><p>__user_groups (<a class="reference external" href="man7/cdist-type__user_groups.html">cdist-type__user_groups(7)</a>)</p></li>
<li><p>__xymon_apache (<a class="reference external" href="man7/cdist-type__xymon_apache.html">cdist-type__xymon_apache(7)</a>)</p></li>
<li><p>__xymon_client (<a class="reference external" href="man7/cdist-type__xymon_client.html">cdist-type__xymon_client(7)</a>)</p></li>
<li><p>__xymon_config (<a class="reference external" href="man7/cdist-type__xymon_config.html">cdist-type__xymon_config(7)</a>)</p></li>
<li><p>__xymon_server (<a class="reference external" href="man7/cdist-type__xymon_server.html">cdist-type__xymon_server(7)</a>)</p></li>
<li><p>__yum_repo (<a class="reference external" href="man7/cdist-type__yum_repo.html">cdist-type__yum_repo(7)</a>)</p></li>
<li><p>__zypper_repo (<a class="reference external" href="man7/cdist-type__zypper_repo.html">cdist-type__zypper_repo(7)</a>)</p></li>
<li><p>__zypper_service (<a class="reference external" href="man7/cdist-type__zypper_service.html">cdist-type__zypper_service(7)</a>)</p></li>
</ul>
</div>
<div class="section" id="objects">
<h2>24.4. Objects<a class="headerlink" href="#objects" title="Permalink to this headline"></a></h2>
<h2><span class="section-number">24.4. </span>Objects<a class="headerlink" href="#objects" title="Permalink to this headline"></a></h2>
<p>For object to object communication and tests, the following paths are
usable within a object directory:</p>
<dl class="docutils">
<dt>files</dt>