cdist-6.0.2/ 000755 001751 001751 00000000000 13552030341 013065 5 ustar 00darko darko 000000 000000 cdist-6.0.2/MANIFEST.in 000644 001751 001751 00000000154 13552030341 014623 0 ustar 00darko darko 000000 000000 include docs/changelog
recursive-include docs/gfx *.png *.text
recursive-include docs *.text *.html *.1 *.7
cdist-6.0.2/Makefile 000644 001751 001751 00000007567 13552030341 014544 0 ustar 00darko darko 000000 000000 #
# 2013 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
.PHONY: help
help:
@echo "Please use \`make ' where is one of"
@echo "man build only man user documentation"
@echo "html build only html user documentation"
@echo "docs build both man and html user documentation"
@echo "dotman build man pages for types in your ~/.cdist directory"
@echo "speeches build speeches pdf files"
@echo "install install in the system site-packages directory"
@echo "install-user install in the user site-packages directory"
@echo "docs-clean clean documentation"
@echo "clean clean"
DOCS_SRC_DIR=./docs/src
SPEECHDIR=./docs/speeches
TYPEDIR=./cdist/conf/type
SPHINXM=make -C $(DOCS_SRC_DIR) man
SPHINXH=make -C $(DOCS_SRC_DIR) html
SPHINXC=make -C $(DOCS_SRC_DIR) clean
################################################################################
# Manpages
#
MAN7DSTDIR=$(DOCS_SRC_DIR)/man7
# Manpages #1: Types
# Use shell / ls to get complete list - $(TYPEDIR)/*/man.rst does not work
# Using ls does not work if no file with given pattern exist, so use wildcard
MANTYPESRC=$(wildcard $(TYPEDIR)/*/man.rst)
MANTYPEPREFIX=$(subst $(TYPEDIR)/,$(MAN7DSTDIR)/cdist-type,$(MANTYPESRC))
MANTYPES=$(subst /man.rst,.rst,$(MANTYPEPREFIX))
# Link manpage: do not create man.html but correct named file
$(MAN7DSTDIR)/cdist-type%.rst: $(TYPEDIR)/%/man.rst
mkdir -p $(MAN7DSTDIR)
ln -sf "../../../$^" $@
# Manpages #2: reference
DOCSREF=$(MAN7DSTDIR)/cdist-reference.rst
DOCSREFSH=$(DOCS_SRC_DIR)/cdist-reference.rst.sh
$(DOCSREF): $(DOCSREFSH)
$(DOCSREFSH)
version:
@[ -f "cdist/version.py" ] || { \
printf "Missing 'cdist/version.py', please generate it first.\n" && exit 1; \
}
# Manpages #3: generic part
man: version $(MANTYPES) $(DOCSREF)
$(SPHINXM)
html: version $(MANTYPES) $(DOCSREF)
$(SPHINXH)
docs: man html
docs-clean:
$(SPHINXC)
# Manpages: .cdist Types
DOT_CDIST_PATH=${HOME}/.cdist
DOTMAN7DSTDIR=$(MAN7DSTDIR)
DOTTYPEDIR=$(DOT_CDIST_PATH)/type
DOTMANTYPESRC=$(wildcard $(DOTTYPEDIR)/*/man.rst)
DOTMANTYPEPREFIX=$(subst $(DOTTYPEDIR)/,$(DOTMAN7DSTDIR)/cdist-type,$(DOTMANTYPESRC))
DOTMANTYPES=$(subst /man.rst,.rst,$(DOTMANTYPEPREFIX))
# Link manpage: do not create man.html but correct named file
$(DOTMAN7DSTDIR)/cdist-type%.rst: $(DOTTYPEDIR)/%/man.rst
ln -sf "$^" $@
dotman: version $(DOTMANTYPES)
$(SPHINXM)
################################################################################
# Speeches
#
SPEECHESOURCES=$(SPEECHDIR)/*.tex
SPEECHES=$(SPEECHESOURCES:.tex=.pdf)
# Create speeches and ensure Toc is up-to-date
$(SPEECHDIR)/%.pdf: $(SPEECHDIR)/%.tex
pdflatex -output-directory $(SPEECHDIR) $^
pdflatex -output-directory $(SPEECHDIR) $^
pdflatex -output-directory $(SPEECHDIR) $^
speeches: $(SPEECHES)
################################################################################
# Misc
#
clean: docs-clean
rm -f $(DOCS_SRC_DIR)/cdist-reference.rst
find "$(DOCS_SRC_DIR)" -mindepth 2 -type l \
| xargs rm -f
find * -name __pycache__ | xargs rm -rf
# distutils
rm -rf ./build
################################################################################
# install
#
install:
python3 setup.py install
install-user:
python3 setup.py install --user
cdist-6.0.2/PKGBUILD.in 000755 001751 001751 00000001273 13552030341 014624 0 ustar 00darko darko 000000 000000 #!/bin/sh
version="$1"
outfile=${0%.in}
cat << eof > "${outfile}"
pkgname=cdist
pkgver=$version
pkgrel=1
pkgdesc='A Usable Configuration Management System"'
arch=('any')
url='https://www.cdi.st/'
license=('GPL3')
depends=('python>=3.2.0')
source=("http://pypi.python.org/packages/source/c/cdist/cdist-\${pkgver}.tar.gz")
package() {
cd cdist-\${pkgver}
python3 setup.py build install --root="\${pkgdir}"
find "\$pkgdir" -type d -exec chmod 0755 {} \;
find "\$pkgdir" -type f -exec chmod a+r {} \;
}
eof
makepkg -g >> "${outfile}"
# Fix this issue:
# error: failed to upload cdist-3.1.6-1.src.tar.gz: Error - all files must have permissions of 644 or 755.
chmod a+r "${outfile}"
cdist-6.0.2/README 000644 001751 001751 00000000252 13552030341 013744 0 ustar 00darko darko 000000 000000 cdist
-----
cdist is a usable configuration management system.
For the web documentation have a look at https://www.cdi.st/
or at docs/src for reStructuredText manual.
cdist-6.0.2/bin/ 000755 001751 001751 00000000000 13552030341 013635 5 ustar 00darko darko 000000 000000 cdist-6.0.2/cdist/ 000755 001751 001751 00000000000 13552031152 014174 5 ustar 00darko darko 000000 000000 cdist-6.0.2/completions/ 000755 001751 001751 00000000000 13552030341 015421 5 ustar 00darko darko 000000 000000 cdist-6.0.2/configuration/ 000755 001751 001751 00000000000 13552030341 015734 5 ustar 00darko darko 000000 000000 cdist-6.0.2/docs/ 000755 001751 001751 00000000000 13552030341 014015 5 ustar 00darko darko 000000 000000 cdist-6.0.2/hacking/ 000755 001751 001751 00000000000 13552030341 014471 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/ 000755 001751 001751 00000000000 13552030341 014206 5 ustar 00darko darko 000000 000000 cdist-6.0.2/scripts/ 000755 001751 001751 00000000000 13552030341 014554 5 ustar 00darko darko 000000 000000 cdist-6.0.2/setup.py 000644 001751 001751 00000004143 13552030341 014601 0 ustar 00darko darko 000000 000000 from distutils.core import setup
import cdist
import os
import re
def data_finder(data_dir):
entries = []
for name in os.listdir(data_dir):
# Skip .gitignore files
if name == ".gitignore":
continue
# Skip vim swp files
swpfile = re.search(r'^\..*\.swp$', name)
if swpfile:
continue
entry = os.path.join(data_dir, name)
if os.path.isdir(entry):
entries.extend(data_finder(entry))
else:
entries.append(entry)
return entries
cur = os.getcwd()
os.chdir("cdist")
package_data = data_finder("conf")
os.chdir(cur)
setup(
name="cdist",
packages=["cdist", "cdist.core", "cdist.exec", "cdist.util", ],
package_data={'cdist': package_data},
scripts=["scripts/cdist", "scripts/cdist-dump", "scripts/cdist-new-type"],
version=cdist.version.VERSION,
description="A Usable Configuration Management System",
author="Nico Schottelius",
author_email="nico-cdist-pypi@schottelius.org",
url="https://www.cdi.st/",
classifiers=[
"Development Status :: 6 - Mature",
"Environment :: Console",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: BSD",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: System :: Boot",
"Topic :: System :: Installation/Setup",
"Topic :: System :: Operating System",
"Topic :: System :: Software Distribution",
"Topic :: Utilities"
],
long_description='''
cdist is a usable configuration management system.
It adheres to the KISS principle and is being used in small up to
enterprise grade environments.
cdist is an alternative to other configuration management systems like
cfengine, bcfg2, chef and puppet.
'''
)
cdist-6.0.2/scripts/cdist 000755 001751 001751 00000004560 13552030341 015615 0 ustar 00darko darko 000000 000000 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 2010-2016 Nico Schottelius (nico-cdist at schottelius.org)
# 2016 Darko Poljak (darko.poljak at gmail.com)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
import logging
import sys
import cdist
import cdist.argparse
import cdist.banner
import cdist.config
import cdist.install
import cdist.shell
import cdist.inventory
def commandline():
"""Parse command line"""
# preos subcommand hack
if len(sys.argv) > 1 and sys.argv[1] == 'preos':
return cdist.preos.PreOS.commandline(sys.argv[1:])
parser, cfg = cdist.argparse.parse_and_configure(sys.argv[1:])
args = cfg.get_args()
# Work around python 3.3 bug:
# http://bugs.python.org/issue16308
# http://bugs.python.org/issue9253
# FIXME: catching AttributeError also hides
# real problems.. try a different way
# FIXME: we always print main help, not
# the help of the actual parser being used!
try:
getattr(args, "func")
except AttributeError:
parser['main'].print_help()
sys.exit(0)
args.func(args)
if __name__ == "__main__":
cdistpythonversion = '3.2'
if sys.version < cdistpythonversion:
print('Python >= {} is required on the source host.'.format(
cdistpythonversion), file=sys.stderr)
sys.exit(1)
exit_code = 0
try:
import re
import os
if re.match("__", os.path.basename(sys.argv[0])):
import cdist.emulator
emulator = cdist.emulator.Emulator(sys.argv)
emulator.run()
else:
commandline()
except KeyboardInterrupt:
exit_code = 2
except cdist.Error as e:
log = logging.getLogger("cdist")
log.error(e)
exit_code = 1
sys.exit(exit_code)
cdist-6.0.2/scripts/cdist-dump 000755 001751 001751 00000014364 13552030341 016563 0 ustar 00darko darko 000000 000000 #!/bin/sh
VERSION="0.0.1"
RELEASE=""
set -u
# set -x
hosts=
cache_dir=~/.cdist/cache
do_all=1
do_global_explorer=
do_type_explorer=
do_script_stdout=
do_script_stderr=
do_gencode=
do_code=
do_messages=
do_parameter=
delimiter=':'
ln=
filename_prefix=1
verbose=0
myname=${0##*/}
print_version()
{
printf "%s %s %s\n" "${myname}" "${VERSION}" "${RELEASE}"
}
usage()
{
cat << eof
${myname}: [options] [host...]
eof
print_version
cat << eof
Dump data from cache directories.
host
Dump data for specified hosts. If not specified then all data
from cache directory is dumped.
Options
-a dump all
-C CACHE-DIR use specified CACHE-DIR (default: ~/.cdist/cache)
-c dump code-*
-d DELIMITER delimiter used for filename and line number prefix (default: ':')
-E dump global explorers
-e dump type explorers
-F disable filename prefix (enabled by default)
-f enable filename prefix (default)
-g dump gencode-*
-h show this help screen and exit
-L disable line number prefix (default)
-l enable line number prefix (disabled by default)
-m dump messages
-o dump executions' stdout
-p dump parameters
-r dump executions' stderr
-V show version and exit
-v increase verbosity
eof
}
exit_err()
{
printf "%s\n" "$1"
exit 1
}
# parse options
while [ "$#" -ge 1 ]
do
case "$1" in
-a)
do_all=1
;;
-C)
if [ "$#" -ge 2 ]
then
case "$2" in
-*)
exit_err "Missing cache directory"
;;
*)
cache_dir="$2"
shift
;;
esac
else
exit_err "Missing cache directory"
fi
;;
-c)
do_code=1
do_all=
;;
-d)
if [ "$#" -ge 2 ]
then
case "$2" in
-*)
exit_err "Missing delimiter"
;;
*)
delimiter="$2"
shift
;;
esac
else
exit_err "Missing delimiter"
fi
;;
-E)
do_global_explorer=1
do_all=
;;
-e)
do_type_explorer=1
do_all=
;;
-F)
filename_prefix=
;;
-f)
filename_prefix=1
;;
-g)
do_gencode=1
do_all=
;;
-h)
usage
exit 0
;;
-L)
ln=
;;
-l)
ln=1
;;
-m)
do_messages=1
do_all=
;;
-o)
do_script_stdout=1
do_all=
;;
-p)
do_parameter=1
do_all=
;;
-r)
do_script_stderr=1
do_all=
;;
-V)
print_version
exit 0
;;
-v)
verbose=$((verbose + 1))
;;
*)
hosts="${hosts} $1"
break
;;
esac
shift
done
if [ "${ln}" = "1" ]
then
ln="NR \"${delimiter}\""
fi
if [ "${filename_prefix}" = "1" ]
then
filename_prefix="{}${delimiter}"
fi
if [ "${do_all}" = "1" ]
then
do_global_explorer=1
do_type_explorer=1
do_script_stdout=1
do_script_stderr=1
do_gencode=1
do_code=1
do_messages=1
do_parameter=1
fi
set -- -size +0
set -- "$@" \(
or=
print_verbose()
{
if [ "${verbose}" -ge "$1" ]
then
printf "%s\n" "$2"
fi
}
hor_line()
{
if [ $# -gt 0 ]
then
c="$1"
else
c='='
fi
printf "%78s\n" "" | tr ' ' "${c}"
}
if [ "${do_global_explorer}" ]
then
print_verbose 2 "Dumping global explorers"
set -- "$@" ${or} \( \
-path "*/explorer/*" -a \
! -path "*/conf/*" -a \
! -path "*/object/*/explorer/*" \
\)
or="-o"
fi
if [ "${do_type_explorer}" ]
then
print_verbose 2 "Dumping type explorers"
set -- "$@" ${or} -path "*/object/*/explorer/*"
or="-o"
fi
if [ "${do_script_stdout}" ]
then
print_verbose 2 "Dumping execution's stdout"
set -- "$@" ${or} -path "*/stdout/*"
or="-o"
fi
if [ "${do_script_stderr}" ]
then
print_verbose 2 "Dumping execution's stderr"
set -- "$@" ${or} -path "*/stderr/*"
or="-o"
fi
if [ "${do_gencode}" ]
then
print_verbose 2 "Dumping gencode-*"
set -- "$@" ${or} \( -name "gencode-*" -a ! -path "*/stdout/*" -a ! -path "*/stderr/*" \)
or="-o"
fi
if [ "${do_code}" ]
then
print_verbose 2 "Dumping code-*"
set -- "$@" ${or} \( -name "code-*" -a ! -path "*/stdout/*" -a ! -path "*/stderr/*" \)
or="-o"
fi
if [ "${do_messages}" ]
then
print_verbose 2 "Dumping messages"
set -- "$@" ${or} -name "messages"
or="-o"
fi
if [ "${do_parameter}" ]
then
print_verbose 2 "Dumping parameters"
set -- "$@" ${or} -path "*/parameter/*"
or="-o"
fi
set -- "$@" \)
set -- '.' "$@" -exec awk -v prefix="${filename_prefix}" "{print prefix ${ln} \$0}" {} \;
# printf "+ %s\n" "$*"
print_verbose 2 "Using cache dir: ${cache_dir}"
OLD_PWD=$(pwd)
cd "${cache_dir}" || exit
# If no host is specified then search all.
[ -z "${hosts}" ] && hosts="-"
for host in ${hosts}
do
[ "${host}" = "-" ] && host=
# find host cache directory
host_dir=$(find . -name target_host -exec grep -l "${host}" {} +)
print_verbose 3 "found host directory files:"
print_verbose 3 "${host_dir}"
OLD_IFS="${IFS}"
IFS="
"
for d in ${host_dir}
do
dir=$(dirname "${d}")
print_verbose 0 "target host: $(cat "${dir}/target_host"), host directory: ${dir}"
hor_line '='
PREV_PWD=$(pwd)
cd "${dir}" || exit
# set -x
find "$@"
# set +x
cd "${PREV_PWD}" || exit
done
IFS="${OLD_IFS}"
done
cd "${OLD_PWD}" || exit
cdist-6.0.2/scripts/cdist-new-type 000755 001751 001751 00000005762 13552030341 017370 0 ustar 00darko darko 000000 000000 #!/bin/sh
basename="${0##*/}"
if [ $# -lt 3 ]
then
printf "usage: %s TYPE-NAME AUTHOR-NAME AUTHOR-EMAIL [TYPE-BASE-PATH]
TYPE-NAME Name of the type.
AUTHOR-NAME Type author's full name.
AUTHOR-EMAIL Type author's email.
TYPE-BASE-PATH Path to the base directory of the type. If not set it defaults
to '\$PWD/type'.\n" "${basename}"
exit 1
fi
type_name="$1"
shift
author_name="$1"
shift
author_email="$1"
shift
if [ $# -ge 1 ]
then
type_base_path="$1"
shift
else
#type_base_path=~/.cdist/type
type_base_path="$PWD/type"
fi
error() {
printf "%s\n" "$*" >&2
}
die() {
error "$@"
exit 1
}
cd "$type_base_path" || die "Could not change to type directory: $type_base_path.
You have to specify type base path or run me from within a cdist conf directory,
e.g. ~/.cdist."
year=$(date +%Y)
copyright="# $year $author_name ($author_email)"
license="# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
"
set -e
mkdir "$type_name"
cd "$type_name"
### man page
header="cdist-type${type_name}(7)"
header_length="${#header}"
cat >> man.rst << DONE
$header
$(while [ "${header_length}" -gt 0 ]; do printf "="; header_length=$((header_length - 1)); done; printf "\n";)
NAME
----
cdist-type${type_name} - TODO
DESCRIPTION
-----------
This space intentionally left blank.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
BOOLEAN PARAMETERS
------------------
None.
EXAMPLES
--------
.. code-block:: sh
# TODO
${type_name}
SEE ALSO
--------
:strong:\`TODO\`\\ (7)
AUTHORS
-------
$author_name <$author_email>
COPYING
-------
Copyright \(C) $year $author_name. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
DONE
### manifest
cat >> manifest << DONE
#!/bin/sh -e
#
${copyright}
#
${license}
os=\$(cat "\$__global/explorer/os")
case "\$os" in
*)
printf "Your operating system (%s) is currently not supported by this type (%s)\n" "\$os" "\${__type##*/}" >&2
printf "Please contribute an implementation for it if you can.\n" >&2
exit 1
;;
esac
DONE
chmod +x manifest
# gencode-remote
cat >> gencode-remote << DONE
#!/bin/sh -e
#
${copyright}
#
${license}
DONE
chmod +x gencode-remote
printf "%s/%s\n" "$type_base_path" "$type_name"
cdist-6.0.2/other/archived_types/ 000755 001751 001751 00000000000 13552030341 017217 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/ 000755 001751 001751 00000000000 13552030341 016024 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/ 000755 001751 001751 00000000000 13552030341 022363 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/.readmes/ 000755 001751 001751 00000000000 13552030341 024061 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/README 000644 001751 001751 00000000344 13552030341 023244 0 ustar 00darko darko 000000 000000 The types in this directory were submitted / thought to be
included into cdist, but for some reason did not make it into
conf/type/.
The reason for the type not being included into conf/type/
is documented in README.inclusion.
cdist-6.0.2/other/types_submitted_for_inclusion/__init_script/ 000755 001751 001751 00000000000 13552030341 025210 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/ 000755 001751 001751 00000000000 13552030341 025414 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_client/ 000755 001751 001751 00000000000 13552030341 025005 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/ 000755 001751 001751 00000000000 13552030341 025050 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_server/ 000755 001751 001751 00000000000 13552030341 025035 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__rsyncer/ 000755 001751 001751 00000000000 13552030341 024346 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__run_command/ 000755 001751 001751 00000000000 13552030341 025163 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__run_command/README.inclusion 000644 001751 001751 00000000571 13552030341 030050 0 ustar 00darko darko 000000 000000 This type is not much of use, as any type can issue code to be executed.
Thus you can implement the code directly in the calling type.
Or if you need to reuse it, create a type on its own.
Because this seems to be a common misunderstanding when people come from "non managed areas",
where script iexecution is the main focus, I documented this in cdist-hacker to clearify.
cdist-6.0.2/other/types_submitted_for_inclusion/__run_command/gencode-remote 000755 001751 001751 00000001467 13552030341 030016 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Benedikt Koeppel (code at benediktkoeppel.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
if [ -f "$__object/parameter/command" ]; then
cat "$__object/parameter/command"
else
echo "$name"
fi
cdist-6.0.2/other/types_submitted_for_inclusion/__run_command/man.rst 000644 001751 001751 00000003306 13552030341 026472 0 ustar 00darko darko 000000 000000 cdist-type__run_command(7)
==========================
Run a command
Benedikt Koeppel
DESCRIPTION
-----------
This cdist type allows you to run a specific command once at installation time.
REQUIRED PARAMETERS
-------------------
OPTIONAL PARAMETERS
-------------------
command
Command (with arguments) to run.
If no command is give, then the object_id is executed.
EXAMPLES
--------
.. code-block:: sh
# Run a command
__run_command "/etc/init.d/mysql restart"
# runs `/etc/init.d/mysql restart` (the "object_id")
# Run the same command:
__run_command restart-mysql --command "/etc/init.d/mysql restart"
# runs `/etc/init.d/mysql restart` (the --command argument)
# additionally, it can easily be referenced (for example in a require="..."
#as __run_command/restart-mysql
# Run a script:
__run_command install-pear --command "$(cat <<-EOF
/usr/bin/pear install --force Auth
/usr/bin/pear install --force HTML_Template_IT-1.2.1
/usr/bin/pear install --force MDB2
/usr/bin/pear install --force MDB2#mysql
/usr/bin/pear config-set preferred_state beta;
/usr/bin/pear install --force --alldeps Spreadsheet_Excel_Writer;
/usr/bin/pear config-set preferred_state stable
/usr/bin/pear install --force HTTP_Request
/usr/bin/pear install --force Mail
/usr/bin/pear install --force Auth_HTTP
/usr/bin/pear install --force XML_RPC
EOF
)"
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2012 Benedikt Koeppel. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/types_submitted_for_inclusion/__run_command/parameter/ 000755 001751 001751 00000000000 13552030341 027143 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__run_command/parameter/optional 000644 001751 001751 00000000010 13552030341 030702 0 ustar 00darko darko 000000 000000 command
cdist-6.0.2/other/types_submitted_for_inclusion/__run_command/parameter/required 000644 001751 001751 00000000000 13552030341 030674 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__rsyncer/README.inclusion 000644 001751 001751 00000001340 13552030341 027226 0 ustar 00darko darko 000000 000000 Description:
Type that supports transfer of huge data, which is a general problem in
configuration management systems.
Good solution using standardised rsync approach.
Problem:
Uses root@$__target_host:$destination notation for transfer.
This breaks the concept of being able to replace __remote_exec and
__remote_copy and then doing chroot or different stuff.
This breaks for instance, if __remote_copy = cp and the destination is
a local chroot.
Solutions:
- Have cdist provide support for rsync syntax?
- Integrate __rsyncer more in line with philosohpy of other components
- Think about the general way of __rsyncer and what cdist would need
to provide for general solution.
cdist-6.0.2/other/types_submitted_for_inclusion/__rsyncer/gencode-local 000755 001751 001751 00000002720 13552030341 026771 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# Copyright (C) 2011 Daniel Maher (phrawzty+cdist at gmail.com)
#
# This file is part of cdist (https://github.com/telmich/cdist/).
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
source="$(cat "$__object/parameter/source")"
if [ -f "$__object/parameter/destination" ]; then
destination="$(cat "$__object/parameter/destination")"
else
destination="/$__object_id"
fi
# The system binary is probably ok, but if not...
if [ -f "$__object/parameter/rsyncbin" ]; then
rsyncbin="$(cat "$__object/parameter/rsyncbin")"
else
rsyncbin=`which rsync`
fi
args='-a'
# If the --delete argument should be passed to rsync.
if [ -f "$__object/parameter/delete" ]; then
args="$args --delete"
fi
# FIXME:
# - using root@ may break - find a good way to avoid this
# - align with __remote_{exec,copy} variables?
# Run rsync (locally).
echo "$rsyncbin $args $source root@$__target_host:$destination"
cdist-6.0.2/other/types_submitted_for_inclusion/__rsyncer/man.rst 000644 001751 001751 00000002671 13552030341 025661 0 ustar 00darko darko 000000 000000 cdist-type__rsyncer(7)
======================
Use rsync to copy files.
Daniel Maher
DESCRIPTION
-----------
This type is used to trigger rsync to copy files from the machine running cdist
(source) to the target machine in question (destination). The likely usage is
the rapid deployment of full directory trees, the cohorency of which can be
guarunteed with the optional --delete argument, which will remove any files
from the destination which are not present on the source.
REQUIRED PARAMETERS
-------------------
source
The full path of the source from which to copy. This is passed directly
to rsync.
OPTIONAL PARAMETERS
-------------------
destination
The full path of the destination. This is passed directly to rsync.
Default: object_id
delete
If true, remove files from destination which are not in source. This is
effectively the --delete argument of rsync.
Default: false
rsyncbin
Specify the full path to the rsync binary.
Default: `which rsync`
EXAMPLES
--------
.. code-block:: sh
# Basic example
__rsyncer '/home/foo' --source '/opt/dist/foo'
# Fancier example
__rsyncer FOO --source '/opt/dist/foo' --destination '/home/foo/' --delete true
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2011 Daniel Maher. Free use of this software is granted under
the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/types_submitted_for_inclusion/__rsyncer/parameter/ 000755 001751 001751 00000000000 13552030341 026326 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__rsyncer/parameter/optional 000644 001751 001751 00000000034 13552030341 030073 0 ustar 00darko darko 000000 000000 destination
delete
rsyncbin
cdist-6.0.2/other/types_submitted_for_inclusion/__rsyncer/parameter/required 000644 001751 001751 00000000007 13552030341 030066 0 ustar 00darko darko 000000 000000 source
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_server/README.inclusion 000755 001751 001751 00000000000 13552030341 036267 2../.readmes/README.inclusion.specific ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_server/man.rst 000644 001751 001751 00000001107 13552030341 026341 0 ustar 00darko darko 000000 000000 cdist-type__nfs_server(7)
=========================
nfs server
Steven Armstrong
DESCRIPTION
-----------
Install, start, do whatever is necessary to have a working nfs server.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
EXAMPLES
--------
.. code-block:: sh
__nfs_server
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_server/manifest 000755 001751 001751 00000001654 13552030341 026577 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
__nfs_client
__package nfs-kernel-server --state installed
require="__package/nfs-kernel-server" \
__process nfs-kernel-server --state running \
--start "/etc/init.d/portmap start" \
--name ".*rpc.mountd.*"
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_server/singleton 000644 001751 001751 00000000000 13552030341 026750 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/README.inclusion 000755 001751 001751 00000000000 13552030341 036463 2../.readmes/README.inclusion.dependent ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/explorer/ 000755 001751 001751 00000000000 13552030341 026710 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/gencode-remote 000755 001751 001751 00000003341 13552030341 027674 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
exports_d="$(cat "$__object/explorer/exports.d")"
state_should="$(cat "$__object/parameter/state")"
state_is=$(diff -q "$__object/parameter/entry" "$__object/explorer/entry" \
&& echo present \
|| echo absent
)
if [ "$state_is" != "$state_should" ]; then
if [ "$exports_d" != "present" ]; then
case "$state_should" in
present)
cat << DONE
cat >> /etc/exports << EOC
$(cat "$__object/parameter/entry")
EOC
DONE
;;
absent)
# defined in type manifest
prefix="$(cat "$__object/parameter/prefix")"
suffix="$(cat "$__object/parameter/suffix")"
cat << DONE
cat /etc/exports
awk -v prefix="$prefix" -v suffix="$suffix" '
{
if (index(\$0,prefix)) {
triggered=1
}
if (triggered) {
if (index(\$0,suffix)) {
triggered=0
}
} else {
print
}
}' /etc/exports > /etc/exports+
mv -f /etc/exports+ /etc/exports
DONE
;;
esac
fi
# re-export if we changed something
echo "exportfs -rf"
fi
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/man.rst 000644 001751 001751 00000002164 13552030341 026360 0 ustar 00darko darko 000000 000000 cdist-type__nfs_export(7)
=========================
Manage nfs exports
Steven Armstrong
DESCRIPTION
-----------
This cdist type allows you to manage entries in /etc/exports.d.
For older distributions (currently ubuntu lucid) that don't support
/etc/exports.d the entries are merged into the /etc/exports file.
REQUIRED PARAMETERS
-------------------
client
space delimited list of client ip/networks for use in /etc/exports. See exports(5)
OPTIONAL PARAMETERS
-------------------
options
export options for use in /etc/exports. See exports(5)
export
the directory to export. Defaults to object_id
state
Either present or absent. Defaults to present.
EXAMPLES
--------
.. code-block:: sh
__nfs_export /local/chroot/lucid-amd64 \
--client "192.168.0.1/24 10.0.0.1/16" \
--options "ro,async,no_all_squash,no_root_squash,subtree_check"
SEE ALSO
--------
- `cdist-type(7) `_
- exports(5)
COPYING
-------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/manifest 000755 001751 001751 00000003370 13552030341 026607 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
# required
client="$(cat "$__object/parameter/client")"
# optional
export="$(cat "$__object/parameter/export" 2>/dev/null \
|| echo "/$__object_id" | tee "$__object/parameter/export")"
options="$(cat "$__object/parameter/options" 2>/dev/null || true)"
state="$(cat "$__object/parameter/state" 2>/dev/null \
|| echo "present" | tee "$__object/parameter/state")"
entry="$export"
[ -n "$options" ] && entry="$entry -${options}"
entry="$entry $client"
# NOTE: if changed, also change in explorers
prefix="#cdist:__nfs_export${export}"
suffix="#/cdist:__nfs_export${export}"
echo "$prefix" | tee "$__object/parameter/prefix" > "$__object/parameter/entry"
echo "$entry" >> "$__object/parameter/entry"
echo "$suffix" | tee "$__object/parameter/suffix" >> "$__object/parameter/entry"
exports_d="$(cat "$__object/explorer/exports.d")"
if [ "$exports_d" = "present" ]; then
name="$(echo "$export" | sed 's;/;-;g')"
__file "/etc/exports.d/$name" \
--source "$__object/parameter/entry" \
--owner root --group root --mode 644
# --state "$state"
fi
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/parameter/ 000755 001751 001751 00000000000 13552030341 027030 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/parameter/optional 000644 001751 001751 00000000025 13552030341 030575 0 ustar 00darko darko 000000 000000 options
export
state
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/parameter/required 000644 001751 001751 00000000007 13552030341 030570 0 ustar 00darko darko 000000 000000 client
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/explorer/entry 000755 001751 001751 00000002303 13552030341 027775 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
export="$(cat "$__object/parameter/export" 2>/dev/null || echo "/$__object_id")"
name="$(echo "${export#/}" | sed 's;/;-;g')"
if [ -f "/etc/exports.d/$name" ]; then
cat "/etc/exports.d/$name"
else
prefix="#cdist:__nfs_export${export}"
suffix="#/cdist:__nfs_export${export}"
awk -v prefix="$prefix" -v suffix="$suffix" '{
if (index($0,prefix)) {
triggered=1
}
if (triggered) {
if (index($0,suffix)) {
triggered=0
}
print
}
}' /etc/exports
fi
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_export/explorer/exports.d 000755 001751 001751 00000001422 13552030341 030563 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
if [ -d /etc/exports.d ]; then
echo present
else
echo absent
fi
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_client/README.inclusion 000755 001751 001751 00000000000 13552030341 036237 2../.readmes/README.inclusion.specific ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_client/man.rst 000644 001751 001751 00000001107 13552030341 026311 0 ustar 00darko darko 000000 000000 cdist-type__nfs_client(7)
=========================
nfs client
Steven Armstrong
DESCRIPTION
-----------
Install, start, do whatever is necessary to have a working nfs client.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
EXAMPLES
--------
.. code-block:: sh
__nfs_client
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_client/manifest 000755 001751 001751 00000001752 13552030341 026546 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
__package nfs-common --state installed
require="__package/nfs-common" \
__process portmap --state running --start "/etc/init.d/portmap start"
require="__package/nfs-common" \
__process statd --state running \
--start "/etc/init.d/statd start" \
--name "rpc.statd.*"
cdist-6.0.2/other/types_submitted_for_inclusion/__nfs_client/singleton 000644 001751 001751 00000000000 13552030341 026720 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/README.inclusion 000755 001751 001751 00000000000 13552030341 036646 2../.readmes/README.inclusion.specific ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/files/ 000755 001751 001751 00000000000 13552030341 026516 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/gencode-remote 000755 001751 001751 00000004310 13552030341 030235 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Benedikt Koeppel (code@benediktkoeppel.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
if [ -f "$__object/parameter/no_my_cnf" ]; then
no_my_cnf="$(cat "$__object/parameter/no_my_cnf")"
else
no_my_cnf="false"
fi
if [ -f "$__object/parameter/password" ]; then
rootpassword="$(cat "$__object/parameter/password")"
else
rootpassword=""
fi
if [ "$rootpassword" != "" ]; then
# to the database without requiring a passwort input
# set root password
echo "mysqladmin -u root password $rootpassword"
# if we don't want to overwrite the .my.cnf, then take a backup now
if [ "$no_my_cnf" == "true" ]; then
mv /root/.my.cnf /root/.my.cnf.cdist.bkp
fi
# store the root password in /root/.my.cnf so that processes can connect
cat <<-EOFF
cat <<-EOF > /root/.my.cnf
[client]
password=$rootpassword
EOF
EOFF
# remove anonymous users
cat <<-EOFF
mysql -u root <<-EOF
DELETE FROM mysql.user WHERE User='';
EOF
EOFF
# remove remote-access for root
cat <<-EOFF
mysql -u root <<-EOF
DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';
EOF
EOFF
# remove test database
cat <<-EOFF
mysql -u root <<-EOF
DROP DATABASE IF EXISTS test;
EOF
EOFF
cat <<-EOFF
mysql -u root <<-EOF
DELETE FROM mysql.db WHERE Db='test' OR Db='test\_%'
EOF
EOFF
# flush privileges
cat <<-EOFF
mysql -u root <<-EOF
FLUSH PRIVILEGES;
EOF
EOFF
# if we don't want to overwrite the .my.cnf, then restore the backup now
if [ "$no_my_cnf" == "true" ]; then
mv /root/.my.cnf.cdist.bkp /root/.my.cnf
fi
fi
cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/man.rst 000644 001751 001751 00000002735 13552030341 026730 0 ustar 00darko darko 000000 000000 cdist-type__mysql_server(7)
===========================
Manage a MySQL server
Benedikt Koeppel
DESCRIPTION
-----------
This cdist type allows you to install a MySQL database server. The
__mysql_server type also takes care of a few basic security tweaks that are
normally done by running the mysql_secure_installation script that is provided
with MySQL.
REQUIRED PARAMETERS
-------------------
password
The root password to set.
OPTIONAL PARAMETERS
-------------------
no_my_cnf
The /root/.my.cnf file is used to temporary store the root password when doing
the mysql_secure_installation. If you want to have your own .my.cnf file, then
specify --no_my_cnf "true".
Cdist will then place your original /root/.my.cnf back once cdist has run.
EXAMPLES
--------
.. code-block:: sh
# to install a MySQL server
__mysql_server
# to install a MySQL server, remove remote access, remove test databases
# similar to mysql_secure_installation, specify the root password
__mysql_server --password "Uu9jooKe"
# this will also write a /root/.my.cnf file
# if you don't want cdist to write a /root/.my.cnf file permanently, specify
# the --no_my_cnf option
__mysql_server --password "Uu9jooKe" --no_my_cnf
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2012 Benedikt Koeppel. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/manifest 000755 001751 001751 00000002424 13552030341 027152 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Benedikt Koeppel (code@benediktkoeppel.ch)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# install mysql-server
__package mysql-server --state installed
if [ -f "$__object/parameter/no_my_cnf" ]; then
no_my_cnf="$(cat "$__object/parameter/no_my_cnf")"
else
no_my_cnf="false"
fi
if [ -f "$__object/parameter/password" ]; then
rootpassword="$(cat "$__object/parameter/password")"
else
rootpassword=""
fi
if [ "$no_my_cnf" != "true" -a "$rootpassword" != "" ]; then
# store the root password in /root/.my.cnf so that processes can connect
# to the database without requiring a passwort input
__file "/root/.my.cnf" --group root --owner root --mode 600
fi
cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/parameter/ 000755 001751 001751 00000000000 13552030341 027374 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/singleton 000644 001751 001751 00000000000 13552030341 027327 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/parameter/optional 000644 001751 001751 00000000023 13552030341 031137 0 ustar 00darko darko 000000 000000 no_my_cnf
password
cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/parameter/required 000644 001751 001751 00000000000 13552030341 031125 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__mysql_server/files/my.cnf 000644 001751 001751 00000000011 13552030341 027623 0 ustar 00darko darko 000000 000000 [client]
cdist-6.0.2/other/types_submitted_for_inclusion/__init_script/README.inclusion 000644 001751 001751 00000000267 13552030341 030077 0 ustar 00darko darko 000000 000000 Moved out of conf/type/ to think about whether this type makes sense or not.
Cdist describes the state and using an init_script may be useful, but
should only be used conditionally.
cdist-6.0.2/other/types_submitted_for_inclusion/__init_script/gencode-remote 000644 001751 001751 00000002233 13552030341 030030 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2010-2011 Daniel Roth (dani-cdist@d-roth.li)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
if [ -f "$__object/parameter/script" ]; then
script=$(cat "$__object/parameter/script")
else
script="/$__object_id"
fi
if [ -f "$__object/parameter/base_dir" ]; then
base_dir=$(cat "$__object/parameter/base_dir")
else
os="$(cat "$__global/explorer/os")"
case "$os" in
archlinux|netbsd|macosx|freebsd|openbsd) base_dir="/etc/rc.d" ;;
*) base_dir="/etc/init.d"
esac
fi
mode=$(cat "$__object/parameter/mode")
echo "${base_dir}/${script} ${mode}"
cdist-6.0.2/other/types_submitted_for_inclusion/__init_script/man.rst 000644 001751 001751 00000002065 13552030341 026520 0 ustar 00darko darko 000000 000000 cdist-type__init_script(7)
==========================
Use the init scripts
Daniel Roth
DESCRIPTION
-----------
This type can be used to control your init scripts.
REQUIRED PARAMETERS
-------------------
mode
Specifies what shall be done with the init script (usually one of 'start'|'stop'|'restart'|'reload' or 'force-reload')
OPTIONAL PARAMETERS
-------------------
script
If supplied, use this as the init-script.
Otherwise the object_id is used.
base_dir
If supplied, this type uses this directory instead of '/etc/init.d'. The parameter will not need an ending slash.
EXAMPLES
--------
.. code-block:: sh
# Reloads the configuration for lighttpd
__init_script lighttpd --mode force-reload
# Reloads the configuration for lighttpd
__init_script lighty --script lighttpd --mode force-reload
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2011 Daniel Roth. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/types_submitted_for_inclusion/__init_script/parameter/ 000755 001751 001751 00000000000 13552030341 027170 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/types_submitted_for_inclusion/__init_script/parameter/optional 000644 001751 001751 00000000020 13552030341 030730 0 ustar 00darko darko 000000 000000 script
base_dir
cdist-6.0.2/other/types_submitted_for_inclusion/__init_script/parameter/required 000644 001751 001751 00000000005 13552030341 030726 0 ustar 00darko darko 000000 000000 mode
cdist-6.0.2/other/types_submitted_for_inclusion/.readmes/README.inclusion.dependent 000644 001751 001751 00000000331 13552030341 030705 0 ustar 00darko darko 000000 000000 Description:
Type that depends on other types to be included.
Problem:
Does not make much sense on its own.
Solutions:
- Make dependent types includable.
or
- Modify for yourself and use it
cdist-6.0.2/other/types_submitted_for_inclusion/.readmes/README.inclusion.specific 000644 001751 001751 00000001056 13552030341 030531 0 ustar 00darko darko 000000 000000 Description:
Type that will probably only work in a very specific environnment
(like a specific distribution only).
or has custom code that may not satisfy the "usual" or generic use case.
Problem:
If included into core/ directory, many users would be disappointed,
because it does not work for them out of the box.
Solutions:
- Make visible for others (done: by integrating into other/types_submitted_for_inclusion)
- Improve: make usable for at least 80% of the standard cases
or
- Modify for yourself and use it
cdist-6.0.2/other/examples/remote/ 000755 001751 001751 00000000000 13552030341 017317 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/ 000755 001751 001751 00000000000 13552030341 017170 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/README 000644 001751 001751 00000000210 13552030341 020041 0 ustar 00darko darko 000000 000000 This directory contains examples types as being used in real world.
If you'd like to see your type here, just submit it for inclusion.
cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/ 000755 001751 001751 00000000000 13552030341 022613 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_acpi_supend_on_lid_close/ 000755 001751 001751 00000000000 13552030341 025501 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_sudo/ 000755 001751 001751 00000000000 13552030341 021450 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_sudo/README 000644 001751 001751 00000000203 13552030341 022323 0 ustar 00darko darko 000000 000000 Configure sudoers file to be included. Different types may do so,
this one simply uses the "nico" file to store the configuration.
cdist-6.0.2/other/examples/types/__nico_sudo/files/ 000755 001751 001751 00000000000 13552030341 022552 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_sudo/manifest 000755 001751 001751 00000001673 13552030341 023213 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
destination=/etc/sudoers.d/nico
source="$__type/files/sudo-nico"
__package sudo --state installed
__directory /etc/sudoers.d --parents yes
require="__directory/etc/sudoers.d" \
__file "$destination" --source "$source" --mode 0440
cdist-6.0.2/other/examples/types/__nico_sudo/parameter/ 000755 001751 001751 00000000000 13552030341 023430 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_sudo/singleton 000644 001751 001751 00000000000 13552030341 023363 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_sudo/parameter/gencode 000644 001751 001751 00000001642 13552030341 024762 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# USEFUL DESCRIPTION
#
#
# This file should generate code on stdout, which will be collected by cdist
# and run on the target.
#
# To tell cdist to make use of it, you need to make it executable (chmod +x)
#
#
cdist-6.0.2/other/examples/types/__nico_sudo/parameter/manifest 000644 001751 001751 00000001675 13552030341 025172 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# USEFUL DESCRIPTION
#
#
# This is the manifest, which can be used to create other objects like this:
# __file /path/to/destination --source /from/where/
#
# To tell cdist to make use of it, you need to make it executable (chmod +x)
#
#
cdist-6.0.2/other/examples/types/__nico_sudo/parameter/optional 000644 001751 001751 00000000000 13552030341 025166 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_sudo/parameter/required 000644 001751 001751 00000000000 13552030341 025161 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_sudo/files/sudo-nico 000644 001751 001751 00000000353 13552030341 024376 0 ustar 00darko darko 000000 000000 #
# Cdist managed file
#
# Personal one: nico, shared one: lyni
User_Alias NICO = nico, lyni
Defaults timestamp_timeout=5
Defaults !tty_tickets
# Give out permissions
NICO ALL=(ALL) ALL
NICO ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend
cdist-6.0.2/other/examples/types/__nico_acpi_supend_on_lid_close/README 000644 001751 001751 00000000152 13552030341 026357 0 ustar 00darko darko 000000 000000 This type is used on notebooks to ensure they suspend when the lid is closed.
It is tested on Archlinux.
cdist-6.0.2/other/examples/types/__nico_acpi_supend_on_lid_close/files/ 000755 001751 001751 00000000000 13552030341 026603 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_acpi_supend_on_lid_close/manifest 000644 001751 001751 00000002507 13552030341 027236 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
__package acpid --state installed
__package pm-utils --state installed
event_dir=/etc/acpi/events
event_file="$event_dir/lid"
action_dir=/etc/acpi/actions
action_file="$action_dir/lid.sh"
__directory "$event_dir" --owner root --group root \
--mode 0755 --parents yes
__directory "$action_dir" --owner root --group root \
--mode 0755 --parents yes
require="__directory/$event_dir" __file "$event_file" \
--owner root --group root --mode 0644 \
--source "$__type/files/lid_event"
require="__directory/$action_dir" __file "$action_file" \
--owner root --group root --mode 0755 \
--source "$__type/files/lid.sh"
cdist-6.0.2/other/examples/types/__nico_acpi_supend_on_lid_close/singleton 000644 001751 001751 00000000000 13552030341 027414 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__nico_acpi_supend_on_lid_close/files/lid.sh 000755 001751 001751 00000000167 13552030341 027716 0 ustar 00darko darko 000000 000000 #!/bin/sh
# Nico Schottelius, 20111016
# Just suspend, my wife does not like to enter a password
/usr/sbin/pm-suspend
cdist-6.0.2/other/examples/types/__nico_acpi_supend_on_lid_close/files/lid_event 000644 001751 001751 00000000070 13552030341 030474 0 ustar 00darko darko 000000 000000 event=button/lid.*
action=/etc/acpi/actions/lid.sh "%e"
cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/README 000644 001751 001751 00000000140 13552030341 023466 0 ustar 00darko darko 000000 000000 This type is used in production in the ETH and utilises a template to generate
the config file.
cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/files/ 000755 001751 001751 00000000000 13552030341 023715 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/manifest 000755 001751 001751 00000002414 13552030341 024350 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# Configure nss_ldap for a machine at DINFK.
#
ou="$(cat "$__object/parameter/ou")"
ldap_config="/etc/nslcd.conf"
ldap_package="libnss-ldapd"
# Install required packages
__package "$ldap_package" --state installed
# Generate nss-ldap config file from template
mkdir "$__object/files"
. "$__type/files/nslcd.conf.template" > "$__object/files/nslcd.conf"
__file "$ldap_config" --source "$__object/files/nslcd.conf"
# Configure nsswitch to use ldap
require="__package/$ldap_package __file/$ldap_config" \
__file /etc/nsswitch.conf --source "$__type/files/nsswitch.conf"
cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/parameter/ 000755 001751 001751 00000000000 13552030341 024573 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/singleton 000644 001751 001751 00000000000 13552030341 024526 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/parameter/required 000644 001751 001751 00000000003 13552030341 026327 0 ustar 00darko darko 000000 000000 ou
cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/files/nslcd.conf.template 000755 001751 001751 00000001677 13552030341 027517 0 ustar 00darko darko 000000 000000 #!/bin/sh
cat << DONE
#
# D-INFK SANS MANAGED FILE
# ========================
#
# Do not change this file. Changes will be overwritten.
#
# /etc/nslcd.conf
# nslcd configuration file. See nslcd.conf(5)
# for details.
# The user and group nslcd should run as.
uid nslcd
gid nslcd
# The location at which the LDAP server(s) should be reachable.
uri ldaps://ldaps01.ethz.ch
uri ldaps://ldaps02.ethz.ch
uri ldaps://ldaps03.ethz.ch
# The search base
base ou=${ou},ou=inf,ou=auth,o=ethz,c=ch
base passwd ou=users,ou=${ou},ou=inf,ou=auth,o=ethz,c=ch
base group ou=Group,ou=inf,ou=auth,o=ethz,c=ch
base netgroup ou=netgroup,ou=inf,ou=auth,o=ethz,c=ch
binddn cn=REPLACE,ou=ME,ou=WITH,ou=YOUR,o=DETAILS,c=ch
bindpw VERYSECRETPASSWORD
# The LDAP protocol version to use.
#ldap_version 3
# The DN to bind with for normal lookups.
#binddn cn=annonymous,dc=example,dc=net
#bindpw secret
# SSL options
ssl on
tls_reqcert never
# The search scope.
#scope sub
DONE
cdist-6.0.2/other/examples/types/__ethz_dinfk_ldap/files/nsswitch.conf 000644 001751 001751 00000000561 13552030341 026430 0 ustar 00darko darko 000000 000000 #
# D-INFK SANS MANAGED FILE
# ========================
#
# Do not change this file. Changes will be overwritten.
#
# /etc/nsswitch.conf
#
passwd: files ldap
group: files ldap
shadow: files ldap
hosts: files dns
networks: files
services: db files
protocols: db files
rpc: db files
ethers: db files
netgroup: files ldap
cdist-6.0.2/other/examples/remote/README 000644 001751 001751 00000000257 13552030341 020203 0 ustar 00darko darko 000000 000000 Some examples of using alternative __remote_copy and __remote_exec prefixes.
This allows you to change how cdist interacts with the target host (or directory, or whatever :-)
cdist-6.0.2/other/examples/remote/chroot/ 000755 001751 001751 00000000000 13552030341 020615 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/remote/local/ 000755 001751 001751 00000000000 13552030341 020411 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/remote/rsync/ 000755 001751 001751 00000000000 13552030341 020455 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/remote/schroot-uri 000755 001751 001751 00000007313 13552030341 021527 0 ustar 00darko darko 000000 000000 #!/bin/sh -e
#
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# __remote_{exec,copy} script to run cdist against a schroot target uri
#
# Usage:
# cdist config \
# --remote-exec "/path/to/this/script exec" \
# --remote-copy "/path/to/this/script copy" \
# target_uri
#
# # target_uri examples:
# schroot:///chroot-name
# schroot://foo.ethz.ch/chroot-name
# schroot://user-name@foo.ethz.ch/chroot-name
#
# # and how to match them in .../manifest/init
# case "$target_host" in
# schroot://*)
# # any schroot
# ;;
# schroot://foo.ethz.ch/*)
# # any schroot on specific host
# ;;
# schroot://foo.ethz.ch/chroot-name)
# # specific schroot on specific host
# ;;
# schroot:///chroot-name)
# # specific schroot on localhost
# ;;
# esac
my_name="${0##*/}"
mode="$1"; shift
log() {
# uncomment me for debugging
#echo "$@" | logger -t "cdist-$my_name-$mode"
:
}
die() {
echo "$@" >&2
exit 1
}
uri="$__target_host"
scheme="${uri%%:*}"; rest="${uri#$scheme:}"; rest="${rest#//}"
authority="${rest%%/*}"; rest="${rest#$authority}"
path="${rest%\?*}"; rest="${rest#$path}"
schroot_name="${path#/}"
[ "$scheme" = "schroot" ] || die "Failed to parse scheme from __target_host ($__target_host). Expected 'schroot', got '$scheme'"
[ -n "$schroot_name" ] || die "Failed to parse schroot name from __target_host: $__target_host"
case "$authority" in
'')
# authority is empty, neither user nor host given
user=""
host=""
;;
*@*)
# authority contains @, take user from authority
user="${authority%@*}"
host="${authority#*@}"
;;
*)
# no user in authority, default to root
user="root"
host="$authority"
;;
esac
log "mode: $mode"
log "@: $@"
log "uri: $uri"
log "scheme: $scheme"
log "authority: $authority"
log "user: $user"
log "host: $host"
log "path: $path"
log "schroot_name: $schroot_name"
exec_prefix=""
copy_prefix=""
if [ -n "$host" ]; then
# we are working on a remote host
exec_prefix="ssh -o User=$user -q $host"
copy_prefix="scp -o User=$user -q"
copy_destination_prefix="$host:"
else
# working on local machine
copy_prefix="cp"
copy_destination_prefix=""
fi
log "exec_prefix: $exec_prefix"
log "copy_prefix: $copy_prefix"
log "copy_destination_prefix: $copy_destination_prefix"
case "$mode" in
exec)
# In exec mode the first argument is the __target_host which we already got from env. Get rid of it.
shift
code="$exec_prefix schroot -c $schroot_name -- sh -c '$@'"
;;
copy)
# get directory for given chroot_name
schroot_directory="$($exec_prefix schroot -c $schroot_name --config | awk -F = '/directory=/ {print $2}')"
[ -n "$schroot_directory" ] || die "Failed to retreive schroot directory for schroot: $schroot_name"
log "schroot_directory: $schroot_directory"
# prefix destination with chroot
code="$copy_prefix $(echo "$@" | sed "s|$uri:|${copy_destination_prefix}${schroot_directory}|g")"
;;
*) die "Unknown mode: $mode";;
esac
log "code: $code"
# Run the code
$code
log "-----"
cdist-6.0.2/other/examples/remote/schroot/ 000755 001751 001751 00000000000 13552030341 021000 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/remote/ssh/ 000755 001751 001751 00000000000 13552030341 020114 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/remote/sudo/ 000755 001751 001751 00000000000 13552030341 020271 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/examples/remote/sudo/copy 000755 001751 001751 00000003047 13552030341 021175 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Matt Coddington (mcoddington at gmail.com)
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
# 2013 Chase Allen James (nx-cdist at nu-ex.com)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# Use rsync over ssh to copy files. Uses the "--rsync-path" option
# to run the remote rsync instance with sudo.
#
# This command assumes your ssh configuration is already set up
# in ~/.ssh/config.
#
# Usage:
# cdist config --remote-copy /path/to/this/script target_host
#
# For rsync to do the right thing, the source has to end with "/" if it is
# a directory. The below preprocessor loop takes care of that.
# second last argument is the source
source_index=$(($#-1))
index=0
for arg in $@; do
if [ $index -eq 0 ]; then
# reset $@
set --
fi
index=$((index+=1))
if [ $index -eq $source_index -a -d "$arg" ]; then
arg="${arg%/}/"
fi
set -- "$@" "$arg"
done
rsync --copy-links --rsync-path="sudo rsync" -e 'ssh' "$@"
cdist-6.0.2/other/examples/remote/sudo/exec 000755 001751 001751 00000001710 13552030341 021142 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2013 Chase Allen James (nx-cdist at nu-ex.com)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
# Prefixes all remote commands with sudo.
#
# This command assumes your ssh configuration is already set up
# in ~/.ssh/config.
#
# Usage:
# cdist config --remote-exec "/path/to/this/script" target_host
#
host="$1"; shift
ssh -q "$host" sudo sh -c \""$@"\"
cdist-6.0.2/other/examples/remote/ssh/copy 000755 001751 001751 00000001563 13552030341 021021 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# same as cdist default
#
# Usage:
# cdist config --remote-copy "/path/to/this/script" target_host
#
#echo "$@" | logger -t "cdist-ssh-copy"
scp -o User=root -q $@
cdist-6.0.2/other/examples/remote/ssh/exec 000755 001751 001751 00000001563 13552030341 020773 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# same as cdist default
#
# Usage:
# cdist config --remote-exec "/path/to/this/script" target_host
#
#echo "$@" | logger -t "cdist-ssh-exec"
ssh -o User=root -q $@
cdist-6.0.2/other/examples/remote/schroot/copy 000755 001751 001751 00000002662 13552030341 021706 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# __remote_copy script to run cdist against a chroot on the target host over ssh.
#
# Usage:
# cdist config --remote-copy "/path/to/this/script schroot-chroot-name" target_host
#
log() {
#echo "$@" | logger -t "cdist-schroot-copy"
:
}
chroot_name="$1"; shift
target_host="$__target_host"
# get directory for given chroot_name
chroot="$(ssh -o User=root -q $target_host schroot -c $chroot_name --config | awk -F = '/directory=/ {print $2}')"
# prefix destination with chroot
code="$(echo "$@" | sed "s|$target_host:|$target_host:$chroot|g")"
log "target_host: $target_host"
log "chroot_name: $chroot_name"
log "chroot: $chroot"
log "@: $@"
log "code: $code"
# copy files into remote chroot
scp -o User=root -q $code
log "-----"
cdist-6.0.2/other/examples/remote/schroot/exec 000755 001751 001751 00000002302 13552030341 021647 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# __remote_exec script to run cdist against a chroot on the target host over ssh.
#
# Usage:
# cdist config --remote-exec "/path/to/this/script schroot-chroot-name" target_host
#
log() {
#echo "$@" | logger -t "cdist-schroot-exec"
:
}
chroot_name="$1"; shift
target_host="$1"; shift
code="ssh -o User=root -q $target_host schroot -c $chroot_name -- $@"
log "target_host: $target_host"
log "chroot_name: $chroot_name"
log "@: $@"
log "code: $code"
# run in remote chroot
$code
log "-----"
cdist-6.0.2/other/examples/remote/rsync/copy 000755 001751 001751 00000003025 13552030341 021355 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Matt Coddington (mcoddington at gmail.com)
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# Use rsync over ssh to copy files. This particular invocation of
# rsync makes a backup of the file before overwriting it. For example,
# if cdist overwrites /etc/passwd then you'll end up with the old copy
# at /etc/passwd~cdist.
#
# Usage:
# cdist config --remote-copy /path/to/this/script target_host
#
# For rsync to do the right thing, the source has to end with "/" if it is
# a directory. The below preprocessor loop takes care of that.
# second last argument is the source
source_index=$(($#-1))
index=0
for arg in $@; do
if [ $index -eq 0 ]; then
# reset $@
set --
fi
index=$((index+=1))
if [ $index -eq $source_index -a -d "$arg" ]; then
arg="${arg%/}/"
fi
set -- "$@" "$arg"
done
rsync --backup --suffix=~cdist -e 'ssh -o User=root' $@
cdist-6.0.2/other/examples/remote/local/README 000644 001751 001751 00000000145 13552030341 021271 0 ustar 00darko darko 000000 000000 This effectively turns remote calling into local calling.
Probably most useful for the unittesting.
cdist-6.0.2/other/examples/remote/local/copy 000755 001751 001751 00000001531 13552030341 021311 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Nico Schottelius (nico-cdist schottelius.org)
# 2013 Steven Armstrong (steven-cdist armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
code="$(echo "$@" | sed "s|\([[:space:]]\)$__target_host:|\1|g")"
cp --dereference $code
cdist-6.0.2/other/examples/remote/local/exec 000755 001751 001751 00000001367 13552030341 021272 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Nico Schottelius (nico-cdist schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
target_host=$1; shift
echo "$@" | /bin/sh
cdist-6.0.2/other/examples/remote/chroot/copy 000755 001751 001751 00000002345 13552030341 021521 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# __remote_copy script to run cdist against a local chroot instead of via ssh
# to a remote target host.
#
# Usage:
# cdist config --remote-copy "/path/to/this/script /path/to/your/chroot" target-id
#
log() {
#echo "$@" | logger -t "cdist-chroot-copy"
:
}
chroot="$1"; shift
target_host="$__target_host"
# replace target_host with chroot location
code="$(echo "$@" | sed "s|$target_host:|$chroot|g")"
log "target_host: $target_host"
log "chroot: $chroot"
log "$@"
log "$code"
# copy files into chroot
cp $code
log "-----"
cdist-6.0.2/other/examples/remote/chroot/exec 000755 001751 001751 00000002652 13552030341 021474 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# __remote_exec script to run cdist against a local chroot instead of via ssh
# on a remote target host.
#
# Usage:
# cdist config --remote-exec "/path/to/this/script /path/to/your/chroot" target-id
#
log() {
#echo "$@" | logger -t "cdist-chroot-exec"
:
}
chroot="$1"; shift
target_host="$1"; shift
script=$(mktemp "${chroot}/tmp/chroot-${0##*/}.XXXXXXXXXX")
trap cleanup INT TERM EXIT
cleanup() {
[ $__cdist_debug ] || rm "$script"
}
log "target_host: $target_host"
log "script: $script"
log "@: $@"
echo "#!/bin/sh -l" > "$script"
echo "$@" >> "$script"
chmod +x "$script"
relative_script="${script#$chroot}"
log "relative_script: $relative_script"
# run in chroot
chroot "$chroot" "$relative_script"
log "-----"
cdist-6.0.2/other/archived_types/.README.unmaintained 000644 001751 001751 00000000112 13552030341 022622 0 ustar 00darko darko 000000 000000 This type is not maintained anymore and has thus been removed from cdist.
cdist-6.0.2/other/archived_types/README 000644 001751 001751 00000000254 13552030341 020100 0 ustar 00darko darko 000000 000000 This directory contains types that used to be included with
cdist, but are not in use anymore. Have a look at the README
file in each type, to find out why it was removed.
cdist-6.0.2/other/archived_types/__autofs/ 000755 001751 001751 00000000000 13552030341 021016 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_map/ 000755 001751 001751 00000000000 13552030341 021653 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_reload/ 000755 001751 001751 00000000000 13552030341 022344 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_reload/README 000755 001751 001751 00000000000 13552030341 027041 2../.README.unmaintained ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_reload/gencode-remote 000755 001751 001751 00000002065 13552030341 025172 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
os=$(cat "$__global/explorer/os")
not_supported() {
echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
echo "Please contribute an implementation for it if you can." >&2
exit 1
}
case "$os" in
ubuntu|debian|archlinux|devuan)
echo "pkill -HUP automount"
;;
*)
not_supported
;;
esac
cdist-6.0.2/other/archived_types/__autofs_reload/man.rst 000644 001751 001751 00000001112 13552030341 023644 0 ustar 00darko darko 000000 000000 cdist-type__autofs_reload(7)
============================
Tell automounter to reload config file
Steven Armstrong
DESCRIPTION
-----------
This space intentionally left blank.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
EXAMPLES
--------
.. code-block:: sh
__autofs_reload
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/archived_types/__autofs_reload/singleton 000644 001751 001751 00000000000 13552030341 024257 0 ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_map/README 000755 001751 001751 00000000000 13552030341 026350 2../.README.unmaintained ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_map/explorer/ 000755 001751 001751 00000000000 13552030341 023513 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_map/gencode-remote 000755 001751 001751 00000004274 13552030341 024505 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 - 2012 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
entry="$__object/files/entry"
state_should="$(cat "$__object/parameter/state" 2>/dev/null || echo present)"
if [ ! -s "$__object/explorer/entry" ]; then
state_is='absent'
else
state_is=$(diff -q "$entry" "$__object/explorer/entry" >/dev/null \
&& echo present \
|| echo changed
)
fi
if [ "$state_should" = "$state_is" ]; then
# Nothing to do, move along
exit 0
fi
cat << DONE
candidates="/etc/auto.master /etc/autofs/auto.master"
find_auto_master() {
# get the path of the auto.master file
for candidate in \$candidates; do
if [ -f "\$candidate" ]; then
echo "\$candidate"
return
fi
done
}
auto_master="\$(find_auto_master)"
if [ ! -f "\$auto_master" ]; then
echo "Could not determine auto.master location, tried: \$candidates" >&2
exit 1
fi
DONE
remove_entry() {
# NOTE: keep variables in sync in manifest/explorer/gencode-*
prefix="#cdist:$__object_name"
suffix="#/cdist:$__object_name"
cat << DONE
awk -v prefix="$prefix" -v suffix="$suffix" '
{
if (index(\$0,prefix)) {
triggered=1
}
if (triggered) {
if (index(\$0,suffix)) {
triggered=0
}
} else {
print
}
}' "\$auto_master" > "\$auto_master"+
mv -f "\$auto_master"+ "\$auto_master"
DONE
}
case "$state_should" in
present)
if [ "$state_is" = "changed" ]; then
remove_entry
fi
cat << DONE
cat >> "\$auto_master" << EOC
$(cat "$entry")
EOC
DONE
;;
absent)
remove_entry
;;
esac
cdist-6.0.2/other/archived_types/__autofs_map/man.rst 000644 001751 001751 00000002573 13552030341 023167 0 ustar 00darko darko 000000 000000 cdist-type__autofs_map(7)
=========================
Manage autofs maps
Steven Armstrong
DESCRIPTION
-----------
This cdist type allows you to define maps for autofs.
OBJECT ID
---------
The object_id is used as the mount-point as described in auto.master(5).
REQUIRED PARAMETERS
-------------------
map
Name of the map to use. See auto.master(5).
OPTIONAL PARAMETERS
-------------------
type
Type of map used for this mount point. Defaults to 'file'.
See map-type in auto.master(5) for possible values.
options
See auto.master(5).
comment
A comment describing this map. Is added to the generated entry in
auto.master.
BOOLEAN PARAMETERS
------------------
noreload
don't reload autofs after the entry has been changed
EXAMPLES
--------
.. code-block:: sh
# Add auto mounter at /net and reload
__autofs_map /net --map /etc/auto.net --type program
# Add auto mounter at /pub and don't reload
__autofs_map /pub \
--map /etc/auto.pub \
--type file \
--options "nosuid,rw,bg,hard,intr --ghost" \
--noreload
SEE ALSO
--------
- `cdist-type(7) `_
- `cdist-type__autofs_reload(7) `_
COPYING
-------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/archived_types/__autofs_map/manifest 000755 001751 001751 00000003504 13552030341 023411 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 - 2012 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
name="/$__object_id"
map="$(cat "$__object/parameter/map")"
type="$(cat "$__object/parameter/type" 2>/dev/null || echo "file")"
options="$(cat "$__object/parameter/options" 2>/dev/null || true)"
# NOTE: keep variables in sync in manifest/explorer/gencode-*
prefix="#cdist:$__object_name"
suffix="#/cdist:$__object_name"
mkdir "$__object/files"
# Generate entry for inclusion in auto.master
entry="$__object/files/entry"
echo "$prefix" > "$entry"
if [ -f "$__object/parameter/comment" ]; then
echo "# $(cat "$__object/parameter/comment")" >> "$entry"
fi
echo "$name $type:$map $options" >> $entry
echo "$suffix" >> "$entry"
# Reload autofs after changes if the user wishes this
if [ ! -f "$__object/parameter/noreload" ]; then
state_should="$(cat "$__object/parameter/state" 2>/dev/null || echo present)"
if [ ! -s "$__object/explorer/entry" ]; then
state_is='absent'
else
state_is=$(diff -q "$entry" "$__object/explorer/entry" >/dev/null \
&& echo present \
|| echo changed
)
fi
if [ "$state_is" != "$state_should" ]; then
require="$__object_name" __autofs_reload
fi
fi
cdist-6.0.2/other/archived_types/__autofs_map/parameter/ 000755 001751 001751 00000000000 13552030341 023633 5 ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs_map/parameter/boolean 000644 001751 001751 00000000011 13552030341 025165 0 ustar 00darko darko 000000 000000 noreload
cdist-6.0.2/other/archived_types/__autofs_map/parameter/optional 000644 001751 001751 00000000025 13552030341 025400 0 ustar 00darko darko 000000 000000 type
options
comment
cdist-6.0.2/other/archived_types/__autofs_map/parameter/required 000644 001751 001751 00000000004 13552030341 025370 0 ustar 00darko darko 000000 000000 map
cdist-6.0.2/other/archived_types/__autofs_map/explorer/entry 000755 001751 001751 00000002613 13552030341 024604 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2011 - 2012 Steven Armstrong (steven-cdist at armstrong.cc)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
candidates="/etc/auto.master /etc/autofs/auto.master"
find_auto_master() {
# get the path of the auto.master file
for candidate in $candidates; do
if [ -f "$candidate" ]; then
echo "$candidate"
return
fi
done
}
auto_master="$(find_auto_master)"
# no auto.master, nothing we could do
[ -f "$auto_master" ] || exit 0
# NOTE: keep variables in sync in manifest/explorer/gencode-*
prefix="#cdist:$__object_name"
suffix="#/cdist:$__object_name"
awk -v prefix="$prefix" -v suffix="$suffix" '{
if (index($0,prefix)) {
triggered=1
}
if (triggered) {
if (index($0,suffix)) {
triggered=0
}
print
}
}' "$auto_master"
cdist-6.0.2/other/archived_types/__autofs/README 000755 001751 001751 00000000000 13552030341 025513 2../.README.unmaintained ustar 00darko darko 000000 000000 cdist-6.0.2/other/archived_types/__autofs/man.rst 000644 001751 001751 00000001047 13552030341 022325 0 ustar 00darko darko 000000 000000 cdist-type__autofs(7)
=====================
Install and start autofs
Steven Armstrong
DESCRIPTION
-----------
This space intentionally left blank.
REQUIRED PARAMETERS
-------------------
None.
OPTIONAL PARAMETERS
-------------------
None.
EXAMPLES
--------
.. code-block:: sh
__autofs
SEE ALSO
--------
- `cdist-type(7) `_
COPYING
-------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3).
cdist-6.0.2/other/archived_types/__autofs/manifest 000755 001751 001751 00000002002 13552030341 022544 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
# 2012 Nico Schottelius (nico-cdist at schottelius.org)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
os=$(cat "$__global/explorer/os")
case "$os" in
ubuntu|debian|archlinux|devuan)
__package autofs --state present
__start_on_boot autofs --state present
;;
*)
echo "Unsupported OS: $os" >&2
exit 1
;;
esac
cdist-6.0.2/other/archived_types/__autofs/singleton 000644 001751 001751 00000000000 13552030341 022731 0 ustar 00darko darko 000000 000000 cdist-6.0.2/hacking/README 000644 001751 001751 00000001317 13552030341 015353 0 ustar 00darko darko 000000 000000 - next step
- rootfs fix
- get working to login
- have sshd enabled
- kernel -> initramfs?
http://jootamam.net/howto-initramfs-image.htm
- busybox!!
- everything into initramfs?
- permission problem on various files below /etc
- Target:
- get working iso
- have it configured and gathered by cdist?
- boot process via ...?
- systemd?
- packaging via ...
- packages?
- binlist
- bootstrap of os
-> root permissions!
- boot device
- uefi support
[9:15] wurzel:hacking% pacman -Ql syslinux | grep ldlin
syslinux /usr/lib/syslinux/bios/ldlinux.c32
syslinux /usr/lib/syslinux/efi32/ldlinux.e32
syslinux /usr/lib/syslinux/efi64/ldlinux.e64
cdist-6.0.2/hacking/preos-sh/ 000755 001751 001751 00000000000 13552030341 016231 5 ustar 00darko darko 000000 000000 cdist-6.0.2/hacking/v1-debootstrap-pacstrap/ 000755 001751 001751 00000000000 13552030341 021156 5 ustar 00darko darko 000000 000000 cdist-6.0.2/hacking/v2-initramfs-from-os/ 000755 001751 001751 00000000000 13552030341 020372 5 ustar 00darko darko 000000 000000 cdist-6.0.2/hacking/v3-busybox/ 000755 001751 001751 00000000000 13552030341 016512 5 ustar 00darko darko 000000 000000 cdist-6.0.2/hacking/v3-busybox/add_kernel_isolinux.sh 000755 001751 001751 00000000644 13552030341 023077 0 ustar 00darko darko 000000 000000 #!/bin/sh
# FIXME: distro specific kernel location
if [ "$#" -ne 1 ]; then
echo "$0 dir-out"
exit 1
fi
dir=$1; shift
boot=$dir/boot
mkdir -p "$boot"
cp /boot/vmlinuz-linux "$boot/linux"
cp /usr/lib/syslinux/bios/isolinux.bin "$boot"
cp /usr/lib/syslinux/bios/ldlinux.c32 "$dir"
cat > "$dir/isolinux.cfg" << eof
default preos
label preos
title cdist PreOS
linux /boot/linux
initrd /boot/initramfs
eof
cdist-6.0.2/hacking/v3-busybox/all.sh 000755 001751 001751 00000000267 13552030341 017626 0 ustar 00darko darko 000000 000000 #!/bin/sh
rm -rf preos
mkdir -p preos/boot
./create_initramfs.sh > preos/boot/initramfs
./add_kernel_isolinux.sh preos
./copy_bin_with_libs.sh preos
./create_iso.sh preos preos.iso
cdist-6.0.2/hacking/v3-busybox/copy_bin_with_libs.sh 000755 001751 001751 00000002020 13552030341 022711 0 ustar 00darko darko 000000 000000 #!/bin/sh
# Nico Schottelius
# Fri May 1 17:31:50 CEST 2015
PATH=/bin:/sbin:/usr/bin:/usr/sbin
if [ "$#" -ne 1 ]; then
echo "$0 dir-out"
exit 1
fi
out_dir=$1
#bin_list="udevadm bash fdisk mount syslinux umount rm mv"
bin_list="udevadm fdisk"
libs=$(mktemp /tmp/cdist-preos-libs.XXXXXXXXXXXXX)
mkdir -p "$out_dir/bin" "$out_dir/lib"
(
for bin in $bin_list; do
src=$(which "$bin")
cp "$src" "$out_dir/bin"
ldd "$src" | sed -e 's/=>//' -e 's/(.*//' | awk '{ if(NF == 2) { print $2 } else { print $1 } }'
done
) | sort | uniq > "$libs"
while read lib; do
if echo $lib | grep '^/'; then
# echo "Copying fqdn lib $lib ..."
cp "$lib" "$out_dir/lib"
else
echo "How to copy $lib ?"
fi
done < "$libs"
rm -f "$libs"
exit 0
bin=$1
# Not used alternatives
# new_list=$(objdump -p /usr/bin/ls | awk '$1 ~ /NEEDED/ { print $2 }')
# ldconfig -p | grep 'libBrokenLocale.so.1$' | sed 's/.* => //'
for new_item in $new_list; do
done
ldconfig -p |
cdist-6.0.2/hacking/v3-busybox/create_initramfs.sh 000755 001751 001751 00000001033 13552030341 022365 0 ustar 00darko darko 000000 000000 #!/bin/sh
set -ex
initramfs_dir=$(mktemp -d /tmp/cdist-preos.XXXXXXX)
# initramfs_dir=$1
for dir in bin sbin etc proc sys newroot usr/bin usr/sbin; do
mkdir -p ${initramfs_dir}/$dir
done
touch ${initramfs_dir}/etc/mdev.conf
cp init "${initramfs_dir}/init"
cp $(which busybox) "${initramfs_dir}/bin"
for link in sh mount; do
ln -fs busybox "${initramfs_dir}/bin/$link"
done
cd "${initramfs_dir}"
find . | cpio -H newc -o | gzip
rm -rf "${initramfs_dir}"
exit 0
# TODO:
# - Kernel modules
# - ssh
# - various mkfs
# - libs
cdist-6.0.2/hacking/v3-busybox/create_iso.sh 000755 001751 001751 00000000575 13552030341 021175 0 ustar 00darko darko 000000 000000 #!/bin/sh
# FIXME: include os explorer to name preos
if [ "$#" -ne 2 ]; then
echo "$0 dir-in iso-out"
exit 1
fi
indir=$1; shift
iso=$1; shift
version=0.4
out=preos-${version}.iso
# -cache-inodes \
genisoimage -r -J -l \
-V "cdist PreOS $version" \
-b boot/isolinux.bin -no-emul-boot -c boot.cat -boot-load-size 4 -boot-info-table \
-o "$iso" "$indir"
cdist-6.0.2/hacking/v3-busybox/init 000755 001751 001751 00000002333 13552030341 017404 0 ustar 00darko darko 000000 000000 #!/bin/sh
#Create all the symlinks to /bin/busybox
/bin/busybox --install -s
#Mount things needed by this script
mount -t proc proc /proc
mount -t sysfs sysfs /sys
#Disable kernel messages from popping onto the screen
echo 0 > /proc/sys/kernel/printk
#Create device nodes
mknod /dev/null c 1 3
mknod /dev/tty c 5 0
mdev -s
#Function for parsing command line options with "=" in them
# get_opt("init=/sbin/init") will return "/sbin/init"
get_opt() {
echo "$@" | cut -d "=" -f 2
}
#Defaults
init="/sbin/init"
root="/dev/hda1"
#Process command line options
for i in $(cat /proc/cmdline); do
case $i in
root\=*)
root=$(get_opt $i)
;;
init\=*)
init=$(get_opt $i)
;;
esac
done
exec sh
# Skipping the rest
#Mount the root device
mount "${root}" /newroot
#Check if $init exists and is executable
if [[ -x "/newroot/${init}" ]] ; then
#Unmount all other mounts so that the ram used by
#the initramfs can be cleared after switch_root
umount /sys /proc
#Switch to the new root and execute init
exec switch_root /newroot "${init}"
fi
#This will only be run if the exec above failed
echo "Failed to switch_root, dropping to a shell"
exec sh
cdist-6.0.2/hacking/v3-busybox/qemu-test.sh 000755 001751 001751 00000000240 13552030341 020771 0 ustar 00darko darko 000000 000000 #!/bin/sh
if [ "$#" -ne 1 ]; then
echo "$0 iso"
exit 1
fi
iso=$1; shift
qemu-system-x86_64 -m 512 -boot order=cd \
-drive file=$iso,media=cdrom
cdist-6.0.2/hacking/v2-initramfs-from-os/add_kernel_isolinux.sh 000755 001751 001751 00000001075 13552030341 024756 0 ustar 00darko darko 000000 000000 #!/bin/sh
# FIXME: Write cdist type / explorer that finds
# package for a file, distro independent
if [ "$#" -ne 1 ]; then
echo "$0 dir-out"
exit 1
fi
dir=$1; shift
boot=$dir/boot
mkdir -p "$boot"
cp /boot/vmlinuz-linux \
/boot/initramfs-linux-fallback.img \
/usr/lib/syslinux/bios/isolinux.bin \
"$boot"
cp /usr/lib/syslinux/bios/ldlinux.c32 \
"$dir"
cat > "$dir/isolinux.cfg" << eof
default preos
label preos
title cdist PreOS
linux /boot/vmlinuz-linux
initrd /boot/initramfs-linux-fallback.img
eof
cdist-6.0.2/hacking/v2-initramfs-from-os/all.sh 000755 001751 001751 00000000306 13552030341 021500 0 ustar 00darko darko 000000 000000 #!/bin/sh
set -e
dir=./iso
iso=preos.iso
./filelist_from_package.sh | ./filelist_to_dir.sh "$dir"
echo "MISSING: copy libraries" >&2
./add_kernel_isolinux.sh "$dir"
./create_iso.sh "$dir" "$iso"
cdist-6.0.2/hacking/v2-initramfs-from-os/bin_to_pkg.sh 000755 001751 001751 00000000075 13552030341 023046 0 ustar 00darko darko 000000 000000 #!/bin/sh
abspath=$(command -v "$1")
pacman -Qoq "$abspath"
cdist-6.0.2/hacking/v2-initramfs-from-os/copy_files_for_iso.sh 000755 001751 001751 00000000665 13552030341 024614 0 ustar 00darko darko 000000 000000 #!/bin/sh
set -ex
testdir=./iso-root-dir
# Create base
rm -rf "$testdir"
mkdir "$testdir"
# Copy binaries
# Copy kernel
mkdir -p "$testdir/boot"
cp /boot/vmlinuz-linux "$testdir/boot/kernel"
cp /boot/initramfs-linux-fallback.img "$testdir/boot/initramfs"
# Create iso
genisoimage -v -V "cdist preos v0.1" \
-cache-inodes -J -l \
-r -no-emul-boot \
-boot-load-size 4 -b isolinux.bin -c boot.cat -o cdist-preos.iso iso
cdist-6.0.2/hacking/v2-initramfs-from-os/file_list_of_packages.sh 000644 001751 001751 00000000034 13552030341 025217 0 ustar 00darko darko 000000 000000 #!/bin/sh
pacman -Qlq "$@"
cdist-6.0.2/hacking/v2-initramfs-from-os/filelist_from_package.sh 000755 001751 001751 00000001450 13552030341 025242 0 ustar 00darko darko 000000 000000 #!/bin/sh
# Generate filelist excluding stuff that takes only space
(
for pkg in systemd openssh \
bash bzip2 coreutils cryptsetup device-mapper dhcpcd \
diffutils e2fsprogs file filesystem findutils gawk \
gettext glibc grep gzip inetutils iproute2 \
iputils jfsutils less licenses linux logrotate lvm2 \
man-db man-pages mdadm nano pacman pciutils \
pcmciautils procps-ng psmisc reiserfsprogs \
s-nail sed shadow sysfsutils systemd-sysvcompat tar \
usbutils util-linux vi which xfsprogs \
; do
pacman -Qlq $pkg | grep -v \
-e /usr/share/man/ \
-e /usr/share/doc/ \
-e /usr/include
done
) | sort | uniq
cdist-6.0.2/hacking/v2-initramfs-from-os/filelist_to_dir.sh 000755 001751 001751 00000000412 13552030341 024101 0 ustar 00darko darko 000000 000000 #!/bin/sh
if [ "$#" -ne 1 ]; then
echo "$0 outdir"
exit 1
fi
outdir=$1; shift
mkdir -p "$outdir"
while read file; do
if [ -d "$file" ]; then
mkdir -p "$outdir$file"
else
cp --preserve=mode,links "$file" "$outdir$file"
fi
done
cdist-6.0.2/hacking/v2-initramfs-from-os/packages_arch 000644 001751 001751 00000003472 13552030341 023076 0 ustar 00darko darko 000000 000000 base syslinux
[10:06] wurzel:hacking% sudo !!
sudo pacman -S base
[sudo] password for nico:
:: linux is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] y
:: There are 50 members in group base:
:: Repository core
1) bash 2) bzip2 3) coreutils 4) cryptsetup 5) device-mapper 6) dhcpcd 7) diffutils 8) e2fsprogs 9) file
10) filesystem 11) findutils 12) gawk 13) gcc-libs 14) gettext 15) glibc 16) grep 17) gzip 18) inetutils
19) iproute2 20) iputils 21) jfsutils 22) less 23) licenses 24) linux 25) logrotate 26) lvm2 27) man-db
28) man-pages 29) mdadm 30) nano 31) netctl 32) pacman 33) pciutils 34) pcmciautils 35) perl 36) procps-ng
37) psmisc 38) reiserfsprogs 39) s-nail 40) sed 41) shadow 42) sysfsutils 43) systemd-sysvcompat 44) tar
45) texinfo 46) usbutils 47) util-linux 48) vi 49) which 50) xfsprogs
Enter a selection (default=all):
:18,23s/ [0-9]*)//g
bash bzip2 coreutils cryptsetup device-mapper dhcpcd diffutils e2fsprogs file
filesystem findutils gawk gcc-libs gettext glibc grep gzip inetutils
iproute2 iputils jfsutils less licenses linux logrotate lvm2 man-db
man-pages mdadm nano netctl pacman pciutils pcmciautils perl procps-ng
psmisc reiserfsprogs s-nail sed shadow sysfsutils systemd-sysvcompat tar
texinfo usbutils util-linux vi which xfsprogs
6J
bash bzip2 coreutils cryptsetup device-mapper dhcpcd diffutils e2fsprogs file filesystem findutils gawk gcc-libs gettext glibc grep gzip inetutils iproute2 iputils jfsutils less licenses linux logrotate lvm2 man-db man-pages mdadm nano netctl pacman pciutils pcmciautils perl procps-ng psmisc reiserfsprogs s-nail sed shadow sysfsutils systemd-sysvcompat tar texinfo usbutils util-linux vi which xfsprogs
cdist-6.0.2/hacking/v1-debootstrap-pacstrap/arch_bootstrap.sh 000644 001751 001751 00000000162 13552030341 024523 0 ustar 00darko darko 000000 000000 #!/bin/sh
fakeroot pacman -r $(pwd -P)/preos -Syu --noconfirm --cachedir $(pwd -P)/preos/var/cache/pacman base
cdist-6.0.2/hacking/v1-debootstrap-pacstrap/debian_bootstrap.sh 000644 001751 001751 00000000075 13552030341 025033 0 ustar 00darko darko 000000 000000 #!/bin/sh
fakeroot debootstrap jessie ./preos-debootstrap/
cdist-6.0.2/hacking/preos-sh/init 000644 001751 001751 00000001334 13552030341 017120 0 ustar 00darko darko 000000 000000 #!/bin/sh
for pkg in \
file \
linux-image-amd64 \
lsb-release \
openssh-server curl \
pxelinux syslinux-common grub2 \
gdisk util-linux lvm2 mdadm \
btrfs-tools e2fsprogs jfsutils reiser4progs xfsprogs; do
__package $pkg --state present
done
# initramfs requires /init
__link /init --source /sbin/init --type symbolic
__file /etc/network/interfaces --source - --mode 0644 << eof
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
eof
# Steven found this out - coyping it 1:1
# fix the bloody 'stdin: is not a tty' problem
__line /root/.profile --line 'mesg n' --state absent
__hostname --name preos
cdist-6.0.2/hacking/preos-sh/preos.sh 000644 001751 001751 00000001525 13552030341 017720 0 ustar 00darko darko 000000 000000 #!/bin/sh
TARGET_DIR="$1"
PXE_BOOT_DIR="$2"
debootstrap --include=openssh-server --arch=amd64 stable $TARGET_DIR
chroot $TARGET_DIR /usr/bin/apt-get update
# Configure the OS
cdist config -i init --remote-exec remote-exec.sh --remote-copy remote-exec.sh $TARGET_DIR
# Cleanup chroot
chroot $TARGET_DIR /usr/bin/apt-get autoclean
chroot $TARGET_DIR /usr/bin/apt-get clean
chroot $TARGET_DIR /usr/bin/apt-get autoremove
# Output pxe files
cp $TARGET_DIR/boot/vmlinuz-* $PXE_BOOT_DIR/kernel
cd $TARGET_DIR
find . -print0 | cpio --null -o --format=newc | gzip -9 > $PXE_BOOT_DIR/initramfs
cat << EOF > $PXE_BOOT_DIR/pxelinux.cfg/default
DEFAULT preos
LABEL preos
KERNEL kernel
INITRD initramfs
EOF
cp $TARGET_DIR/usr/lib/PXELINUX/pxelinux.0 $PXE_BOOT_DIR/pxelinux.0
cp $TARGET_DIR/usr/lib/syslinux/modules/bios/ldlinux.c32 $PXE_BOOT_DIR/ldlinux.c32
cdist-6.0.2/hacking/preos-sh/remote-copy.sh 000644 001751 001751 00000000167 13552030341 021034 0 ustar 00darko darko 000000 000000 #!/bin/sh
# echo $@
# set -x
src=$1; shift
dst=$1; shift
real_dst=$(echo $dst | sed 's,:,,')
cp -L "$src" "$real_dst"
cdist-6.0.2/hacking/preos-sh/remote-exec.sh 000644 001751 001751 00000000653 13552030341 021006 0 ustar 00darko darko 000000 000000 #!/bin/sh
# echo $@
# set -x
chroot="$1"; shift
script=$(mktemp "${chroot}/tmp/chroot-${0##*/}.XXXXXXXXXX")
trap cleanup INT TERM EXIT
cleanup() {
[ $__cdist_debug ] || rm "$script"
}
echo "#!/bin/sh -l" > "$script"
echo "$@" >> "$script"
chmod +x "$script"
relative_script="${script#$chroot}"
# ensure PATH is setup
export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin
# run in chroot
chroot "$chroot" "$relative_script"
cdist-6.0.2/docs/2016-06-06.org 000644 001751 001751 00000000407 13552030341 015565 0 ustar 00darko darko 000000 000000 * Enhance cdist speed
** Start separate server with own option
** Reconfigure normal sshd with appropriate options
** Start various own daemons
** Use custom multiplexing protocol
** Support native Python code
*** Use manifest.py instead of manifest if available
cdist-6.0.2/docs/changelog 000644 001751 001751 00000164204 13552030341 015676 0 ustar 00darko darko 000000 000000 Changelog
---------
6.0.2: 2019-10-17
* New types: __xymon_server, __xymon_apache, __xymon_config, __xymon_client (Thomas Eckert)
* Type __letsencrypt_cert: Add Arch Linux support (Nico Schottelius)
* New type: __sensible_editor (Dennis Camera)
* Types __grafana_dashboard, __prometheus_alertmanager, __prometheus_exporter, __prometheus_server: Support Debian 10 (Ahmed Bilal Khalid)
6.0.1: 2019-10-08
* Type __group: Support OSes without getent (Dennis Camera)
* Type __user: Support OSes without getent (Dennis Camera)
* Type __ssh_authorized_keys: Support OSes without getent (Dennis Camera)
* Type __ssh_dot_ssh: Support OSes without getent (Dennis Camera)
* Explorer interfaces: Always sort output (Dennis Camera)
* Explorer os: Unquote value from os-release file (Dennis Camera)
* Type __letsencrypt_cert: Support Debian 10* (Ahmed Bilal Khalid)
* Type __prometheus_server: Add missing exit after unsupported error message (Dominique Roux)
* Type __git: Use --recurse-submodules instead of --recursive (Jonas Hagen)
* Type __git: Add --shallow option (Jonas Hagen)
6.0.0: 2019-10-01
* Type __letsencrypt_cert: Fix beowulf's spelling (Mondi Ravi)
* Core: Add preos functionality (Darko Poljak)
* Type __sysctl: Add alpine support (Nico Schottelius)
* Type __git: Add recursive option (Dennis Camera)
* Type __apt_key: Fix key dearmor (Ander Punnar)
5.1.3: 2019-08-30
* Build: Overcome bash CDPATH when building docs (Dmitry Bogatov)
* Type __grafana_dashboard: Update distribution name, package signing key URI and repository URI (Dominique Roux)
* Type __letsencrypt_cert: Add Devuan Beowulf support (Nico Schottelius)
* Type __letsencrypt_cert: Fix Devuan Ascii: support (Nico Schottelius)
* Type __docker: Add devuan support (Dominique Roux)
* Type __docker_swarm: Fix for Docker 19.03 (ĽubomĂr KuÄera)
5.1.2: 2019-06-21
* Core: Add support for type parameters deprecation (Darko Poljak)
* Type __acl: Rewrite and improve (Ander Punnar)
5.1.1: 2019-05-28
* Type __apt_key: Use gpg key, fallback to deprecated apt-key (Ander Punnar)
* Type __acl: Fix and improve (Ander Punnar)
* Documentation: Document type stdin inside loop caveats (Darko Poljak)
5.1.0: 2019-05-22
* Type __consul: Add alpine support (Nico Schottelius)
* Type __consul: Add version 1.5.0 (Nico Schottelius)
* Type __consul_agent: Add alpine support (Nico Schottelius)
* New helper script: cdist-new-type (Steven Armstrong, Darko Poljak)
* Core: Add support for deprecated type marker (Darko Poljak)
5.0.2: 2019-05-17
* Type __package_apk: Fix @repo handling in explorer (Nico Schottelius)
* Type __postfix: Add alpine support (Nico Schottelius)
* Type __postfix_postconf: Add alpine support (Nico Schottelius)
* Type __user: Add alpine support (Nico Schottelius)
* Core: Set __cdist_dry_run env var (Ander Punnar)
5.0.1: 2019-05-09
* Documentation: Add 'Perils of CDIST_ORDER_DEPENDENCY' sub-section (Darko Poljak)
* Build: Clean and separate end user targets into Makefile and maintainer targets into build-helper (Darko Poljak)
* Core: Update residual references to old cdist homepage (Darko Poljak)
* Documentation: Update residual references to old cdist homepage and git source (Darko Poljak)
* Type __cdist: Fix non working 'git://' protocol source (Darko Poljak)
5.0.0: 2019-05-05
* Type __zypper_service: Fix spelling error in manpage (Dmitry Bogatov)
* Explorer init: Add support for OpenBSD (sideeffect42)
* Type __postgres_database: Run psql with -w (no-password) (sideeffect42)
* Type __postgres_role: Run psql with -w (no-password) (sideeffect42)
* Type __block: Quote prefix/suffix - fix when prefix/suffix contains quotes (sideeffect42)
* Build: Update due to migration to code.ungleich.ch (Darko Poljak)
* Documentation: Update due to migration to code.ungleich.ch (Darko Poljak)
* Core: Detect and report dependency cycle as soon as possible (Darko Poljak)
* Core, documentation: Release -j/--jobs option, i.e. make it non-beta (Darko Poljak)
* Documentation: Update due to new cdist website (Darko Poljak)
* Build: Update due to new cdist website (Darko Poljak)
4.11.1: 2019-04-22
* Core: Improve explorer error reporting (Darko Poljak)
* Type __directory: explorer stat: add support for Solaris (Ander Punnar)
* Type __file: explorer stat: add support for Solaris (Ander Punnar)
* Type __ssh_authorized_keys: Remove legacy code (Ander Punnar)
* Explorer disks: Bugfix: do not break config in case of unsupported OS
which was introduced in 4.11.0, print message to stderr and empty disk list
to stdout instead (Darko Poljak)
4.11.0: 2019-04-20
* Type __package: Add __package_apk support (Nico Schottelius)
* Type __directory: Add alpine support (Nico Schottelius)
* Type __file: Add alpine support (Nico Schottelius)
* Type __hostname: Add alpine support (Nico Schottelius)
* Type __locale: Add alpine support (Nico Schottelius)
* Type __start_on_boot: Add alpine support (Nico Schottelius)
* Type __timezone: Add alpine support (Nico Schottelius)
* Type __start_on_boot: gentoo: check all runlevels in explorer (Nico Schottelius)
* New type: __package_apk (Nico Schottelius)
* Type __acl: Add support for ACL mask (Dimitrios Apostolou)
* Core: Fix circular dependency for CDIST_ORDER_DEPENDENCY (Darko Poljak)
* Type __acl: Improve the type (Ander Punnar)
* Explorer interfaces: Simplify code, be more compatible (Ander Punnar)
* Explorer disks: Remove assumable default/fallback, for now explicitly support only Linux and BSDs (Ander Punnar, Darko Poljak)
4.10.11: 2019-04-13
* Core: Fix broken quiet mode (Darko Poljak)
* Build: Add version.py into generated raw source archive (Darko Poljak)
* Explorer disks: Fix detecting disks, fix/add support for BSDs (Ander Punnar)
* Type __file: Fix stat explorer for BSDs (Ander Punnar)
* Type __directory: Fix stat explorer for BSDs (Ander Punnar)
4.10.10: 2019-04-11
* New types: __ufw and __ufw_rule (Mark Polyakov)
* Type __link: Add messaging (Ander Punnar)
* Debugging: Rename debug-dump.sh to cdist-dump (Darko Poljak)
* Documentation: Add cdist-dump man page (Darko Poljak)
4.10.9: 2019-04-09
* Type __ssh_authorized_keys: Properly handle multiple --option params (Steven Armstrong)
* Debugging: Add debug dump helper script (Darko Poljak)
* Type __file: Bugfix: fire onchange for present and exists states if no attribute is changed (Darko Poljak)
4.10.8: 2019-04-06
* Type __clean_path: Fix list explorer exit code if path not directory or does not exist (Ander Punnar)
* New type: __check_messages (Ander Punnar)
4.10.7: 2019-03-30
* Build: Migrate from pep8 to pycodestyle (Darko Poljak)
* Type __start_on_boot: Implement state absent for OpenBSD (Daniel Néri)
* Explorers cpu_cores, disks: Add support for OpenBSD (Daniel Néri)
* Type __staged_file: Use portable -p instead of --tmpdir for mktemp (Silas Silva)
* Type __line: Add onchange parameter (Ander Punnar)
* Type __file: Add onchange parameter (Ander Punnar)
* New type: __clean_path (Ander Punnar)
4.10.6: 2019-02-15
* Type __prometheus_alertmanager: Add startup flag (Dominique Roux)
* Types __zypper_repo, __zypper_service: Re-add the use of echo in explorers (Daniel Heule)
4.10.5: 2018-12-21
* Type __group: Fix/remove '--' from echo command (Dimitrios Apostolou)
* New type: __ping (Olliver Schinagl)
* Type __postgres_role: Fix broken syntax (Nico Schottelius, Darko Poljak)
* Type __consul_agent: Add Debian 9 support (Jin-Guk Kwon)
* Documentation: Fix broken links (Rage )
* Type __docker: Add version parameter (Jonas Weber)
* Type __sysctl: Refactor for better OS support (Takashi Yoshi)
* Types __package_*: Add messaging upon installation/removal (Takashi Yoshi)
* Type __package_pkg_openbsd: Reworked (Takashi Yoshi)
4.10.4: 2018-11-03
* Core: Transfer all files of a directory at once instead of calling copy once per file (myeisha)
* Core: Add timestamp (optional) to log messages (Darko Poljak)
* Explorers and types: Fix shellcheck found problems and encountered bugs (Jonas Weber, Thomas Eckert, Darko Poljak)
* Build: Add shellcheck makefile target and check when doing release (Darko Poljak)
* Type __consul: Add newest versions (Dominique Roux)
* Type __user: Remove annoying output, handle state param gracefully, add messages for removal (Thomas Eckert)
* Core: Fix checking for conflicting parameters for multiple values parameters (Darko Poljak)
* Documentation: Various fixes (Thomas Eckert)
* Various types: Improve OpenBSD support (sideeffect42)
4.10.3: 2018-09-23
* New global explorer: os_release (ĽubomĂr KuÄera)
* Type __docker: Update type, install docker CE (ĽubomĂr KuÄera)
* Type __package_apt: Write a message when a package is installed or removed; shellcheck (Jonas Weber)
* Documentation: Add 'Dive into real world cdist' walkthrough chapter (Darko Poljak)
* Core: Remove duplicate remote mkdir calls in explorer transfer (myeisha)
4.10.2: 2018-09-06
* Type __letsencrypt_cert: Add support for devuan ascii (Darko Poljak)
* Type __systemd_unit: Fix minor issues and add masking unit files support (Adam Dej)
* Type __grafana_dashboard: Fix devuan ascii support (Dominique Roux)
* Type __apt_source: Add nonparallel marker (Darko Poljak)
* Type __package_update_index: Fix error when using OS not using apt (Stu Zhao)
* Type __package_update_index: Support --maxage for type pacman (Stu Zhao)
* Type __letsencrypt_cert: Fix explorers: check that certbot exists before using it (Darko Poljak)
4.10.1: 2018-06-21
* Type __letsencrypt_cert: Fix temp file location and removal (Darko Poljak)
* Type __line: Handle missing file in __line explorer gracefully (Jonas Weber)
* Documentation: Add env vars usage idiom for writing types (Darko Poljak)
4.10.0: 2018-06-17
* New type: __acl (Ander Punnar)
* Core: Disable config parser interpolation (Darko Poljak)
* Type __sysctl: Use sysctl.d location if exists (Darko Poljak)
* Type __line: Rewrite and support --before and --after (Steven Armstrong)
4.9.1: 2018-05-30
* New type: __install_coreos (ĽubomĂr KuÄera)
* Type __consul_agent: Add LSB init header (Nico Schottelius)
* Type __package_yum: Fix explorer when name contains package name with exact version specified (Aleksandr Dinu)
* Type __letsencrypt_cert: Use object id as domain if domain param is not specified (Darko Poljak)
4.9.0: 2018-05-17
* Type __docker_stack: Use --with-registry-auth option (ĽubomĂr KuÄera)
* New type: __docker_config (ĽubomĂr KuÄera)
* New type: __docker_secret (ĽubomĂr KuÄera)
* Type __letsencrypt_cert: Rewritten; WARN: breaks backward compatibility (ĽubomĂr KuÄera)
* Core: Fix NameError: name 'cdist_object' is not defined (Darko Poljak)
4.8.4: 2018-04-20
* Documentation, type manpages: Fix spelling (Dmitry Bogatov)
* New explorer: is-freebsd-jail (Kamila SouÄkovĂ¡)
* Types __hostname, __start_on_boot, __sysctl: Support FreeBSD (Kamila SouÄkovĂ¡)
* Type __install_config: set environment variable to distinguish between
install-config and regular config (Steven Armstrong)
* Core: Improve error reporting (Darko Poljak)
4.8.3: 2018-03-16
* Type __key_value: Add onchange parameter (Kamila SouÄkovĂ¡)
* Types __prometheus_server, __prometheus_alertmanager, __grafana_dashboard:
Work with packages instead of go get, remove __daemontools dependency and clean up (Kamila SouÄkovĂ¡)
* Documentation: Fix manpage generation (Darko Poljak)
* New type: __docker_swarm (ĽubomĂr KuÄera)
* New type: __docker_stack (ĽubomĂr KuÄera)
4.8.2: 2018-03-10
* Core: Fix quiet argument access for bare cdist command (Darko Poljak)
4.8.1: 2018-03-09
* Type __consul: Add option for directly downloading on target host (Darko Poljak)
* Core: Add -4 and -6 params to force IPv4, IPv6 addresses respectively (Darko Poljak)
* Type __package_update_index: Fix messaging (Thomas Eckert)
* Type __package_dpkg: Add state parameter and messaging (Thomas Eckert)
* Core: Fix a case when HOME is set but empty (Darko Poljak)
* Core: Fix non-existent manifest non graceful handling (Darko Poljak)
* Core: Fix main and inventory parent argparse options (Darko Poljak)
* Core: Fix lost error info with parallel jobs (option -j) (Darko Poljak)
* Core: Fix determining beta value through configuration (Darko Poljak)
* Core: Fix determining save_output_streams value through configuration (Darko Poljak)
* Core: Support in-distribution config file (Darko Poljak)
* New type: __apt_default_release (Matthijs Kooijman)
* Type __file: Add pre-exists state (Matthijs Kooijman)
* Type __grafana_dashboard: Add support for stretch + ascii (Nico Schottelius)
* Core: Fix idna (getaddrinfo) unicode tracebak for invalid host name (Darko Poljak)
4.8.0: 2018-02-14
* Core: Skip empty lines in parameter files (Darko Poljak)
* Explorer memory: Support OpenBSD (Philippe Gregoire)
* Type __install_config: re-export cdist log level during installation (Steven Armstrong)
* Type __sysctl: Add support for CoreOS (ĽubomĂr KuÄera)
* Type __systemd_unit: Various improvements (ĽubomĂr KuÄera)
* Type __line: Support regex beginning with '-' (Philippe Gregoire)
* Type __letsencrypt_cert: Add nonparallel; make admin-email required (Kamila SouÄkovĂ¡)
* Type __package_pkgng_freebsd: Redirect stdout and stderr to /dev/null instead of closing them (michal-hanu-la)
* Type __daemontools: Make it more robust and clean up the code (Kamila SouÄkovĂ¡)
* Core: Save output streams (Steven Armstrong, Darko Poljak)
* Documentation: Add local cache overview (Darko Poljak)
* Type __systemd_unit: Fix handling stdin (Jonas Weber)
* Type __package_apt: Add --purge-if-absent parameter (Jonas Weber)
* Type __package_update_index: Add --maxage parameter for apt and add message if index was updated(Thomas Eckert)
* Type __motd: Support reading from stdin (Jonas Weber)
* Type __issue: Support reading from stdin (Jonas Weber)
* Type __package_apt: Add support for --version parameter (Darko Poljak)
* Type __letsencrypt_cert: Add --renew-hook parameter(Darko Poljak)
* Core: Support disabling saving output streams (Darko Poljak)
* Type __apt_source: Remove update index dependency; call index update in gencode-remote (Darko Poljak)
4.7.3: 2017-11-10
* Type __ccollect_source: Add create destination parameter (Dominique Roux)
* Type __ssh_authorized_key: Add messaging (Thomas Eckert)
* New type: __letsencrypt_cert (Nico Schottelius, Kamila SouÄkovĂ¡)
* Core: Warn about invalid type in conf dir and continue instead of error (Darko Poljak)
* New type: __systemd_unit (ĽubomĂr KuÄera)
* Type __letsencrypt_cert: Add support for debian stretch (Daniel Tschada)
* Type __line: Fix a case for absent when line contains single quotes (Darko Poljak)
* Type __config_file: Fix onchange command not being executed (ĽubomĂr KuÄera)
4.7.2: 2017-10-22
* Type __hostname: Add support for CoreOS (ĽubomĂr KuÄera)
* Type __timezone: Add support for CoreOS (ĽubomĂr KuÄera)
* Explorer os: Fix for devuan ascii (Kamila SouÄkovĂ¡)
4.7.1: 2017-10-01
* Type __line: Add messaging (Thomas Eckert)
* Documentation: Fix documentation for building custom man-pages from non-standard path (Thomas Eckert)
* Core: Fix running scripts with execute bit when name without path is specified (Ander Punnar)
* Type __process: Add messaging (Thomas Eckert)
4.7.0: 2017-09-22
* Core: Add configuration/config file support (Darko Poljak)
* Core: Implement simple integration API (unstable) (Darko Poljak)
* Explorer machine_type: Detect kvm on proxmox (Sven Wick)
* Types __prometheus_server, __prometheus_alertmanager: Bugfixes (Kamila SouÄkovĂ¡)
* New type: __prometheus_exporter (Kamila SouÄkovĂ¡)
* Type __daemontools: Improve it on FreeBSD (Kamila SouÄkovĂ¡)
* Type __package_pkg_openbsd: Fix use of --name (Philippe Gregoire)
* Type __package_pkg_openbsd: Fix pkg_version explorer (Philippe Gregoire)
* Type __prometheus_exporter: Fixes + go version bump (Kamila SouÄkovĂ¡)
* Core, types: __cdist_loglevel -> __cdist_log_level (Darko Poljak)
* Core, types: Add __cdist_log_level_name env var with vlaue of log level name (Darko Poljak)
* Core: Make cdist honor __cdist_log_level env var (Darko Poljak)
* Core: Add -l/--log-level option (Darko Poljak)
* Type __install_stage: Fix __debug -> __cdist_log_level (Darko Poljak)
* Documentation: Document __cdist_log_level (Darko Poljak)
* Core: Log ERROR to stderr and rest to stdout (Darko Poljak, Steven Armstrong)
* Type __ssh_authorized_key: Bugfix the case where invalid key clears a file and add key validation (Darko Poljak)
4.6.1: 2017-08-30
* Type __user: Explore with /etc files (passwd, group, shadow) (Philippe Gregoire)
* Explorer init: Use pgrep instead of ps for Linux (Philippe Gregoire)
* Type __apt_key_uri: Redirect stderr of apt-key to /dev/null (Mark Verboom)
* Type __package_pkg_openbsd: Support the empty flavor (Philippe Gregoire)
* Type __package_pkg_openbsd: Support using /etc/installurl (Philippe Gregoire)
* Type __user_groups: Support OpenBSD (Philippe Gregoire)
* Type __hostname: Allow hostnamectl to fail silently (Steven Armstrong)
* Type __install_config: Use default default __remote_{copy,exec} in custom __remote_{copy,exec} scripts (Steven Armstrong)
* Type __ssh_authorized_key: Fix removing ssh key that is last one in the file (Darko Poljak)
4.6.0: 2017-08-25
* Core: Add inventory functionality (Darko Poljak)
* Core: Expose inventory host tags in __target_host_tags env var (Darko Poljak)
* Type __timezone: Check current timezone before doing anything (Ander Punnar)
* Core: Add -p HOST_MAX argument (Darko Poljak)
* Core: Add archiving support for transferring directory - new -R beta option (Darko Poljak)
* Core: Fix ssh connection multiplexing race condition (Darko Poljak)
* Core: Fix emulator race conditions with -j option (Darko Poljak)
* Documentation: Cleanup (Darko Poljak)
* Explorer os: Get ID from /etc/os-release (Philippe Gregoire)
4.5.0: 2017-07-20
* Types: Fix install types (Steven Armstrong)
* Core: Add -r command line option for setting remote base path (Steven Armstrong)
* Core: Allow manifest and gencode scripts to be written in any language (Darko Poljak)
* Documentation: Improvements to the english and fix typos (Mesar Hameed)
* Core: Merge -C custom cache path pattern option from beta branch (Darko Poljak)
* Core: Improve and cleanup logging (Darko Poljak, Steven Armstrong)
* Core: Remove deprecated -d option (Darko Poljak)
* Type __file: If no --source then create only if there is no file (Ander Punnar)
* Core: Ignore directory entries that begin with dot('.') (Darko Poljak)
* Core: Fix parallel object prepare and run steps and add nonparallel type marker (Darko Poljak)
4.4.4: 2017-06-16
* Core: Support -j parallelization for object prepare and object run (Darko Poljak)
* Type __install_mkfs: mkfs.vfat does not support -q (Nico Schottelius)
* Types __go_get, __daemontools*, __prometheus*: Fix missing dependencies, fix arguments (Kamila SouÄkovĂ¡)
4.4.3: 2017-06-13
* Type __golang_from_vendor: Install golang from https://golang.org/dl/ (Kamila SouÄkovĂ¡)
* Type __go_get: Install go packages using go get (Kamila SouÄkovĂ¡)
* Explorer kernel_name: uname -s (Kamila SouÄkovĂ¡)
* Type __sysctl: Add devuan support (Nico Schottelius)
* Type __start_on_boot: Add devuan support (Nico Schottelius)
* Core: Shorten ssh control path (Darko Poljak)
* Type __consul: Add new version and add http check (Kamila SouÄkovĂ¡)
* New types: __daemontools and __daemontools_service (Kamila SouÄkovĂ¡)
* New types: __prometheus_server and __prometheus_alertmanager (Kamila SouÄkovĂ¡)
* New type: __grafana_dashboard (Kamila SouÄkovĂ¡)
4.4.2: 2017-03-08
* Core: Fix suppression of manifests' outputs (Darko Poljak)
* Type __user_groups: Support FreeBSD (Andres Erbsen)
* Type __cron: Fix filter for new cron on sles12 sp2 (Daniel Heule)
* Type __docker: Support absent state (Dominique Roux)
* Type __docker_compose: Support absent state (Dominique Roux)
* New type: __hosts (Dmitry Bogatov)
* New type: __dot_file (Dmitry Bogatov)
4.4.1: 2016-12-17
* Documentation: Update docs for types that used man.rst as symbolic links (Darko Poljak)
* Type __cron: Remove '# marker' for raw_command due to cron security (Daniel Heule)
* New type: __docker_compose (Dominique Roux)
* Type __apt_mark: Check supported apt version and if package is installed (Ander Punnar)
* New type: __docker (Steven Armstrong)
* New type: __package_dpkg (Tomas Pospisek)
4.4.0: 2016-12-03
* Core: Deprecate -d option and make -v option log level counter (Darko Poljak)
* New type: __postgres_extension (Tomas Pospisek)
* Core, types: Support IPv6 (Darko Poljak)
* Type __consul: Add source and cksum files for Consul 0.7.0 and 0.7.1 (Carlos Ortigoza)
* Type __user: FreeBSD fix (Kamila Souckova)
* New type: __apt_mark (Ander Punnar)
* Type __package_upgrade_all: Do not dist-upgrade by default, add apt-clean and apt-dist-upgrade options (Ander Punnar)
* Core: Correct target_host var in code.py (Darko Poljak)
* All: Merge install feature from 4.0-pre-not-stable (Darko Poljak)
4.3.2: 2016-10-13
* Documentation: Update no longer existing links (Simon Walter)
* Core: Add warning message for faulty dependencies case (Darko Poljak)
* Explorer os_version: Use /etc/os-release instead of /etc/SuSE-release (Daniel Heule)
* Type __package: Call __package_pkg_openbsd on openbsd (Andres Erbsen)
* Type __package_pkg_openbsd: Support --version (Andres Erbsen)
* Type __hostname: Support openbsd (Andres Erbsen)
* New type: __firewalld_start: start/stop firewalld and/or enable/disable start on boot (Darko Poljak)
* Bugfix __consul_agent: Config option was misnamed 'syslog' instead of 'enable_syslog' (Steven Armstrong)
4.3.1: 2016-08-22
* Documentation: Spelling fixes (Darko Poljak)
* Type __filesystem: Spelling fixes (Dmitry Bogatov)
* Core: Add target_host file to cache since cache dir name can be hash (Darko Poljak)
* Core: Improve hostfile: support comments, skip empty lines (Darko Poljak)
4.3.0: 2016-08-19
* Documentation: Add Parallelization chapter (Darko Poljak)
* Core: Add -b, --enable-beta option for enabling beta functionalities (Darko Poljak)
* Core: Add -j, --jobs option for parallel execution and add parallel support for global explorers (currently in beta) (Darko Poljak)
* Core: Add derived env vars for target hostname and fqdn (Darko Poljak)
* New type: __keyboard: Set keyboard layout (Carlos Ortigoza)
* Documentation: Re-license types' man pages to GPLV3+ (Dmitry Bogatov, Darko Poljak)
* New type __filesystem: manage filesystems on devices (Daniel Heule)
* New type: __locale_system (Steven Armstrong, Carlos Ortigoza, Nico Schottelius)
* New type: __sysctl (Steven Armstrong)
4.2.2: 2016-07-26
* Core: Fix ssh ControlPath socket file error (Darko Poljak)
* Documentation: Update cdist man page and cdist-references (Darko Poljak)
* Documentation: Change cdist and cdist-type__pyvenv man page licenses to GPLv3+ (Darko Poljak)
* Documentation: Add FILES to cdist man page (Darko Poljak)
4.2.1: 2016-07-18
* Build: Fix signed release (Darko Poljak)
* Build: Fix building docs (Darko Poljak)
* Documentation: Fix man pages (Dmitry Bogatov)
* Documentation: Fix spellings (Dmitry Bogatov)
4.2.0: 2016-07-16
* Build: Make github signed release (Darko Poljak)
* Core: Fix hostdir: use hash instead of target host (Steven Armstrong)
* Core: pep8 (Darko Poljak)
* Documentation: Restructure and fix and improve docs and manpages (Darko Poljak)
* Core: Add files directory for static files (Darko Poljak)
* Custom: Add bash and zsh completions (Darko Poljak)
* Core: Improve error reporting for local and remote run command (Darko Poljak)
* New type: __jail_freebsd9: Handle jail management on FreeBSD <= 9.X (Jake Guffey)
* New type: __jail_freebsd10: Handle jail management on FreeBSD >= 10.0 (Jake Guffey)
* Type __jail: Dynamically select the correct jail subtype based on target host OS (Jake Guffey)
* Explorer __machine_type: add openvz and lxc
* Explorer __os __os_version: add scientific
* Type various: add scientific
* Explorer __machine_type: add virtualbox (Stu Zhao)
4.1.0: 2016-05-27
* Documentation: Migrate to reStructuredText format and sphinx (Darko Poljak)
* Core: Add -f option to read additional hosts from file/stdin (Darko Poljak)
* Type __apt_key: Use pool.sks-keyservers.net as keyserver (Steven Armstrong)
4.0.0: 2016-05-04
* Core: Fix bug with parallel hosts operation when output path is specifed (Darko Poljak)
* Type __package_pip: Add support for running as specified user (useful for pip in venv) (Darko Poljak)
* New type: __pyvenv: Manage python virtualenv (Darko Poljak)
* Core: Add CDIST_REMOTE_COPY/EXEC env variables and multiplexing options for default scp/ssh (Darko Poljak)
* Types: Remove bashisms in scripts (Darko Poljak)
* Core: Fix bug in remote command with environment (Darko Poljak)
* Core: Fix bug in local code execution (Darko Poljak)
* Documentation: Fix spelling in manual pages (Dmitry Bogatov)
* New type: __pacman_conf: Manage pacman.conf (Dominique Roux)
* New type: __pacman_conf_integrate: cdist compatible pacman.conf (Dominique Roux)
* Type __consul: Do not install unused package unzip (Steven Armstrong)
* Type __consul: Add source & cksum for 0.5.2 (Steven Armstrong)
* Core: Support object ids '.cdist' (Nico Schottelius)
* Type __apt_norecommends: Also setup autoremove options (Dmitry Bogatov)
* Type __user_groups: Add NetBSD support (Jonathan A. Kollasch)
* Type __timezone: Add NetBSD support (Jonathan A. Kollasch)
* Type __ccollect_source: Add NetBSD support (Jonathan A. Kollasch)
* Type __directory: Add NetBSD support (Jonathan A. Kollasch)
* Type __file: Add NetBSD support (Jonathan A. Kollasch)
* Type __group: Add NetBSD support (Jonathan A. Kollasch)
* Type __consul: Add new consul versions (Nico Schottelius)
* Type __apt_ppa: Do not install legacy package python-software-properties (Steven Armstrong)
3.1.13: 2015-05-16
* Type __block: Fix support for non stdin blocks (Dominique Roux)
* Type __consul: Install package unzip (Nico Schottelius)
* Type __consul: Add source & cksum for 0.5.1 (Nico Schottelius)
* Type __consul_agent: Use systemd for Debian 8 (Nico Schottelius)
* Type __firewalld_rule: Ensure firewalld package is present (David HĂ¼rlimann)
* Type __locale: Support CentOS (David HĂ¼rlimann)
* Type __staged_file: Fix comparison operator (Nico Schottelius)
* Type __user_groups: Support old Linux versions (Daniel Heule)
3.1.12: 2015-03-19
* Core: Support object ids '.cdist' (Nico Schottelius)
* New type: __firewalld_rule (Nico Schottelius)
* Type __consul_agent: add support for acl options (Steven Armstrong)
* Type __consul_agent: add support for Debian (Nico Schottelius)
* Type __package_apt: Use default parameters (Antoine Catton)
* Type __package_luarocks: Use default parameters (Antoine Catton)
* Type __package_opkg: Use default parameters (Antoine Catton)
* Type __package_pacman: Use default parameters (Antoine Catton)
* Type __package_pip: Use default parameters (Antoine Catton)
* Type __package_pkg_freebsd: Use default parameters (Antoine Catton)
* Type __package_pkg_openbsd: Use default parameters (Antoine Catton)
* Type __package_pkgng_openbsd: Use default parameters (Antoine Catton)
3.1.11: 2015-02-27
* New type: __staged_file: Manage staged files (Steven Armstrong)
* New type: __config_file: Manage configuration files and run code on change (Steven Armstrong)
* New type: __consul: install consul (Steven Armstrong)
* New type: __consul_agent: manage the consul agent (Steven Armstrong)
* New type: __consul_check: manages consul checks (Steven Armstrong)
* New type: __consul_reload: reload consul (Steven Armstrong)
* New type: __consul_service: manages consul services (Steven Armstrong)
* New type: __consul_template: manage the consul-template service (Steven Armstrong)
* New type: __consul_template_template: manage consul-template templates (Steven Armstrong)
* New type: __consul_watch_checks: manages consul checks watches (Steven Armstrong)
* New type: __consul_watch_event: manages consul event watches (Steven Armstrong)
* New type: __consul_watch_key: manages consul key watches (Steven Armstrong)
* New type: __consul_watch_keyprefix: manages consul keyprefix watches (Steven Armstrong)
* New type: __consul_watch_nodes: manages consul nodes watches (Steven Armstrong)
* New type: __consul_watch_service: manages consul service watches (Steven Armstrong)
* New type: __consul_watch_services: manages consul services watches (Steven Armstrong)
* New Type: __rsync (Nico Schottelius)
* Type __start_on_boot: Support Ubuntu upstart (Nico Schottelius)
* Type __timezone: Added support for FreeBSD (Christian Kruse)
3.1.10: 2015-02-10
* Core: Fix too many open files bug (#343)
* Type __ssh_authorized_keys: Remove unneeded explorer (Steven Armstrong)
* Type __ssh_authorized_keys: Fix empty output bug of entry explorer (Steven Armstrong)
* Type __package_apt: Add support for --target-release (Nico Schottelius)
* Type __locale: Add support for Ubuntu (Nico Schottelius)
* Type __group: Rewrite (Steven Armstrong)
* Documentation: Fix typo in maintainer file (Stephan Kulla)
3.1.9: 2014-10-17
* Type __package_emerge: Fix handling of slotted packages (Daniel Heule)
* Type __package_apt: Use --force-confdef (Ricardo Catalinas Jiménez)
* Type __package_update_index: Decrease verbosity (Ricardo Catalinas Jiménez)
* Type __package_upgrade_all: Decrease verbosity (Ricardo Catalinas Jiménez)
3.1.8: 2014-10-01
* New Type: __package_update_index (Ricardo Catalinas Jiménez)
* New Type: __package_upgrade_all (Ricardo Catalinas Jiménez)
3.1.7: 2014-09-29
* Type __cdistmarker: Fix typo (Ricardo Catalinas Jiménez)
* Core: Bugfix: Export messaging to manifests (Ricardo Catalinas Jiménez)
* Explorer cpu_cores, cpu_sockets, memory: Add Mac OS X support (Manuel Hutter)
* Type __ssh_authorized_keys: Ensure keys are correctly added (Steven Armstrong)
* New Type: __ssh_authorized_key (Steven Armstrong)
* New Type: __package_pkgng_freebsd (Jake Guffey)
3.1.6: 2014-08-18
* New Type: __ssh_dot_ssh (Nico Schottelius)
* Type __package_yum: Support retrieving package via URL (Nico Schottelius)
* Type __hostname: Support SuSE and have CentOS use sysconfig value (Nico Schottelius)
* Type __locale: Support SuSE (Nico Schottelius)
* Type __locale: Support Archlinux (Nico Schottelius)
* Type __timezone: Support SuSE (Nico Schottelius)
* Type __file: Support MacOS X (Manuel Hutter)
* Type __iptables_apply: Add "reset" to init.d script of iptables (Nico Schottelius)
* Type __ssh_authorized_key: Use new type __ssh_dot_ssh (Nico Schottelius)
* Type __zypper_repo: Bugfix for pattern matching (Daniel Heule)
3.1.5: 2014-05-05
* Type __zypper_repo: Automatically import gpg keys (Daniel Heule)
* Type __zypper_service: Automatically import gpg keys (Daniel Heule)
3.1.4: 2014-05-04
* Core: Ensure all created files end in \n (Steven Armstrong)
* Documentation: Cleanup up, added HTML links (Tomas Pospisek)
* Explorer interfaces: Remove test output (Daniel Heule)
* Type __jail: Add messaging support (Jake Guffey)
3.1.3: 2014-04-29
* New Type: __yum_repo (Steven Armstrong)
* Type __hostname: Add support for CentOS (Nico Schottelius)
3.1.2: 2014-04-12
* Documentation: Add missing environment variables to reference (Nico Schottelius)
* Type __qemu_img: size is optional, if state is not present (Nico Schottelius)
* Type __key_value: Rewrite using awk (Daniel Heule)
* New Type: __dog_vdi (Nico Schottelius)
3.1.1: 2014-03-26
* Core: Make __object and __object_id available to code (Daniel Heule)
* New explorer: cpu_cores (Daniel Heule/Thomas Oettli)
* New explorer: cpu_sockets (Daniel Heule/Thomas Oettli)
* New explorer: machine_type (Daniel Heule/Thomas Oettli)
* New explorer: memory (Daniel Heule/Thomas Oettli)
* Type __jail: Fix parameter names in explorer (Jake Guffey)
* Type __line: Ensure permissions are kept (Steven Armstrong)
* Type __link: Do not create link in directory, if link exists (Steven Armstrong)
* Type __package_pkg_openbsd: Improve error handling (og)
3.1.0: 2014-03-19
* New Type: __rbenv (Nico Schottelius)
* Type __file: Enhance OpenBSD Support (og)
* Type __git: Pass onwer/group/mode values to __directory (Nico Schottelius)
* Type __iptable_rule: Fix example documentation (Antoine Catton)
* Type __key_value: Add messaging support (Nico Schottelius)
* Type __package_pkg_openbsd: Allow to change PKG_PATH (og)
* Type __ssh_authorized_keys: Allow managing existing keys (Steven Armstrong)
* Type __user: Enhance OpenBSD Support (og)
3.0.9: 2014-02-14
* Core: Ignore order dependencies if override is set (Daniel Heule)
* Core: Improve Mac OS X support for unit tests (Steven Armstrong)
* Type __locale: Error out in case of unsupported OS (Nico Schottelius)
* Type __jail: Use default parameters for state (Daniel Heule)
* Type __pf_ruleset: Use default parameters for state (Daniel Heule)
* Type __postgres_database: Use default parameters for state (Daniel Heule)
* Type __postgres_role: Use default parameters for state (Daniel Heule)
* Type __rvm: Use default parameters for state (Daniel Heule)
* Type __rvm_gem: Use default parameters for state (Daniel Heule)
* Type __rvm_gemset: Use default parameters for state (Daniel Heule)
* Type __rvm_ruby: Use default parameters for state (Daniel Heule)
3.0.8: 2014-02-11
* Core: Enhance object id verification (Daniel Heule)
* Core: Add unit tests for dependencies based on execution order (Daniel Heule)
* Core: Add unit tests for dry run (Daniel Heule)
3.0.7: 2014-02-08
* Core: Allow dependencies to be created based execution order (Daniel Heule)
* Core: Add tests for override (Daniel Heule)
3.0.6: 2014-02-06
* New Type: __apt_key (Steven Armstrong)
* New Type: __apt_key_uri (Steven Armstrong)
* New Type: __apt_norecommends (Steven Armstrong)
* New Type: __apt_source (Steven Armstrong)
* New Type: __ccollect_source (Nico Schottelius)
* Type __git: Use default parameters (Daniel Heule)
* Type __jail: Use default parameters (Daniel Heule)
* Type __package_yum: Use default parameters (Daniel Heule)
* Type __package_zypper: Use default parameters (Daniel Heule)
* Type __user_groups: Use default parameters (Daniel Heule)
3.0.5: 2014-02-05
* Core: Introduce override concept (Daniel Heule)
* Type __process: Make --state absent work (Steven Armstrong)
* Documentation: Update documentation for environment variables (Nico Schottelius)
3.0.4: 2014-01-29
* Core: Ignore install types in config mode (Nico Schottelius)
* Documentation: Update reference (files path in object space) (Nico Schottelius)
* Documentation: Update best practise: Replaces templates/ with files/ (Nico Schottelius)
* Type __apt_ppa: Install required software (Steven Armstrong)
* Type __debconf_set_selections: Support --file - to read from stdin (Nico Schottelius)
* Type __jail: Fix jaildir parameter handling (Jake Guffey)
3.0.3: 2014-01-22
* Core: Enhance error message when requirement is missing object id (Nico Schottelius)
* Core: Add environment variable to select shell for executing scripts (Daniel Heule)
* Explorer hostname: Return host name by using uname -n (Nico Schottelius)
* New Type: __hostname (Steven Armstrong)
* Type __cdist: Use default paremeters (Daniel Heule)
* Type __key_value: Use default paremeters (Daniel Heule)
* Type __line: Use printf instead of echo for printing user input (Nico Schottelius)
* Type __qemu_img: Use default paremeters (Daniel Heule)
* Type __zypper_repo: Use default paremeters (Daniel Heule)
* Type __zypper_service: Use default paremeters (Daniel Heule)
3.0.2: 2014-01-19
* Documentation: Document all messages sent by types (Daniel Heule)
* New Type: __block (Steven Armstrong)
* New Type: __mount (Steven Armstrong)
* Type __cron: Replace existing entry when changing it (Daniel Heule)
* Type __ssh_authorized_keys: Use new type __block (Steven Armstrong)
3.0.1: 2014-01-14
* Core: Copy only files, not directories (Steven Armstrong)
* Core: Allow hostnames to start with / (Nico Schottelius)
* Type __line: Remove unnecessary backslash escape (Nico Schottelius)
* Type __directory: Add messaging support (Daniel Heule)
* Type __directory: Do not generate code if mode is 0xxx (Daniel Heule)
* Type __package: Fix typo in optional parameter ptype (Daniel Heule)
* Type __start_on_boot: Fix for SuSE's chkconfig (Daniel Heule)
3.0.0: 2013-12-24
* Core: Added messaging support (Nico Schottelius)
* Core: Removed unused "changed" attribute of objects (Nico Schottelius)
* Core: Support default values for multiple parameters (Steven Armstrong)
* Core: Ensure Object Parameter file contains \n (Steven Armstrong)
* New Type: __zypper_repo (Daniel Heule)
* New Type: __zypper_service (Daniel Heule)
* New Type: __package_emerge (Daniel Heule)
* New Type: __package_emerge_dependencies (Daniel Heule)
* Type __cron: Add support for raw lines (Daniel Heule)
* Type __cron: Suppress stderr output from crontab (Daniel Heule)
* Type __cron: Fix quoting issue (Daniel Heule)
* Type __file: Do not generate code if mode is 0xxx (Nico Schottelius)
* Type __iptables_rule: Use default parameter (Nico Schottelius)
* Type __key_value: Fix quoting issue (Steven Armstrong)
* Type __package: Use state --present by default (Steven Armstrong)
* Type __package_zypper: Support non packages as well (Daniel Heule)
* Type __package_zypper: Support package versions (Daniel Heule)
* Type __postfix_*: Depend on __postfix Type (Steven Armstrong)
* Type __postfix_postconf: Enable support for SuSE (Daniel Heule)
* Type __postfix: Enable support for SuSE (Daniel Heule)
* Type __start_on_boot: Use default parameter state (Nico Schottelius)
* Type __start_on_boot: Add support for gentoo (Daniel Heule)
* Type __user: Add support for state parameter (Daniel Heule)
* Type __user: Add support for system users (Daniel Heule)
* Type __user: Add messaging support (Steven Armstrong)
* Type __zypper_service: Support older SuSE releases (Daniel Heule)
2.3.7: 2013-12-02
* Type __file: Secure the file transfer by using mktemp (Steven Armstrong)
* Type __file: Only remove file when state is absent (Steven Armstrong)
* Type __link: Only remove link when state is absent (Steven Armstrong)
* Type __directory: Only remove directory when state is absent (Steven Armstrong)
* Type __directory: Fix newly introduced quoting issue (Nico Schottelius)
* Type __package_zypper: Fix explorer and parameter issue (Daniel Heule)
* Core: Fix backtrace when cache cannot be deleted (Nico Schottelius)
2.3.6: 2013-11-25
* New Type: __locale (Nico Schottelius)
* Type __line: Ensure special characters are not interpreted (Nico Schottelius)
2.3.5: 2013-10-10
* Core: Unit test fix for remote_copy (Steven Armstrong)
* Documentation: Updated manpages of __package and __file (Alex Greif)
* Documentation: Add more examples to cdist-manifest (Dan Levin)
* Type __package_apt: Do not install recommends by default (Nico Schottelius)
2.3.4: 2013-10-03
* Core: Add missing bits to support dry run (Steven Armstrong)
* Core: Make unit test remote copy more compatible with scp (Steven Armstrong)
* New Type: __postfix (Steven Armstrong)
* New Type: __postfix_master (Steven Armstrong)
* New Type: __postfix_postconf (Steven Armstrong)
* New Type: __postfix_postmap (Steven Armstrong)
* New Type: __postfix_reload (Steven Armstrong)
* Type __line: Ensure regex does not contain /
* Type __ssh_authorized_keys: Bugfix: Preserve ownership (Steven Armstrong)
2.3.3: 2013-09-09
* Core: Add support for default values of optional parameters (Steven Armstrong)
* Type __start_on_boot: Bugfix for systemd (Steven Armstrong)
2.3.2: 2013-09-05
* Build: Ensure tests don't change attributes of non-test files (Nico Schottelius)
* Core: Fix typo in argument parser (Nico Schottelius)
* Core: Code cleanup: Remove old install code (Steven Armstrong)
* Core: Improve error message when using non-existing type in requirement (Nico Schottelius)
* New Type: __iptables_rule (Nico Schottelius)
* New Type: __iptables_apply (Nico Schottelius)
* Type __cdist: Also create home directory (Nico Schottelius)
* Type __cdist: Add support for --shell parameter (Nico Schottelius)
* Type __motd: Regenerate motd on Debian and Ubuntu (Nico Schottelius)
2.3.1: 2013-08-28
* Core: Support relative paths for configuration directories (Nico Schottelius)
* Core: Code cleanup (removed context class, added log class) (Nico Schottelius)
* Documentation: Add more best practises (Nico Schottelius)
* Documentation: Add troubleshooting chapter (Nico Schottelius)
* Type __key_value: Fix quoting problem (Steven Armstrong)
2.3.0: 2013-08-12
* Core: Added support for cdist shell (Nico Schottelius)
* Documentation: Improved some manpages (Nico Schottelius)
2.2.0: 2013-07-12
* Build: Cleanup the Makefile (Nico Schottelius)
* Type __package_opkg: Use shortcut version (Nico Schottelius)
* Core: Remove old pseudo object id "singleton" (Steven Armstrong)
2.1.2: 2013-07-09
* Build: Change clean-dist target to "distclean" (Nico Schottelius)
* Build: Moved a lot of build logic into Makefile for dependency resolution
* Core: Make global explorers available to initial manifest (Arkaitz Jimenez)
* Core: Change execution order to run object as one unit (Nico Schottelius)
* Documentation: Improved documentation (TomĂ¡Å¡ PospĂÅ¡ek)
* New Remote Example: Add support for sudo operations (Chase James)
* New Type: __update_alternatives (Nico Schottelius)
* New Type: __cdist (Nico Schottelius)
* Type __apt_ppa: Fix comparison operator (Tyler Akins)
* Type __start_on_boot: Archlinux changed to use systemd - adapt type (Nico Schottelius)
* Type __git: Missing quotes added (Chase James)
* Type __postgres_database: Make state parameter optional (Chase James)
* Type __postgres_role: Make state parameter optional, fix password bug (Chase James)
* Type __process: Make state parameter optional (Nico Schottelius)
* Type __cron: Simplyfied and syntax change (Nico Schottelius)
2.1.1: 2013-04-08
* Core: Use dynamic dependency resolver to allow indirect self dependencies (Nico Schottelius)
* Core: Remove umask call - protect /var/lib/cdist only (Arkaitz Jimenez)
* Explorer os: Added Slackware support (Eivind Uggedal)
* Type __git: Support mode and fix owner/group settings (contradict)
* Type __jail: State absent should implies stopped (Jake Guffey)
* Type __directory: Make stat call compatible with FreeBSD (Jake Guffey)
* Type __cron: Allow crontab without entries (Arkaitz Jimenez)
* Type __user: Add support for creating user home (Arkaitz Jimenez)
2.1.0: 2012-12-09
* Core: Ensure global explorers are executable (Nico Schottelius)
* Core: Ensure type explorers are executable (Steven Armstrong)
* New Type: __git (Nico Schottelius)
* New Type: __ssh_authorized_keys (Steven Armstrong)
* New Type: __user_groups (Steven Armstrong)
* Type __rvm_gemset: Change parameter "default" to be boolean (Nico Schottelius)
* Type __user: Remove --groups support (now provided by __user_groups)
* Type __apt_ppa: Bugfix: Installeded ppa detection (Steven Armstrong)
* Type __jail: Change optional parameter "started" to boolean "stopped" parameter,
change optional parameter "devfs-enable" to boolean "devfs-disable" parameter and
change optional parameter "onboot" to boolean. (Nico Schottelius)
* Type __package_pip: Bugfix: Installeded the package, not pyro (Nico Schottelius)
* Remove Type __ssh_authorized_key: Superseeded by __ssh_authorized_keys (Nico Schottelius)
* Support for CDIST_PATH (Steven Armstrong)
2.1.0pre8: 2012-11-15
* Type cleanup: __apt_ppa, __apt_ppa_update_index, __file,
__ssh_authorized_key, __timezone, all install types (Steven Armstrong)
* Types: Remove all parameter changing code (Nico Schottelius)
* Type __rvm_ruby: Change parameter "default" to be boolean (Nico Schottelius)
* Documentation: Web documentation clean up (Nico Schottelius)
2.1.0pre7: 2012-11-07
* Core: All unit tests restored back to working (Nico Schottelius)
* Core: Print error message when missing the initial manifest (Nico Schottelius)
2.1.0pre6: 2012-11-05
* New Example: Turn remote calls into local calls (used for unittesting) (Nico Schottelius)
* Core: Export PYTHONPATH, it's also needed by emulator (Nico Schottelius)
* Bugfix Type __rvm_ruby: Add clean package dependencies (Nico Schottelius)
* Bugfix Type __rvm_gem: Run rvm as user, not as root (Nico Schottelius)
* Cleanup Type __rvm, __rvm_gemset: Use shortcut version (Nico Schottelius)
* Bugfix __rvm_gemset: Correctly check for gemsets (Nico Schottelius)
* Cleanup Type __postgres_database, __postgres_role: Reference each other
in documentation (Nico Schottelius)
* Cleanp Type __postgres_role: Use boolean parameters where appropriate (Nico Schottelius)
* Cleanp Type __postgres_role: Use shortcut version (Nico Schottelius)
2.1.0pre5: 2012-11-01
* Core: First round of tests updated to work with multiple configuration directories (Nico Schottelius)
2.1.0pre4: 2012-10-31
* Dist: PyPi: Moved cdist.py to script/cdist to avoid double import (Nico Schottelius)
* Core: Added support for multiple configuration directories (no documentation) (Nico Schottelius)
2.1.0pre3: 2012-10-30
* Dist: PyPi: Types and explorer included as package data (Nico Schottelius)
2.1.0pre2: 2012-10-26
* Dist: PyPi: Add conf/ directory to distribution (Nico Schottelius)
* Dist: Initial support for archlinux packaging (Nico Schottelius)
2.1.0pre1: 2012-10-26
* Core: Removed obsolete variable __self (Nico Schottelius)
* Removed type __addifnosuchline (replaced by __line) (Nico Schottelius)
* Removed type __removeline (replaced by __line) (Nico Schottelius)
* Type __directory: Parameter --parents and --recursive are now boolean (Nico Schottelius)
* Type __package_apt, __package_luarocks, __package_opkg,
__package_pacman, __package_pkg_freebsd, __package_pkg_openbsd,
__package_rubygem, __package_yum, __process:
Parameter state accepts only "present" and "absent" (Nico Schottelius)
* Dist: Initial support for pypi packaging (Nico Schottelius)
2.0.15: 2012-11-02
* Core: Make variable __object_name available in type explorers (Steven Armtrong)
* New Type: __qemu_img (Nico Schottelius)
* New Type: __line (Nico Schottelius)
* New Type: __pf_apply (Jake Guffey)
* New Type: __pf_ruleset (Jake Guffey)
* Bugfix Type: __rvm: Make type work if rvm is already installed (Nico Schottelius)
2.0.14: 2012-09-07
* Bugfix Type: __jail: Use correct variable (Jake Guffey)
* Change Type: __jail: Parameter jailbase now optional (Jake Guffey)
* Bugfix Type: __user: Use passwd database on FreeBSD (Jake Guffey)
* Bugfix Type: __start_on_boot: Do not change parameters (Nico Schottelius)
* Feature __user: Added support for BSDs (Sébastien Gross)
* Feature __group: Added support for FreeBSD (Jake Guffey)
* New Type: __package_zypper (Nico Schottelius)
* Feature Types: Initial Support for SuSE Linux (Nico Schottelius)
2.0.13: 2012-06-05
* Bugfix __ssh_authorized_key: Ensure it sets proper group (contradict)
* Bugfix __addifnosuchline: Fixed quotes/interpolation bug ("a b" became "a b") (Nico Schottelius)
* New Explorer: interfaces (Sébastien Gross)
* Feature core: Support reading from stdin in types (Steven Armstrong)
* Feature core: Support multiple parameters for types (Steven Armstrong)
* Feature __file: Support reading from stdin with - syntax (Steven Armstrong)
2.0.12: 2012-05-29
* Core: Correctly raise error on Python < 3.2 (Steven Armtrong)
* Core: Add support for --remote-exec and --remote-copy parameters (Nico Schottelius)
* Documentation: Debian Squeeze hints (Sébastien Gross)
2.0.11: 2012-05-23
* Fix insecure file/directory creation: Use umask 077 (Nico Schottelius)
2.0.10: 2012-05-18
* Cleanup __group: No getent gshadow in old Redhat, use groupmod -g
(Matt Coddington)
* Bugfix __package_yum: Missing cat (Nico Schottelius)
* Bugfix __start_on_boot: Correctly use sed and quotes (Steven Armstrong)
* Feature __file: Support for --state exists (Steven Armstrong)
* Feature core: Make variable __manifest available to type manifests (Nico Schottelius)
* Feature core: Correct parent dependency handling (Steven Armstrong)
* Bugfix several types: Fix sed for FreeBSD (Istvan Beregszaszi)
* New Type: __jail (Jake Guffey)
* Change Type: __rvm*: --state present/absent not installed/remvoed (Evax Software)
* Bugfix Type: __cron: Hide error output from crontab (Nico Schottelius)
* Various smaller bugfixes (Chris Lamb)
2.0.9: 2012-03-12
* Cleanup documentation: Fix environment variable list to be properly
displayed (Giel van Schijndel)
* Cleanup documentation: Some minor corrections
* New Type: __package_opkg (Giel van Schijndel)
* New Type: __package_pkg_freebsd (Jake Guffey)
* New Type: __mysql_database (Benedikt Koeppel)
* Feature __package: Support for OpenWRT (Giel van Schijndel)
* Feature __start_on_boot: Support for OpenWRT (Giel van Schijndel)
* Feature __start_on_boot: Support for Amazon Linux (Matt Coddington)
* New Example: Use rsync to backup files (Matt Coddington)
* Feature core: Exit non-zero, if configuration failed (Nico Schottelius)
* Documentation: Describe how to do templating (Aurélien Bondis)
2.0.8: 2012-02-20
* Bugfix core: Remove another nasty traceback when sending SIGINT (aka Ctrl-C) (Nico Schottelius)
* Cleanup: Better hint to source of error (Nico Schottelius)
* Cleanup: Do not output failing script, but path to script only (Nico Schottelius)
* Cleanup: Remove support for __debug variable in manifests (Type != Core
debugging) (Nico Schottelius)
* Cleanup: Change __package_* to support absent/present (default state
name now). The values removed/installed will be removed in cdist 2.1. (Nico Schottelius)
* Cleanup: Change __process to support absent/present (default state
name now). The values running/stopped will be removed in cdist 2.1. (Nico Schottelius)
* Feature Core: Support boolean parameters (Steven Armstrong)
2.0.7: 2012-02-13
* Bugfix __file: Use chmod after chown/chgrp (Matt Coddington)
* Bugfix __user: Correct shadow field in explorer (Matt Coddington)
* Bugfix __link: Properly handle existing links (Steven Armstrong)
* Bugfix __key_value: More robust implementation (Steven Armstrong)
* Bugfix __user: Fix for changing a user's group by name (Matt Coddington)
* New Type: __package_pip (Nico Schottelius)
* Bugfix/Cleanup: Correctly allow Object ID to start and end with /, but
not contain //. (Nico Schottelius)
2.0.6: 2012-01-28
* Bugfix __apt_ppa:
Also remove the [ppa-name].list file, if empty. (Tim Kersten)
* Bugfix __group:
Referenced wrong variable name (Matt Coddington)
* Feature __package_apt:
Initial support for virtual packages (Evax Software)
* Feature Core: Added new dependency resolver (Steven Armstrong)
* Feature Explorer, __package_yum: Support Amazon Linux (Matt Coddington)
* New Type: __rvm (Evax Software)
* New Type: __rvm_gem (Evax Software)
* New Type: __rvm_gemset (Evax Software)
* New Type: __rvm_ruby (Evax Software)
2.0.5: 2012-01-18
* Bugfix __key_value: Use correct delimiters
(Steven Armstrong, Daniel Maher)
* Cleanup: Explicitly require Python >= 3.2 (do not fail implicitly) (Nico Schottelius)
* Documentation: (Re)write of the tutorial (Nico Schottelius)
* Feature: __addifnosuchline supports matching on
regular expressions (Daniel Maher)
* Feature: __directory, __file, __link:
Add --state parameter (Steven Armstrong)
* New Type: __package_luarocks (Christian G. Warden)
* New Type: __cdistmarker (Daniel Maher)
2.0.4: 2011-11-18
* Bugfix core: Remove traceback when sending SIGINT (aka Ctrl-C) (Nico Schottelius)
* Bugfix core: Accept parameters with - in the name (Steven Armstrong)
* Cleanup: __object_fq variable removed (never used) (Nico Schottelius)
* Cleanup: Environment variable __self DEPRECATED, use __object_name instead (Nico Schottelius)
* Cleanup: Environment variable __self scheduled for removal in cdist 2.1 (Nico Schottelius)
* Documentation: Many examples for use of __remote_* (Steven Armstrong)
* Feature: Automatically require all used objects (Steven Armstrong)
* New Type: __cron (Steven Armstrong)
2.0.3: 2011-10-18
* Improved logging, added --verbose, by more quiet by default
* Bugfix __user: Correct quoting (Steven Armstrong)
* Bugfix __addifnosuchline: Falsely exited (Nico Schottelius)
* Bugfix requirements: Restore original require="" behaviour (Nico Schottelius)
* Feature requirements: Check for broken object_ids and abort (Nico Schottelius)
* Massive refactoring and unittesting introduced (Steven Armstrong)
2.0.2: 2011-09-27
* Add support for detection of OpenWall Linux (Matthias Teege)
* Add support for __debug variable in manifests (Nico Schottelius)
* Bugfix core: Various issues with type emulator (Nico Schottelius)
2.0.1: 2011-09-23
* Bugfix core: Always print source of error in case of exec errors (Nico Schottelius)
* Bugfix core: Various smaller bugs in string concatenation (Nico Schottelius)
* Feature: Add marker "changed" to changed objects (Nico Schottelius)
2.0.0: 2011-09-16
* New Type: __package_rubygem (Chase Allen James)
* __self replaced by __object_fq (Nico Schottelius)
* Rewrote cdist in Python (Nico Schottelius)
1.7.1: 2011-07-26
* Documentation: Add explorers to reference (Nico Schottelius)
* Documentation: Typo cleanup (Derek Brost)
* Type __key_value: Bugfix (Steven Armstrong)
* New Type: __postgres_role (Steven Armstrong)
* New Type: __postgres_database (Steven Armstrong)
1.7.0: 2011-05-10
* Bugfix type __package_yum: Fix redhat support (Ramon SalvadĂ³)
* Improved type __package_yum: Add centos support (Ramon SalvadĂ³)
* New Type: __timezone (Ramon SalvadĂ³)
* Renamed explorer: hardware_type to machine (Nico Schottelius)
* Core: Do not execute empty code fragments (Nico Schottelius)
1.6.2: 2011-04-19
* Core: Introduce __cdist_tmp_base_dir (Nico Schottelius)
* Core: Cleanup and enhance cdist-type-template (Nico Schottelius)
* Core: cdist-mass-deploy: Report failed cdist-deploy-to instances (Nico Schottelius)
* New Type: __ssh_authorized_key (Aurélien Bondis)
1.6.1: 2011-04-07
* Improved logging: Show code responsible for abort (Nico Schottelius)
* Improved logging: Consistently prefix with current object or core (Nico Schottelius)
* Bugfix: Type __debconf_set_selections used wrong contens for selection (Nico Schottelius)
* Bugfix: Don't fail, if cache directory is not existing (Nico Schottelius)
* Bugfix: __user and __group exited non-zero if no change was necessary (Nico Schottelius)
* New Explorer: hardware_type (Nico Schottelius)
* New Type: __package_pkg_openbsd (Andi Brönnimann)
* New Type: __autofs_map (Steven Armstrong)
* New Type: __autofs_master (Steven Armstrong)
1.6.0: 2011-04-06
* New Type: __package_yum (Nico Schottelius)
* New type: __debconf_set_selections (Nico Schottelius)
* New explorer: os_version (Nico Schottelius)
* Bugfix: Type __group failed in case of __group NAME syntax (Nico Schottelius)
* Bugfix: __package* types: consistently name --state removed instead of
uninstalled or deinstalled (Nico Schottelius)
* Type __package: Added Fedora support (Nico Schottelius)
* Type __package_apt: Removed --preseed support (Nico Schottelius)
* Explorer os gained Fedora support (Nico Schottelius)
* Simplified types __user and __group (Nico Schottelius)
* New helper binary: cdist-mass-deploy (Nico Schottelius)
1.5.0: 2011-04-01
* Add basic cache functionality (Nico Schottelius)
* New type: __process (Nico Schottelius)
* Restructured execution: (Steven Armstrong)
Orientate processing on objects, resolve dependencies and
ensure correct execution order.
* Documentation: Rewrite stages docs (Steven Armstrong)
* Documentation: Remove legacy man pages (Steven Armstrong)
1.4.1: 2011-03-25
* New type: __key_value (Steven Armstrong)
* New type: __apt_ppa (Steven Armstrong)
* Documentation: Manpage generation cleanup (Nico Schottelius)
* Documentation: Manpage fix for __apt_ppa
1.4.0: 2011-03-24
* Add --recursive to __directory (Nico Schottelius)
* Move cdist generated stuff to .cdist of an object (Nico Schottelius)
* Allow objects to be redefined (Nico Schottelius)
1.3.2: 2011-03-21
* Add --source to __motd (Nico Schottelius)
* Add --preseed to __package_apt (Nico Schottelius)
* Include HTML documentation of manpages and publish them (Nico Schottelius)
1.3.1: 2011-03-21
* Document: cdist-type-build-emulation (Nico Schottelius)
* Document: cdist-type-emulator (Nico Schottelius)
* Document: cdist-remote-explorer-run (Nico Schottelius)
* Fix dependencies in cdist-code-run (Nico Schottelius)
* Fix dependencies in cdist-manifest-run-all (Nico Schottelius)
* Add --source to __issue and fix os check (Nico Schottelius)
1.3.0: 2011-03-20
* Add support for local and remote code generation and execution (Nico Schottelius)
* Bugfix: Remove obsolete $@ call in cdist-remote-explorer-run (Nico Schottelius)
* Bugfix: Correct manpage for __removeline (broke manpage generation) (Nico Schottelius)
1.2.0: 2011-03-19
* Added dependencies (see cdist-type(7)) (Nico Schottelius)
* New type: __removeline (Daniel Roth)
* New type: __group (Steven Armstrong)
* New type: __user (Steven Armstrong)
* Documentation: cdist-run-remote (Nico Schottelius)
* Documentation: cdist-code-run-all (Nico Schottelius)
* Documentation: cdist-object-gencode (Nico Schottelius)
* Documentation: cdist-explorer-run-global (Nico Schottelius)
* Documentation: cdist-manifest-run-init (Nico Schottelius)
* Documentation: cdist-manifest-run-all (Nico Schottelius)
* Documentation: cdist-object-gencode-all (Nico Schottelius)
* Documentation: cdist-manifest-run (Nico Schottelius)
1.1.0: 2011-03-16
* Replace type __file with __file, __directory, __link (Nico Schottelius)
* Documentation: cdist-env (Nico Schottelius)
* Documentation: cdist-config (Nico Schottelius)
* Documentation: cdist-dir (Nico Schottelius)
* Documentation: cdist-quickstart (Nico Schottelius)
1.0.4: 2011-03-15
* New type: __motd (Nico Schottelius)
* New type: __addifnosuchline (Daniel Roth)
* New type: __user (Nico Schottelius)
* Document type: __issue (Nico Schottelius)
* Document type: __package (Nico Schottelius)
* Document type: __package_pacman (Nico Schottelius)
* Document type: __package_apt (Nico Schottelius)
* New parameter for __file: --owner and --group (Nico Schottelius)
1.0.3: 2011-03-11
* Update regexp used for sane characters (Nico Schottelius)
* Allow types without parameters (Nico Schottelius)
* Allow type to be singleton (Nico Schottelius)
* Type __file learned --type symlink (Nico Schottelius)
1.0.2: 2011-03-09
* Add manpages: cdist-type, cdist-type__file, cdist-reference, cdist-explorer (Nico Schottelius)
* Make doc/man/ usable as MANPATH entry (Nico Schottelius)
1.0.1: 2011-03-08
* Added cdist-type-template including manpage (Nico Schottelius)
* Fix manpage building (Nico Schottelius)
* Add new manpages: cdist-stages, cdist-bin-transfer (Nico Schottelius)
1.0.0: 2011-03-07
* Initial release (Nico Schottelius)
cdist-6.0.2/docs/dev/ 000755 001751 001751 00000000000 13552030341 014573 5 ustar 00darko darko 000000 000000 cdist-6.0.2/docs/gfx/ 000755 001751 001751 00000000000 13552030341 014601 5 ustar 00darko darko 000000 000000 cdist-6.0.2/docs/legal/ 000755 001751 001751 00000000000 13552030341 015101 5 ustar 00darko darko 000000 000000 cdist-6.0.2/docs/src/ 000755 001751 001751 00000000000 13552030341 014604 5 ustar 00darko darko 000000 000000 cdist-6.0.2/docs/src/Makefile 000644 001751 001751 00000020166 13552030341 016251 0 ustar 00darko darko 000000 000000 # Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../dist
# for cache, etc.
_BUILDDIR = _build
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/)
endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(_BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help
help:
@echo "Please use \`make ' where is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " epub3 to make an epub3"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"
@echo " dummy to check syntax errors of document sources"
.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*
rm -rf $(_BUILDDIR)/*
.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
.PHONY: json
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: qthelp
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/cdist-docs.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/cdist-docs.qhc"
.PHONY: applehelp
applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
@echo
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
@echo "N.B. You won't be able to view it unless you put it in" \
"~/Library/Documentation/Help or install it in your application" \
"bundle."
.PHONY: devhelp
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/cdist-docs"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/cdist-docs"
@echo "# devhelp"
.PHONY: epub
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: epub3
epub3:
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
@echo
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
.PHONY: latex
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: latexpdfja
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: text
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
man:
$(SPHINXBUILD) -b cman $(ALLSPHINXOPTS) $(BUILDDIR)/man
mkdir -p $(BUILDDIR)/man/man1
mkdir -p $(BUILDDIR)/man/man7
mv -f $(BUILDDIR)/man/*.1 $(BUILDDIR)/man/man1/
mv -f $(BUILDDIR)/man/*.7 $(BUILDDIR)/man/man7/
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: coverage
coverage:
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
@echo "Testing of coverage in the sources finished, look at the " \
"results in $(BUILDDIR)/coverage/python.txt."
.PHONY: xml
xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
.PHONY: pseudoxml
pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
.PHONY: dummy
dummy:
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
@echo
@echo "Build finished. Dummy builder generates no files."
cdist-6.0.2/docs/src/_static/ 000755 001751 001751 00000000000 13552030341 016232 5 ustar 00darko darko 000000 000000 cdist-6.0.2/docs/src/cdist-best-practice.rst 000644 001751 001751 00000024706 13552030341 021200 0 ustar 00darko darko 000000 000000 Best practice
=============
Practices used in real environments
Passwordless connections
------------------------
It is recommended to run cdist with public key authentication.
This requires a private/public key pair and the entry
"PermitRootLogin without-password" in the sshd server.
See sshd_config(5) and ssh-keygen(1).
Speeding up ssh connections
---------------------------
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 "sharing of multiple sessions over a single
network connection" (quote from ssh_config(5)). This is also called "connection
multiplexing".
Cdist implements this since v4.0.0 by executing ssh with the appropriate
options (`-o ControlMaster=auto -o ControlPath=/tmp//s -o
ControlPersist=2h`).
Note that the sshd_config on the server can configure the maximum number of
parallel multiplexed connections this with `MaxSessions N` (N defaults to 10
for OpenSSH v7.4).
Speeding up shell execution
----------------------------
On the source host, ensure that /bin/sh is *not* bash: bash is quite slow for
script execution. Instead, you could use dash after installing it::
ln -sf /bin/dash /bin/sh
Multi master or environment setups
----------------------------------
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::
# Go to cdist checkout
cd /path/to/cdist
# Create branches
git branch development
git branch integration
git branch production
# Make use of a branch, for instance production
git checkout production
Similar if you want to have cdist checked out at multiple machines,
you can clone it multiple times::
machine-a % git clone git://your-git-server/cdist
machine-b % git clone git://your-git-server/cdist
Separating work by groups
-------------------------
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
**conf/manifests/init**::
# Include other groups
sh -e "$__manifest/systems"
sh -e "$__manifest/cbrg"
Maintaining multiple configurations
-----------------------------------
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::
# create branches
git branch company_a company_b common private
# make stuff for company a
git checkout company_a
# work, commit, etc.
# make stuff for company b
git checkout company_b
# work, commit, etc.
# make stuff relevant for all sites
git checkout common
# work, commit, etc.
# change to private and include latest common stuff
git checkout private
git merge common
The following **.git/config** is taken from a real world scenario::
# Track upstream, merge from time to time
[remote "upstream"]
url = git://git.schottelius.org/cdist
fetch = +refs/heads/*:refs/remotes/upstream/*
# Same as upstream, but works when being offline
[remote "local"]
fetch = +refs/heads/*:refs/remotes/local/*
url = /home/users/nico/p/cdist
# Remote containing various ETH internal branches
[remote "eth"]
url = sans.ethz.ch:/home/services/sans/git/cdist-eth
fetch = +refs/heads/*:refs/remotes/eth/*
# Public remote that contains my private changes to cdist upstream
[remote "nico"]
url = git.schottelius.org:/home/services/git/cdist-nico
fetch = +refs/heads/*:refs/remotes/nico/*
# The "nico" branch will be synced with the remote nico, branch master
[branch "nico"]
remote = nico
merge = refs/heads/master
# ETH stable contains rock solid configurations used in various places
[branch "eth-stable"]
remote = eth
merge = refs/heads/stable
Have a look at git-remote(1) to adjust the remote configuration, which allows
Multiple developers with different trust
----------------------------------------
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:
- Create a dedicated user (for instance **cdist**)
- Setup the ssh-pubkey for this user that has the right to configure all hosts
- Create a wrapper to update the cdist configuration in ~cdist/cdist
- Allow every developer to execute this script via sudo as the user cdist
- Allow run of cdist as user cdist on specific hosts on a per user/group basis.
- f.i. nico ALL=(ALL) NOPASSWD: /home/cdist/bin/cdist config hostabc
For more details consult sudoers(5)
Templating
----------
* create directory files/ in your type (convention)
* create the template as an executable file like files/basic.conf.sh, it will output text using shell variables for the values
.. code-block:: sh
#!/bin/sh
# in the template, use cat << eof (here document) to output the text
# and use standard shell variables in the template
# output everything in the template script to stdout
cat << EOF
server {
listen 80;
server_name $SERVERNAME;
root $ROOT;
access_log /var/log/nginx/$SERVERNAME_access.log
error_log /var/log/nginx/$SERVERNAME_error.log
}
EOF
* in the manifest, export the relevant variables and add the following lines to your manifest:
.. code-block:: console
# export variables needed for the template
export SERVERNAME='test"
export ROOT='/var/www/test'
# render the template
mkdir -p "$__object/files"
"$__type/files/basic.conf.sh" > "$__object/files/basic.conf"
# send the rendered template
__file /etc/nginx/sites-available/test.conf \
--state present
--source "$__object/files/basic.conf"
Testing a new type
------------------
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:
.. code-block:: sh
# Singleton type without parameter
echo __ungleich_munin_server | cdist --initial-manifest - munin.panter.ch
# Singleton type with parameter
echo __ungleich_munin_node --allow 1.2.3.4 | \
cdist --initial-manifest - rails-19.panter.ch
# Normal type
echo __file /tmp/stdintest --mode 0644 | \
cdist --initial-manifest - cdist-dev-01.ungleich.ch
Other content in cdist repository
---------------------------------
Usually the cdist repository contains all configuration
items. Sometimes you may have additional resources that
you would like to store in your central configuration
repository (like password files from KeepassX,
Libreoffice diagrams, etc.).
It is recommended to use a subfolder named "non-cdist"
in the repository for such content: It allows you to
easily distinguish what is used by cdist and what is not
and also to store all important files in one
repository.
Perils of CDIST_ORDER_DEPENDENCY
--------------------------------
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.
It essentially helps you to build up blocks of code that build upon each other
(like first creating the directory xyz than the file below the directory).
This can be helpful, but it can also be the source of *evil*.
CDIST_ORDER_DEPENDENCY easily causes unobvious dependency cycles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Let's see an example. Suppose you have special init manifest where among other
things you are assuring that remote host has packages `sudo` and `curl`
installed.
**init1**
.. code-block:: sh
CDIST_ORDER_DEPENDENCY=1
export CDIST_ORDER_DEPENDENCY
for p in sudo curl
do
__package "${p}"
done
Then you have some other special init manifest where among other things you are
assuring `sudo` package is installed.
**init2**
.. code-block:: sh
CDIST_ORDER_DEPENDENCY=1
export CDIST_ORDER_DEPENDENCY
__package sudo
Then you have third init manifest where you combine those two init manifests,
by including them:
**init**
.. code-block:: sh
sh -e "$__manifest/init1"
sh -e "$__manifest/init2"
The resulting init manifest is then equal to:
.. code-block:: sh
CDIST_ORDER_DEPENDENCY=1
export CDIST_ORDER_DEPENDENCY
for p in sudo curl
do
__package "${p}"
done
CDIST_ORDER_DEPENDENCY=1
export CDIST_ORDER_DEPENDENCY
__package sudo
In the end you get the following dependencies:
* `__package/curl` depends on `__package/sudo`
* `__package/sudo` depends on `__package/curl`
And here you have a circular dependency!
In the real world manifest can be quite complex, dependencies can become
complicated and circual dependencies are not so obvious. Resolving it can
become cumbersome.
**Practical solution?**
Instead of managing complex init manifests you can write custom types.
Each custom type can do one thing, it has well defined dependencies that will
not leak into init manifest. In custom type you can also add special explorers
and gencode.
Then, in init manifest you combine your complex types. It is:
* cleaner
* easier to follow
* easier to maintain
* easier to debug.
CDIST_ORDER_DEPENDENCY kills parallelization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose you have defined CDIST_ORDER_DEPENDENCY and then, among other things,
you specify creation of three, by nature independent, files.
**init**
.. code-block:: sh
CDIST_ORDER_DEPENDENCY=1
export CDIST_ORDER_DEPENDENCY
...
__file /tmp/file1
__file /tmp/file2
__file /tmp/file3
...
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:
**init**
.. code-block:: sh
CDIST_ORDER_DEPENDENCY=1
export CDIST_ORDER_DEPENDENCY
...
unset CDIST_ORDER_DEPENDENCY
__file /tmp/file1
__file /tmp/file2
__file /tmp/file3
CDIST_ORDER_DEPENDENCY=1
export CDIST_ORDER_DEPENDENCY
...
unset CDIST_ORDER_DEPENDENCY
cdist-6.0.2/docs/src/cdist-bootstrap.rst 000644 001751 001751 00000010717 13552030341 020465 0 ustar 00darko darko 000000 000000 Bootstrap
=========
This document describes the usual steps recommended for a new
cdist setup. It is recommended that you have read and understood
`cdist quickstart `_ before digging into this.
Location
---------
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
location.
For starters, having cdist (which includes the configuration database) on
your notebook should be fine.
Additionally an external copy of the git repository the configuration
relies on is recommended, for use as backup as well as to allow easy collaboration
with others.
For more sophisticated setups developing cdist configurations with multiple
people, have a look at `cdist best practice `_.
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 `_ if you don't).
Entering the command "git branch" should show you "* master", which indicates
you are on the **master** branch.
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 **git branch -r**
to list all branches::
cdist% git branch -r
origin/1.0
origin/1.1
origin/1.2
origin/1.3
origin/1.4
origin/1.5
origin/1.6
origin/1.7
origin/2.0
origin/HEAD -> origin/master
origin/archive_shell_function_approach
origin/master
So **2.0** is the latest version branch in this example.
All versions (2.0.x) within one version branch (2.0) are compatible to each
other and won't break your configuration when updating.
It's up to you to decide which branch you want to base your own work on:
master contains more recent changes, newer types, but may also break.
The version branches are stable, but may lack the latest features.
Your decision can be changed later on, but may result in merge conflicts,
which you will need to solve.
Let's assume you want latest stuff and select the master branch as base for
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.
In this tutorial I use the branch **mycompany**::
cdist% git checkout -b mycompany origin/master
Branch mycompany set up to track remote branch master from origin.
Switched to a new branch 'mycompany'
cdist-user% git branch
master
* mycompany
From now on, you can use git as usual to commit your changes in your own branch.
Publishing the configuration
----------------------------
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::
# Create bare git repository on the host named "loch"
cdist% ssh loch "GIT_DIR=/home/nutzer/cdist git init"
Initialized empty Git repository in /home/nutzer/cdist/
# Add remote git repo to git config
cdist% git remote add loch loch:/home/nutzer/cdist
# Configure the mycompany branch to push to loch
cdist% git config branch.mycompany.remote loch
# Configure mycompany branch to push into remote master branch
cdist% git config branch.mycompany.merge refs/heads/master
# Push mycompany branch to remote branch master initially
cdist% git push loch mycompany:refs/heads/master
Now you have setup the git repository to synchronise the **mycompany**
branch with the **master** branch on the host **loch**. Thus you can commit
as usual in your branch and push out changes by entering **git push**.
Updating from origin
--------------------
Whenever you want to update your cdist installation, you can use git to do so::
# Update git repository with latest changes from origin
cdist% git fetch origin
# Update current branch with master branch from origin
cdist% git merge origin/master
# Alternative: Update current branch with 2.0 branch from origin
cdist% git merge origin/2.0
cdist-6.0.2/docs/src/cdist-cache.rst 000644 001751 001751 00000004760 13552030341 017514 0 ustar 00darko darko 000000 000000 Local cache overview
====================
Description
-----------
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
debugging after host configuration fails.
Local cache is saved under $HOME/.cdist/cache directory, one directory entry
for each host. Subdirectory path is specified by
:strong:`-C/--cache-path-pattern` option, :strong:`cache_path_pattern`
configuration option or by using :strong:`CDIST_CACHE_PATH_PATTERN`
environment variable.
For more info on cache path pattern see :strong:`CACHE PATH PATTERN FORMAT`
section in cdist man page.
Cache overview
--------------
As noted above each configured host has got its subdirectory in local cache.
Entries in host's cache directory are as follows.
bin
directory with cdist type emulators
conf
dynamically determined cdist conf directory, union of all specified
conf directories
explorer
directory containing global explorer named files containing explorer output
after running on target host
messages
file containing messages
object
directory containing subdirectory for each cdist object
object_marker
object marker for this particular cdist run
stderr
directory containing init manifest and remote stderr stream output
stdout
directory containing init manifest and remote stdout stream output
target_host
file containing target host of this cdist run, as specified when running
cdist
typeorder
file containing types in order of execution.
Object cache overview
~~~~~~~~~~~~~~~~~~~~~
Each object under :strong:`object` directory has its own structurue.
code-local
code generated from gencode-local, present only if something is
generated
code-remote
code generated from gencode-remote, present only if something is
generated
explorer
directory containing type explorer named files containing explorer output
after running on target host
files
directory with object files created during type execution
parameter
directory containing type parameter named files containing parameter
values
source
this type's source (init manifest)
state
this type execution state ('done' when finished)
stderr
directory containing type's manifest, gencode-* and code-* stderr stream
outputs
stdin
this type stdin content
stdout
directory containing type's manifest, gencode-* and code-* stdout stream
outputs.
cdist-6.0.2/docs/src/cdist-configuration.rst 000644 001751 001751 00000007107 13552030341 021316 0 ustar 00darko darko 000000 000000 Configuration
=============
Description
-----------
cdist obtains configuration data from the following sources in the following
order:
#. command-line options
#. configuration file specified at command-line using -g command line option
#. configuration file specified in CDIST_CONFIG_FILE environment variable
#. environment variables
#. user's configuration file (first one found of ~/.cdist.cfg, $XDG_CONFIG_HOME/cdist/cdist.cfg, in specified order)
#. in-distribution configuration file (cdist/conf/cdist.cfg)
#. system-wide configuration file (/etc/cdist.cfg)
if one exists.
Configuration source with lower ordering number from above has a higher
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
~/.cdist.cfg or $XDG_CONFIG_HOME/cdist/cdist.cfg. Note that, if both exist,
then ~/.cdist.cfg is used.
For a per-project configuration, particular environment variables or better,
CDIST_CONFIG_FILE environment variable or -g CONFIG_FILE command line option,
can be used.
Config file format
------------------
cdist configuration file is in the INI file format. Currently it supports
only [GLOBAL] section.
The possible keywords and their meanings are as follows:
:strong:`archiving`
Use specified archiving. Valid values include:
'none', 'tar', 'tgz', 'tbz2' and 'txz'.
:strong:`beta`
Enable beta functionality. It recognizes boolean values from
'yes'/'no', 'on'/'off', 'true'/'false' and '1'/'0'.
:strong:`cache_path_pattern`
Specify cache path pattern.
: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),
such as ':' for POSIX or ';' for Windows.
If also specified at command line then values from command line are
appended to this value.
:strong:`init_manifest`
Specify default initial manifest.
:strong:`inventory_dir`
Specify inventory directory.
:strong:`jobs`
Specify number of jobs for parallel processing. If -1 then the default,
number of CPU's in the system is used. If 0 then parallel processing in
jobs is disabled. If set to positive number then specified maximum
number of processes will be used.
:strong:`local_shell`
Shell command used for local execution.
:strong:`out_path`
Directory to save cdist output in.
:strong:`parallel`
Process hosts in parallel. If -1 then the default, number of CPU's in
the system is used. If 0 then parallel processing of hosts is disabled.
If set to positive number then specified maximum number of processes
will be used.
:strong:`remote_copy`
Command to use for remote copy (should behave like scp).
:strong:`remote_exec`
Command to use for remote execution (should behave like ssh).
:strong:`remote_out_path`
Directory to save cdist output in on the target host.
:strong:`remote_shell`
Shell command at remote host used for remote execution.
:strong:`save_output_streams`
Enable/disable saving output streams (enabled by default).
It recognizes boolean values from 'yes'/'no', 'on'/'off', 'true'/'false'
and '1'/'0'.
:strong:`timestamp`
Timestamp log messages with the current local date and time
in the format: YYYYMMDDHHMMSS.us.
:strong:`verbosity`
Set verbosity level. Valid values are:
'ERROR', 'WARNING', 'INFO', 'VERBOSE', 'DEBUG', 'TRACE' and 'OFF'.
cdist-6.0.2/docs/src/cdist-explorer.rst 000644 001751 001751 00000002731 13552030341 020305 0 ustar 00darko darko 000000 000000 Explorer
========
Description
-----------
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
a one liner, but may be empty or multi line especially in the case of
type explorers.
There are general explorers, which are run in an early stage, and
type explorers. Both work almost exactly the same way, with the difference
that the values of the general explorers are stored in a general location and
the type specific below the object.
Explorers can reuse other explorers on the target system by calling
::
$__explorer/ (general and type explorer)
or
::
$__type_explorer/ (type explorer).
In case of significant errors, the explorer may exit non-zero and return an
error message on stderr, which will cause cdist to abort.
You can also use stderr for debugging purposes while developing a new
explorer.
Examples
--------
A very simple explorer may look like this::
hostname
Which is in practise the **hostname** explorer.
A type explorer, which could check for the status of a package may look like this:
.. code-block:: sh
if [ -f "$__object/parameter/name" ]; then
name="$(cat "$__object/parameter/name")"
else
name="$__object_id"
fi
# Expect dpkg failing, if package is not known / installed
dpkg -s "$name" 2>/dev/null || exit 0
cdist-6.0.2/docs/src/cdist-features.rst 000644 001751 001751 00000002775 13552030341 020273 0 ustar 00darko darko 000000 000000 Features
========
But cdist ticks differently, here is the feature set that makes it unique:
Simplicity
There is only one type to extend cdist called **type**
Design
+ Type and core cleanly separated
+ Sticks completely to the KISS (keep it simple and stupid) paradigm
+ Meaningful error messages - do not lose time debugging error messages
+ Consistency in behaviour, naming and documentation
+ No surprise factor: Only do what is obviously clear, no magic
+ Define target state, do not focus on methods or scripts
+ Push architecture: Instantly apply your changes
Small core
cdist's core is very small - less code, less bugs
Fast development
Focus on straightforwardness of type creation is a main development objective
Batteries included: A lot of requirements can be solved using standard types
Modern Programming Language
cdist is written in Python
Requirements, Scalability
No central server needed, cdist operates in push mode and can be run from any computer
Requirements, Scalability, Upgrade
cdist only needs to be updated on the master, not on the target hosts
Requirements, Security
Uses well-know `SSH `_ as transport protocol
Requirements, Simplicity
Requires only shell and SSH server on the target
UNIX
Reuse of existing tools like cat, find, mv, ...
UNIX, familiar environment, documentation
Is available as manpages and HTML
UNIX, simplicity, familiar environment
cdist is configured in POSIX shell
cdist-6.0.2/docs/src/cdist-hacker.rst 000644 001751 001751 00000011355 13552030341 017704 0 ustar 00darko darko 000000 000000 Hacking
=======
Welcome
-------
Welcome dear hacker! I invite you to a tour of pointers to
get into the usable configuration management system, cdist.
The first thing to know is probably that cdist is brought to
you by people who care about how code looks like and who think
twice before merging or implementing a feature: Less features
with good usability are far better than the opposite.
Reporting bugs
--------------
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 "[BUG] " or create an issue on code.ungleich.ch.
Coding conventions (everywhere)
-------------------------------
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.
Indentation is 4 spaces (welcome to the python world).
How to submit stuff for inclusion into upstream cdist
-----------------------------------------------------
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.
There are some requirements to ensure your changes don't break other peoples
work nor kill the authors brain:
- All files should contain the usual header (Author, Copying, etc.)
- Code submission must be done via git
- Do not add cdist/conf/manifest/init - This file should only be touched in your
private branch!
- Code to be included should be branched of the upstream "master" branch
- Exception: Bugfixes to a version branch
- On a merge request, always name the branch I should pull from
- Always ensure **all** manpages build. Use **./build man** to test.
- If you developed more than **one** feature, consider submitting them in
separate branches. This way one feature can already be included, even if
the other needs to be improved.
As soon as your work meets these requirements, write a mail
for inclusion to the mailinglist **cdist-configuration-management at googlegroups.com**
or open a merge request at https://code.ungleich.ch/ungleich-public/cdist.
How to submit a new type
------------------------
For detailed information about types, see `cdist type `_.
Submitting a type works as described above, with the additional requirement
that a corresponding manpage named man.rst in ReSTructured text format with
the manpage-name "cdist-type__NAME" is included in the type directory
AND the manpage builds (`make man`).
Warning: Submitting "exec" or "run" types that simply echo their parameter in
**gencode** will not be accepted, because they are of no use. Every type can output
code and thus such a type introduces redundant functionality that is given by
core cdist already.
Example git workflow
---------------------
The following workflow works fine for most developers
.. code-block:: sh
# get latest upstream master branch
git clone https://code.ungleich.ch/ungleich-public/cdist.git
# update if already existing
cd cdist; git fetch -v; git merge origin/master
# create a new branch for your feature/bugfix
cd cdist # if you haven't done before
git checkout -b documentation_cleanup
# *hack*
*hack*
# clone the cdist repository on code.ungleich.ch if you haven't done so
# configure your repo to know about your clone (only once)
git remote add ungleich git@code.ungleich.ch:YOURUSERNAME/cdist.git
# push the new branch to ungleich gitlab
git push ungleich documentation_cleanup
# (or everything)
git push --mirror ungleich
# create a merge request at ungleich gitlab (use a browser)
# *fixthingsbecausequalityassurancefoundissuesinourpatch*
*hack*
# push code to ungleich gitlab again
git push ... # like above
# add comment that everything should be green now (use a browser)
# go back to master branch
git checkout master
# update master branch that includes your changes now
git fetch -v origin
git diff master..origin/master
git merge origin/master
If at any point you want to go back to the original master branch, you can
use **git stash** to stash your changes away::
.. code-block:: sh
# assume you are on documentation_cleanup
git stash
# change to master and update to most recent upstream version
git checkout master
git fetch -v origin
git merge origin/master
Similarly when you want to develop another new feature, you go back
to the master branch and create another branch based on it::
.. code-block:: sh
# change to master and update to most recent upstream version
git checkout master
git fetch -v origin
git merge origin/master
git checkout -b another_feature
(you can repeat the code above for as many features as you want to develop
in parallel)
cdist-6.0.2/docs/src/cdist-install.rst 000644 001751 001751 00000006715 13552030341 020121 0 ustar 00darko darko 000000 000000 How to install cdist
====================
Requirements
-------------
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
* 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)
* SSH server
Install cdist
-------------
You can install cdist either from git or as a python package.
From git
~~~~~~~~
Cloning cdist from git gives you the advantage of having
a version control in place for development of your own stuff
immediately.
To install cdist, execute the following commands:
.. code-block:: sh
git clone https://code.ungleich.ch/ungleich-public/cdist.git
cd cdist
export PATH=$PATH:$(pwd -P)/bin
From version 4.2.0 cdist tags and releases are signed.
You can get GPG public key used for signing `here <_static/pgp-key-EFD2AE4EC36B6901.asc>`_.
You can also get cdist from `github mirror `_.
To install cdist with distutils from cloned repository, first you have to
create version.py:
.. code-block:: sh
./bin/build-helper version
Then you install it with:
.. code-block:: sh
make install
or with:
.. code-block:: sh
make install-user
to install it into user *site-packages* directory.
Or directly with distutils:
.. code-block:: sh
python setup.py install
Note that `bin/build-helper` script is intended for cdist maintainers.
Available versions in git
^^^^^^^^^^^^^^^^^^^^^^^^^
* The active development takes place in the **master** branch
* The released versions can be found in the tags
Other branches may be available for features or bugfixes, but they
may vanish at any point. To select a specific branch use
.. code-block:: sh
# Generic code
git checkout -b origin/
So for instance if you want to use and stay with version 4.1, you can use
.. code-block:: sh
git checkout -b 4.1 origin/4.1
Building and using documentation (man and html)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to build and use the documentation, run:
.. code-block:: sh
make docs
Documentation comes in two formats, man pages and full HTML
documentation. Documentation is built into distribution's
docs/dist directory. man pages are in docs/dist/man and
HTML documentation in docs/dist/html.
If you want to use man pages, run:
.. code-block:: sh
export MANPATH=$MANPATH:$(pwd -P)/docs/dist/man
Or you can move man pages from docs/dist/man directory to some
other directory and add it to MANPATH.
Full HTML documentation can be accessed at docs/dist/html/index.html.
You can also build only man pages or only html documentation, for
only man pages run:
.. code-block:: sh
make man
for only html documentation run:
.. code-block:: sh
make html
You can also build man pages for types in your ~/.cdist directory:
.. code-block:: sh
make dotman
Built man pages are now in docs/dist/man directory. If you have
some other custom .cdist directory, e.g. /opt/cdist then use:
.. code-block:: sh
make DOT_CDIST_PATH=/opt/cdist dotman
Note that `dotman`-target has to be built before a `make docs`-run, otherwise
the custom man-pages are not picked up.
Python package
~~~~~~~~~~~~~~
Cdist is available as a python package at
`PyPi `_. You can install it using
.. code-block:: sh
pip install cdist
cdist-6.0.2/docs/src/cdist-integration.rst 000644 001751 001751 00000003623 13552030341 020771 0 ustar 00darko darko 000000 000000 cdist integration / using cdist as library
==========================================
Description
-----------
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 **cdist.integration** and use its
functions:
* :strong:`cdist.integration.configure_hosts_simple` for configuration
* :strong:`cdist.integration.install_hosts_simple` for installation.
Functions require `host` and `manifest` parameters.
`host` can be specified as a string representing host or as iterable
of hosts. `manifest` is a path to initial manifest. For other cdist
options default values will be used. `verbose` is a desired verbosity
level which defaults to VERBOSE_INFO. `cdist_path` parameter specifies
path to cdist executable, if it is `None` then functions will try to
find it first from local lib directory and then in PATH.
In case of cdist error :strong:`cdist.Error` exception is raised.
:strong:`WARNING`: cdist integration helper functions are not yet stable!
Examples
--------
.. code-block:: sh
# configure host from python interactive shell
>>> import cdist.integration
>>> cdist.integration.configure_hosts_simple('185.203.114.185',
... '~/.cdist/manifest/init')
# configure host from python interactive shell, specifying verbosity level
>>> import cdist.integration
>>> cdist.integration.configure_hosts_simple(
... '185.203.114.185', '~/.cdist/manifest/init',
... verbose=cdist.argparse.VERBOSE_TRACE)
# configure specified dns hosts from python interactive shell
>>> import cdist.integration
>>> hosts = ('dns1.ungleich.ch', 'dns2.ungleich.ch', 'dns3.ungleich.ch', )
>>> cdist.integration.configure_hosts_simple(hosts,
... '~/.cdist/manifest/init')
cdist-6.0.2/docs/src/cdist-inventory.rst 000644 001751 001751 00000016345 13552030341 020510 0 ustar 00darko darko 000000 000000 Inventory
=========
Introduction
------------
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 **beta** so it can be used only if beta
command line flag is specified (-b, --beta) or setting CDIST_BETA env var.
Description
-----------
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
hostname with each tag on its own line.
Using inventory you can now configure hosts by selecting them by tags.
Tags have no values, as tags are just tags. Tag name-value would in this
context mean that host has two tags and it is selected by specifying that both
tags are present.
This inventory is **KISS** cdist built-in inventory database. You can maintain it
using cdist inventory interface or using standard UNIX tools.
cdist inventory interface
-------------------------
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).
Configuring hosts using inventory
---------------------------------
config command now has new options, **-t**, **-a** and **-A**.
**-A** means that all hosts in tag db is selected.
**-a** means that selected hosts must contain ALL specified tags.
**-t** means that host specifies tag - all hosts that have specified tags are
selected.
Examples
--------
.. code-block:: sh
# List inventory content
$ cdist inventory list -b
# List inventory for specified host localhost
$ cdist inventory list -b localhost
# List inventory for specified tag loadbalancer
$ cdist inventory list -b -t loadbalancer
# Add hosts to inventory
$ cdist inventory add-host -b web1 web2 web3
# Delete hosts from file old-hosts from inventory
$ cdist inventory del-host -b -f old-hosts
# Add tags to specified hosts
$ cdist inventory add-tag -b -t europe,croatia,web,static web1 web2
# Add tag to all hosts in inventory
$ cdist inventory add-tag -b -t vm
# Delete all tags from specified host
$ cdist inventory del-tag -b -a localhost
# Delete tags read from stdin from hosts specified by file hosts
$ cdist inventory del-tag -b -T - -f hosts
# Configure hosts from inventory with any of specified tags
$ cdist config -b -t web dynamic
# Configure hosts from inventory with all specified tags
$ cdist config -b -t -a web dynamic
# Configure all hosts from inventory db
$ cdist config -b -A
Example of manipulating database
--------------------------------
.. code-block:: sh
$ 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
localhost
test.mycloud.net
$ python3 scripts/cdist inventory add-host -b web1.mycloud.net web2.mycloud.net shell1.mycloud.net shell2.mycloud.net
$ python3 scripts/cdist inventory list -b
localhost
test.mycloud.net
web1.mycloud.net
web2.mycloud.net
shell1.mycloud.net
shell2.mycloud.net
$ python3 scripts/cdist inventory add-tag -b -t web web1.mycloud.net web2.mycloud.net
$ python3 scripts/cdist inventory add-tag -b -t shell shell1.mycloud.net shell2.mycloud.net
$ python3 scripts/cdist inventory add-tag -b -t cloud
$ python3 scripts/cdist inventory list -b
localhost cloud
test.mycloud.net cloud
web1.mycloud.net cloud,web
web2.mycloud.net cloud,web
shell1.mycloud.net cloud,shell
shell2.mycloud.net cloud,shell
$ python3 scripts/cdist inventory add-tag -b -t test,web,shell test.mycloud.net
$ python3 scripts/cdist inventory list -b
localhost cloud
test.mycloud.net cloud,shell,test,web
web1.mycloud.net cloud,web
web2.mycloud.net cloud,web
shell1.mycloud.net cloud,shell
shell2.mycloud.net cloud,shell
$ python3 scripts/cdist inventory del-tag -b -t shell test.mycloud.net
$ python3 scripts/cdist inventory list -b
localhost cloud
test.mycloud.net cloud,test,web
web1.mycloud.net cloud,web
web2.mycloud.net cloud,web
shell1.mycloud.net cloud,shell
shell2.mycloud.net cloud,shell
$ python3 scripts/cdist inventory add-tag -b -t all
$ python3 scripts/cdist inventory add-tag -b -t mistake
$ python3 scripts/cdist inventory list -b
localhost all,cloud,mistake
test.mycloud.net all,cloud,mistake,test,web
web1.mycloud.net all,cloud,mistake,web
web2.mycloud.net all,cloud,mistake,web
shell1.mycloud.net all,cloud,mistake,shell
shell2.mycloud.net all,cloud,mistake,shell
$ python3 scripts/cdist inventory del-tag -b -t mistake
$ python3 scripts/cdist inventory list -b
localhost all,cloud
test.mycloud.net all,cloud,test,web
web1.mycloud.net all,cloud,web
web2.mycloud.net all,cloud,web
shell1.mycloud.net all,cloud,shell
shell2.mycloud.net all,cloud,shell
$ python3 scripts/cdist inventory del-host -b localhost
$ python3 scripts/cdist inventory list -b
test.mycloud.net all,cloud,test,web
web1.mycloud.net all,cloud,web
web2.mycloud.net all,cloud,web
shell1.mycloud.net all,cloud,shell
shell2.mycloud.net all,cloud,shell
$ python3 scripts/cdist inventory list -b -t web
test.mycloud.net all,cloud,test,web
web1.mycloud.net all,cloud,web
web2.mycloud.net all,cloud,web
$ python3 scripts/cdist inventory list -b -t -a web test
test.mycloud.net all,cloud,test,web
$ python3 scripts/cdist inventory list -b -t -a web all
test.mycloud.net all,cloud,test,web
web1.mycloud.net all,cloud,web
web2.mycloud.net all,cloud,web
$ python3 scripts/cdist inventory list -b -t web all
test.mycloud.net all,cloud,test,web
web1.mycloud.net all,cloud,web
web2.mycloud.net all,cloud,web
shell1.mycloud.net all,cloud,shell
shell2.mycloud.net all,cloud,shell
$ cd cdist/inventory
$ ls -1
shell1.mycloud.net
shell2.mycloud.net
test.mycloud.net
web1.mycloud.net
web2.mycloud.net
$ ls -l
total 20
-rw-r--r-- 1 darko darko 16 Jun 24 12:43 shell1.mycloud.net
-rw-r--r-- 1 darko darko 16 Jun 24 12:43 shell2.mycloud.net
-rw-r--r-- 1 darko darko 19 Jun 24 12:43 test.mycloud.net
-rw-r--r-- 1 darko darko 14 Jun 24 12:43 web1.mycloud.net
-rw-r--r-- 1 darko darko 14 Jun 24 12:43 web2.mycloud.net
$ cat test.mycloud.net
test
all
web
cloud
$ cat web2.mycloud.net
all
web
cloud
For more info about inventory commands and options see `cdist `_\ (1).
Using external inventory
------------------------
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
**-f** option. For example, if your host list is stored in sqlite3 database
hosts.db and you want to select hosts which purpose is **django** then you
can use it with cdist like:
.. code-block:: sh
$ sqlite3 hosts.db "select hostname from hosts where purpose = 'django';" | cdist config
cdist-6.0.2/docs/src/cdist-manifest.rst 000644 001751 001751 00000023056 13552030341 020256 0 ustar 00darko darko 000000 000000 Manifest
========
Description
-----------
Manifests are used to define which objects to create.
Objects are instances of **types**, like in object oriented programming languages.
An object is represented by the combination of
**type + slash + object name**: **\__file/etc/cdist-configured** is an
object of the type **__file** with the name **etc/cdist-configured**.
All available types can be found in the **cdist/conf/type/** directory,
use **ls cdist/conf/type** to get the list of available types. If you have
setup the MANPATH correctly, you can use **man cdist-reference** to access
the reference with pointers to the manpages.
Types in manifests are used like normal command line tools. Let's have a look
at an example::
# Create object of type __package with the parameter state = absent
__package apache2 --state absent
# Same with the __directory type
__directory /tmp/cdist --state present
These two lines create objects, which will later be used to realise the
configuration on the target host.
Manifests are executed locally as a shell script using **/bin/sh -e**.
The resulting objects are stored in an internal database.
The same object can be redefined in multiple different manifests as long as
the parameters are exactly the same.
In general, manifests are used to define which types are used depending
on given conditions.
Initial and type manifests
--------------------------
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 `cdist type `_.
Define state in the initial manifest
------------------------------------
The **initial manifest** is the entry point for cdist to find out, which
**objects** to configure on the selected host.
Cdist expects the initial manifest at **cdist/conf/manifest/init**.
Within this initial manifest you define which objects should be
created on which host. To distinguish between hosts, you can use the
environment variable **__target_host** and/or **__target_hostname** and/or
**__target_fqdn**. Let's have a look at a simple example::
__cdistmarker
case "$__target_host" in
localhost)
__directory /home/services/kvm-vm --parents yes
;;
esac
This manifest says: Independent of the host, always use the type
**__cdistmarker**, which creates the file **/etc/cdist-configured**,
with the timestamp as content.
The directory **/home/services/kvm-vm**, including all parent directories,
is only created on the host **localhost**.
As you can see, there is no magic involved, the manifest is simple shell code that
utilises cdist types. Every available type can be executed like a normal
command.
Splitting up the initial manifest
---------------------------------
If you want to split up your initial manifest, you can create other shell
scripts in **cdist/conf/manifest/** and include them in **cdist/conf/manifest/init**.
Cdist provides the environment variable **__manifest** to reference
the directory containing the initial manifest (see `cdist reference `_).
The following example would include every file with a **.sh** suffix::
# Include *.sh
for manifest in $__manifest/*.sh; do
# And source scripts into our shell environment
. "$manifest"
done
Dependencies
------------
If you want to describe that something requires something else, just
setup the variable "require" to contain the requirements. Multiple
requirements can be added white space separated.
::
1 # No dependency
2 __file /etc/cdist-configured
3
4 # Require above object
5 require="__file/etc/cdist-configured" __link /tmp/cdist-testfile \
6 --source /etc/cdist-configured --type symbolic
7
8 # Require two objects
9 require="__file/etc/cdist-configured __link/tmp/cdist-testfile" \
10 __file /tmp/cdist-another-testfile
Above the "require" variable is only set for the command that is
immediately following it. Dependencies should always be declared that way.
On line 4 you can see that the instantiation of a type "\__link" object needs
the object "__file/etc/cdist-configured" to be present, before it can proceed.
This also means that the "\__link" command must make sure, that either
"\__file/etc/cdist-configured" already is present, or, if it's not, it needs
to be created. The task of cdist is to make sure, that the dependency will be
resolved appropriately and thus "\__file/etc/cdist-configured" be created
if necessary before "__link" proceeds (or to abort execution with an error).
If you really need to make all types depend on a common dependency, you can
export the "require" 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.
::
# First of all, update the package index
__package_update_index
# Upgrade all the installed packages afterwards
require="__package_update_index" __package_upgrade_all
# Create a common dependency for all the next types so that they get to
# be executed only after the package upgrade has finished
export require="__package_upgrade_all"
# Ensure that lighttpd is installed after we have upgraded all the packages
__package lighttpd --state present
# Ensure that munin is installed after lighttpd is present and after all
# the packages are upgraded
require="$require __package/lighttpd" __package munin --state present
All objects that are created in a type manifest are automatically required
from the type that is calling them. This is called "autorequirement" in
cdist jargon.
You can find a more in depth description of the flow execution of manifests
in `cdist execution stages `_ and of how types work in `cdist type `_.
Create dependencies from execution order
-----------------------------------------
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
automatically depends on the previously created object.
It essentially helps you to build up blocks of code that build upon each other
(like first creating the directory xyz than the file below the directory).
Read also about `perils of CDIST_ORDER_DEPENDENCY `_.
Overrides
---------
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
(any value or even empty is ok) to tell cdist, that this object override is
wanted and should be accepted.
ATTENTION: Only use this feature if you are 100% sure in which order
cdist encounters the affected objects, otherwise this results
in an undefined situation.
If CDIST_OVERRIDE and CDIST_ORDER_DEPENDENCY are set for an object,
CDIST_ORDER_DEPENDENCY will be ignored, because adding a dependency in case of
overrides would result in circular dependencies, which is an error.
Examples
--------
The initial manifest may for instance contain the following code:
.. code-block:: sh
# Always create this file, so other sysadmins know cdist is used.
__file /etc/cdist-configured
case "$__target_host" in
my.server.name)
__directory /root/bin/
__file /etc/issue.net --source "$__manifest/issue.net
;;
esac
The manifest of the type "nologin" may look like this:
.. code-block:: sh
__file /etc/nologin --source "$__type/files/default.nologin"
This example makes use of dependencies:
.. code-block:: sh
# Ensure that lighttpd is installed
__package lighttpd --state present
# Ensure that munin makes use of lighttpd instead of the default webserver
# package as decided by the package manager
require="__package/lighttpd" __package munin --state present
How to override objects:
.. code-block:: sh
# for example in the initial manifest
# create user account foobar with some hash for password
__user foobar --password 'some_fancy_hash' --home /home/foobarexample
# ... many statements and includes in the manifest later ...
# somewhere in a conditionally sourced manifest
# (e.g. for example only sourced if a special application is on the target host)
# this leads to an error ...
__user foobar --password 'some_other_hash'
# this tells cdist, that you know that this is an override and should be accepted
CDIST_OVERRIDE=yes __user foobar --password 'some_other_hash'
# it's only an override, means the parameter --home is not touched
# and stays at the original value of /home/foobarexample
Dependencies defined by execution order work as following:
.. code-block:: sh
# Tells cdist to execute all types in the order in which they are created ...
export CDIST_ORDER_DEPENDENCY=on
__sample_type 1
require="__some_type_somewhere/id" __sample_type 2
__example_type 23
# Now this types are executed in the creation order until the variable is unset
unset CDIST_ORDER_DEPENDENCY
# all now following types cdist makes the order ..
__not_in_order_type 42
# how it works :
# this lines above are translated to:
__sample_type 1
require="__some_type_somewhere/id __sample_type/1" __sample_type 2
require="__sample_type/2" __example_type 23
__not_in_order_type 42
cdist-6.0.2/docs/src/cdist-messaging.rst 000644 001751 001751 00000004646 13552030341 020431 0 ustar 00darko darko 000000 000000 Messaging
=========
Description
-----------
cdist has a simple but powerful way of allowing communication between
the initial manifest and types as well as types and types.
Whenever execution is passed from cdist to one of the
scripts described below, cdist generate 2 new temporary files
and exports the environment variables **__messages_in** and
**__messages_out** to point to them.
Before handing over the control, the content of the global message
file is copied into the file referenced by **$__messages_in**.
After cdist gained control back, the content of the file referenced
by **$__messages_out** is appended to the global message file.
This way overwriting any of the two files by accident does not
interfere with other types.
The order of execution is not defined unless you create dependencies
between the different objects (see `cdist manifest `_) and thus you
can only react reliably on messages by objects that you depend on.
Availability
------------
Messaging is possible between all **local** scripts:
- initial manifest
- type/manifest
- type/gencode-local
- type/gencode-remote
Examples
--------
When you want to emit a message use:
.. code-block:: sh
echo "something" >> "$__messages_out"
When you want to react on a message use:
.. code-block:: sh
if grep -q "^__your_type/object/id:something" "$__messages_in"; then
echo "I do something else"
fi
Some real life examples:
.. code-block:: sh
# Reacting on changes from block for keepalive
if grep -q "^__block/keepalive-vrrp" "$__messages_in"; then
echo /etc/init.d/keepalived restart
fi
# Reacting on changes of configuration files
if grep -q "^__file/etc/one" $__messages_in; then
echo 'for init in /etc/init.d/opennebula*; do $init restart; done'
fi
Restart sshd on changes
.. code-block:: sh
os="$(cat "$__global/explorer/os")"
case "$os" in
centos|redhat|suse)
restart="/etc/init.d/sshd restart"
;;
debian|ubuntu)
restart="/etc/init.d/ssh restart"
;;
*)
cat << eof >&2
Unsupported os $os.
If you would like to have this type running on $os,
you can either develop the changes and send a pull
request or ask for a quote at www.ungleich.ch
eof
exit 1
;;
esac
if grep -q "^__key_value/PermitRootLogin" "$__messages_in"; then
echo $restart
fi
cdist-6.0.2/docs/src/cdist-os.rst 000644 001751 001751 00000001211 13552030341 017056 0 ustar 00darko darko 000000 000000 Supported operating systems
===========================
cdist was tested or is know to run on at least
* `Alpine Linux `_
* `Archlinux `_
* `CentOS `_
* `Debian `_
* `Devuan `_
* `Fedora `_
* `FreeBSD `_
* `Gentoo `_
* `Mac OS X `_
* `NetBSD `_
* `OpenBSD `_
* `Redhat `_
* `Ubuntu `_
* `XenServer `_
cdist-6.0.2/docs/src/cdist-parallelization.rst 000644 001751 001751 00000006251 13552030341 021640 0 ustar 00darko darko 000000 000000 Parallelization
===============
Description
-----------
cdist has two modes of parallel operation.
One of them is to operate on each host in separate process. This is enabled
with :strong:`-p/--parallel` option.
The other way is to operate in parallel within one host where you specify
the number of jobs. This is enabled with :strong:`-j/--jobs` option where you
can specify the number of parallel jobs. By default,
:strong:`multiprocessing.cpu_count()` is used. For this mode global explorers,
object preparation and object run are supported.
You can, of course, use those two options together. This means that each host
will be processed by its own process. Within each process cdist will operate
using specified number of parallel jobs.
For more info on those options see :strong:`cdist`\ (1).
Examples
--------
.. code-block:: sh
# Configure hosts read from file hosts.file in parallel
$ cdist config -p -f hosts.file
# Configure hosts read from file hosts.file sequentially but using default
# number of parallel jobs
$ cdist config -j -f hosts.file
# Configure hosts read from file hosts.file in parallel using 16
# parallel jobs
$ cdist config -j 16 -p -f hosts.file
Caveats
-------
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.
This is controlled with sshd :strong:MaxStartups configuration options.
You may also encounter session open refusal. This happens with ssh multiplexing
when you reach maximum number of open sessions permitted per network
connection. In this case ssh will disable multiplexing.
This limit is controlled with sshd :strong:MaxSessions configuration
options. For more details refer to :strong:`sshd_config`\ (5).
For example, if you reach :strong:`MaxSessions` sessions you may get the
following output:
.. code-block:: sh
$ cdist config -b -j 11 -v 78.47.116.244
INFO: cdist: version 4.2.2-55-g640b7f9
INFO: 78.47.116.244: Running global explorers
INFO: 78.47.116.244: Remote transfer in 11 parallel jobs
channel 22: open failed: administratively prohibited: open failed
mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /tmp/tmpuah6fw_t/d886d4b7e4425a102a54bfaff4d2288b/ssh-control-path already exists, disabling multiplexing
INFO: 78.47.116.244: Running global explorers in 11 parallel jobs
channel 22: open failed: administratively prohibited: open failed
mux_client_request_session: session request failed: Session open refused by peer
ControlSocket /tmp/tmpuah6fw_t/d886d4b7e4425a102a54bfaff4d2288b/ssh-control-path already exists, disabling multiplexing
INFO: 78.47.116.244: Running initial manifest /tmp/tmpuah6fw_t/d886d4b7e4425a102a54bfaff4d2288b/data/conf/manifest/init
INFO: 78.47.116.244: Running manifest and explorers for __file/root/host.file
INFO: 78.47.116.244: Generating code for __file/root/host.file
INFO: 78.47.116.244: Finished successful run in 18.655028820037842 seconds
INFO: cdist: Total processing time for 1 host(s): 19.159148693084717
cdist-6.0.2/docs/src/cdist-preos.rst 000644 001751 001751 00000010151 13552030341 017570 0 ustar 00darko darko 000000 000000 PreOS
=====
Description
-----------
With cdist you can install and configure new machines. You can use cdist to
create PreOS, minimal OS which purpose is to boot new machine.
After PreOS is booted machine is ready for installing desired OS and
then it is ready for configuration.
PreOS creation
--------------
With cdist you can create PreOS.
Currently supported PreOS-es include:
* debian
* ubuntu
* devuan.
PreOS is created using cdist preos command. preos command has subcommands that
create the desired PreOS.
For example, to create ubuntu PreOS:
.. code-block:: sh
$ cdist preos ubuntu /preos/preos-ubuntu -B -C \
-k ~/.ssh/id_rsa.pub -p /preos/pxe-ubuntu
For more info about available options see cdist manual page.
This will bootstrap (``-B``) ubuntu PreOS in ``/preos/preos-ubuntu`` directory, it
will be configured (``-C``) using default built-in initial manifest and with
specified ssh authorized key (``-k``).
After bootstrapping and configuration PXE
boot directory will be created (``-p``) in ``/preos/pxe-ubuntu``.
After PreOS is created new machines can be booted using created PXE (after
proper dhcp, tftp setting).
Since PreOS is configured with ssh authorized key it can be accessed throguh
ssh, i.e. it can be further installed and configured with cdist.
Implementing new PreOS sub-command
----------------------------------
preos command is implemented as a plugin system. This plugin system scans for
preos subcommands in ``cdist/preos/`` distribution directory and also in
``~/.cdist/preos/`` directory if it exists.
preos subcommand is a module or a class that satisfies the following:
* it has attribute ``_cdist_preos`` set to ``True``
* it has function/method ``commandline``.
For a module based preos subcommand ``commandline`` function accepts a module
object as its first argument and the list of command line
arguments (``sys.argv[2:]``).
For a class preos subcommand ``commandline`` method should be staticmethod and
it accepts a class object as its first argument and the list of command line
arguments(``sys.argv[2:]``).
If preos scanning finds a module/class that has ``_cdist_preos`` set
to ``True`` and it has function/method ``commandline`` then this module/class is
registered to preos subcommands. The name of the command is set to ``_preos_name``
attribute if it exists, otherwise it is set to the module/class name, lowercase.
When registered preos subcommand is specified as preos command then ``commandline``
will be called with first argument set to module/class object and second argument
set to ``sys.argv[2:]``.
Example writing new dummy preos sub-command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module based preos:
^^^^^^^^^^^^^^^^^^^
#. Create directory ``~/.cdist/preos/`` if it does not exist
#. Create ``~/.cdist/preos/netbsd.py`` with the following contents:
.. code-block:: python
_preos_name = 'netbsd'
_cdist_preos = True
def commandline(cls, args):
print("NetBSD PreOS: {}".format(args))
When you try to run this new preos you will get:
.. code-block:: sh
$ cdist preos -h
usage: cdist preos [-h] preos
Create PreOS
positional arguments:
preos PreOS to create, one of: {'netbsd', 'debian', 'ubuntu'}
optional arguments:
-h, --help show this help message and exit
$ cdist preos netbsd
NetBSD PreOS: []
Class based preos:
^^^^^^^^^^^^^^^^^^
#. Create directory ``~/.cdist/preos/`` if it does not exist
#. Create ``~/.cdist/preos/freebsd.py`` with the following contents:
.. code-block:: python
class FreeBSD(object):
_cdist_preos = True
@classmethod
def commandline(cls, args):
print("FreeBSD dummy preos: {}".format(args))
When you try to run this new preos you will get:
.. code-block:: sh
$ cdist preos -h
usage: cdist preos [-h] preos
Create PreOS
positional arguments:
preos PreOS to create, one of: {'freebsd', 'debian', 'ubuntu'}
optional arguments:
-h, --help show this help message and exit
$ cdist preos freebsd
FreeBSD dummy preos: []
In the ``commandline`` function/method you have all the freedom to actually create
PreOS.
cdist-6.0.2/docs/src/cdist-type.rst 000644 001751 001751 00000037631 13552030341 017435 0 ustar 00darko darko 000000 000000 cdist type
==========
Description
-----------
Types are the main component of cdist and define functionality. If you
use cdist, you'll write a type for every functionality you would like
to use.
Synopsis
--------
.. code-block:: sh
__TYPE ID --parameter value [--parameter value ...]
__TYPE --parameter value [--parameter value ...] (for singletons)
How to use a type
-----------------
You can use types from the initial manifest or the type manifest like a
normal shell command:
.. code-block:: sh
# Creates empty file /etc/cdist-configured
__file /etc/cdist-configured --type file
# Ensure tree is installed
__package tree --state installed
A list of supported types can be found in the `cdist reference `_ manpage.
Singleton types
---------------
If a type is flagged as a singleton, it may be used only
once per host. This is useful for types which can be used only once on a
system. Singleton types do not take an object name as argument.
Example:
.. code-block:: sh
# __issue type manages /etc/issue
__issue
# Probably your own type - singletons may use parameters
__myfancysingleton --colour green
Config types
------------
By default types are used with config command. These are types that are not
flagged by any known command flag. If a type is marked then it will be skipped
with config command.
Install types
-------------
If a type is flagged with 'install' flag then it is used only with install command.
With other commands, i.e. config, these types are skipped if used.
Nonparallel types
-----------------
If a type is flagged with 'nonparallel' flag then its objects cannot be run in parallel
when using -j option. Example of such a type is __package_dpkg type where dpkg itself
prevents to be run in more than one instance.
Deprecated types
-----------------
If a type is flagged with 'deprecated' marker then it is considered deprecated.
When it is used cdist writes warning line. If 'deprecated' marker has content
then this content is printed as a deprecation messages, e.g.:
.. code-block:: sh
$ ls -l deprecated
-rw-r--r-- 1 darko darko 71 May 20 18:30 deprecated
$ cat deprecated
This type is deprecated. It will be removed in the next minor release.
$ echo '__foo foo' | ./bin/cdist config -i - 185.203.112.26
WARNING: 185.203.112.26: Type __foo is deprecated: This type is deprecated. It will be removed in the next minor release.
If 'deprecated' marker has no content then general message is printed, e.g.:
.. code-block:: sh
$ ls -l deprecated
-rw-r--r-- 1 darko darko 0 May 20 18:36 deprecated
$ echo '__bar foo' | ./bin/cdist config -i - 185.203.112.26
WARNING: 185.203.112.26: Type __bar is deprecated.
How to write a new type
-----------------------
A type consists of
- parameter (optional)
- manifest (optional)
- singleton (optional)
- explorer (optional)
- gencode (optional)
- nonparallel (optional)
Types are stored below cdist/conf/type/. Their name should always be prefixed with
two underscores (__) to prevent collisions with other executables in $PATH.
To implement a new type, create the directory **cdist/conf/type/__NAME**.
Type manifest and gencode can be written in any language. They just need to be
executable and have a proper shebang. If they are not executable then cdist assumes
they are written in shell so they are executed using '/bin/sh -e' or 'CDIST_LOCAL_SHELL'.
For executable shell code it is suggested that shebang is '#!/bin/sh -e'.
For creating type skeleton you can use helper script
`cdist-new-type `_.
Defining parameters
-------------------
Every type consists of required, optional and boolean parameters, which must
each be declared in a newline separated file in **parameter/required**,
**parameter/required_multiple**, **parameter/optional**,
**parameter/optional_multiple** and **parameter/boolean**.
Parameters which are allowed multiple times should be listed in
required_multiple or optional_multiple respectively. All other parameters
follow the standard unix behaviour "the last given wins".
If either is missing, the type will have no required, no optional, no boolean
or no parameters at all.
Default values for optional parameters can be predefined in
**parameter/default/**.
Example:
.. code-block:: sh
echo servername >> cdist/conf/type/__nginx_vhost/parameter/required
echo logdirectory >> cdist/conf/type/__nginx_vhost/parameter/optional
echo loglevel >> cdist/conf/type/__nginx_vhost/parameter/optional
mkdir cdist/conf/type/__nginx_vhost/parameter/default
echo warning > cdist/conf/type/__nginx_vhost/parameter/default/loglevel
echo server_alias >> cdist/conf/type/__nginx_vhost/parameter/optional_multiple
echo use_ssl >> cdist/conf/type/__nginx_vhost/parameter/boolean
Using parameters
----------------
The parameters given to a type can be accessed and used in all type scripts
(e.g manifest, gencode, explorer). Note that boolean parameters are
represented by file existence. File exists -> True,
file does not exist -> False
Example: (e.g. in cdist/conf/type/__nginx_vhost/manifest)
.. code-block:: sh
# required parameter
servername="$(cat "$__object/parameter/servername")"
# optional parameter
if [ -f "$__object/parameter/logdirectory" ]; then
logdirectory="$(cat "$__object/parameter/logdirectory")"
fi
# optional parameter with predefined default
loglevel="$(cat "$__object/parameter/loglevel")"
# boolean parameter
if [ -f "$__object/parameter/use_ssl" ]; then
# file exists -> True
# do some fancy ssl stuff
fi
# parameter with multiple values
if [ -f "$__object/parameter/server_alias" ]; then
for alias in $(cat "$__object/parameter/server_alias"); do
echo $alias > /some/where/useful
done
fi
Deprecated parameters
---------------------
To deprecate type parameters one can declare a file for each deprecated
parameter under **parameter/deprecated** directory.
When such parameter is used cdist writes warning line with deprecation message.
If such file has content then this content is printed as deprecation message.
If there is no content then generic parameter deprecation message is printed.
Example:
.. code-block:: sh
$ ls parameter/deprecated/
eggs spam
$ cat parameter/deprecated/eggs
eggs parameter is deprecated, please use multiple egg parameter.
$ cat parameter/deprecated/spam
$ echo '__foo foo --foo foo --eggs eggs' | ./bin/cdist config -i - 185.203.112.26
WARNING: 185.203.112.26: eggs parameter of type __foo is deprecated: eggs parameter is deprecated, please use multiple egg parameter.
$ echo '__foo foo --foo foo --eggs eggs --spam spam' | ./bin/cdist config -i - 185.203.112.26
WARNING: 185.203.112.26: spam parameter of type __foo is deprecated.
WARNING: 185.203.112.26: eggs parameter of type __foo is deprecated: eggs parameter is deprecated, please use multiple egg parameter.
Input from stdin
----------------
Every type can access what has been written on stdin when it has been called.
The result is saved into the **stdin** file in the object directory.
Example use of a type: (e.g. in cdist/conf/type/__archlinux_hostname)
.. code-block:: sh
__file /etc/rc.conf --source - << eof
...
HOSTNAME="$__target_host"
...
eof
If you have not seen this syntax (<< eof) before, it may help you to read
about "here documents".
In the __file type, stdin is used as source for the file, if - is used for source:
.. code-block:: sh
if [ -f "$__object/parameter/source" ]; then
source="$(cat "$__object/parameter/source")"
if [ "$source" = "-" ]; then
source="$__object/stdin"
fi
....
Stdin inside a loop
~~~~~~~~~~~~~~~~~~~
Since cdist saves type's stdin content in the object as **$__object/stdin**,
so it can be accessed in manifest and gencode-* scripts, this can lead to
unexpected behavior. For example, suppose you have some type with the following
in its manifest:
.. code-block:: sh
if [ -f "$__object/parameter/foo" ]
then
while read -r l
do
__file "$l"
echo "$l" >&2
done < "$__object/parameter/foo"
fi
and init manifest:
.. code-block:: sh
__foo foo --foo a --foo b --foo c
You expect that manifest stderr content is:
.. code-block:: sh
a
b
c
and that files *a*, *b* and *c* are created. But all you get in manifest stderr
is:
.. code-block:: sh
a
and only *a* file is created.
When redirecting parameter *foo* file content to while's stdin that means that all
commands in while body have this same stdin. So when *__file* type gets executed,
cdist saves its stdin which means it gets the remaining content of parameter *foo*
file, i.e.:
.. code-block:: sh
b
c
The solution is to make sure that your types inside such loops get their stdin
from somewhere else, e.g. for the above problem *__file* type can get empty
stdin from */dev/null*:
.. code-block:: sh
if [ -f "$__object/parameter/foo" ]
then
while read -r l
do
__file "$l" < /dev/null
echo "$l" >&2
done < "$__object/parameter/foo"
fi
Writing the manifest
--------------------
In the manifest of a type you can use other types, so your type extends
their functionality. A good example is the __package type, which in
a shortened version looks like this:
.. code-block:: sh
os="$(cat "$__global/explorer/os")"
case "$os" in
archlinux) type="pacman" ;;
debian|ubuntu) type="apt" ;;
gentoo) type="emerge" ;;
*)
echo "Don't know how to manage packages on: $os" >&2
exit 1
;;
esac
__package_$type "$@"
As you can see, the type can reference different environment variables,
which are documented in `cdist reference `_.
Always ensure the manifest is executable, otherwise cdist will not be able
to execute it. For more information about manifests see `cdist manifest `_.
Singleton - one instance only
-----------------------------
If you want to ensure that a type can only be used once per target, you can
mark it as a singleton: Just create the (empty) file "singleton" in your type
directory:
.. code-block:: sh
touch cdist/conf/type/__NAME/singleton
This will also change the way your type must be called:
.. code-block:: sh
__YOURTYPE --parameter value
As you can see, the object ID is omitted, because it does not make any sense,
if your type can be used only once.
Install - type with install command
-----------------------------------
If you want a type to be used with install command, you must mark it as
install: create the (empty) file "install" in your type directory:
.. code-block:: sh
touch cdist/conf/type/__install_NAME/install
With other commands, i.e. config, it will be skipped if used.
Nonparallel - only one instance can be run at a time
----------------------------------------------------
If objects of a type must not or cannot be run in parallel when using -j
option, you must mark it as nonparallel: create the (empty) file "nonparallel"
in your type directory:
.. code-block:: sh
touch cdist/conf/type/__NAME/nonparallel
For example, package types are nonparallel types.
The type explorers
------------------
If a type needs to explore specific details, it can provide type specific
explorers, which will be executed on the target for every created object.
The explorers are stored under the "explorer" directory below the type.
It could for instance contain code to check the md5sum of a file on the
client, like this (shortened version from the type __file):
.. code-block:: sh
if [ -f "$__object/parameter/destination" ]; then
destination="$(cat "$__object/parameter/destination")"
else
destination="/$__object_id"
fi
if [ -e "$destination" ]; then
md5sum < "$destination"
fi
Writing the gencode script
--------------------------
There are two gencode scripts: **gencode-local** and **gencode-remote**.
The output of gencode-local is executed locally, whereas
the output of gencode-remote is executed on the target.
The gencode scripts can make use of the parameters, the global explorers
and the type specific explorers.
If the gencode scripts encounters an error, it should print diagnostic
messages to stderr and exit non-zero. If you need to debug the gencode
script, you can write to stderr:
.. code-block:: sh
# Debug output to stderr
echo "My fancy debug line" >&2
# Output to be saved by cdist for execution on the target
echo "touch /etc/cdist-configured"
Notice: if you use __remote_copy or __remote_exec directly in your scripts
then for IPv6 address with __remote_copy execution you should enclose IPv6
address in square brackets. The same applies to __remote_exec if it behaves
the same as ssh for some options where colon is a delimiter, as for -L ssh
option (see :strong:`ssh`\ (1) and :strong:`scp`\ (1)).
Variable access from the generated scripts
------------------------------------------
In the generated scripts, you have access to the following cdist variables
- __object
- __object_id
but only for read operations, means there is no back copy of this
files after the script execution.
So when you generate a script with the following content, it will work:
.. code-block:: sh
if [ -f "$__object/parameter/name" ]; then
name="$(cat "$__object/parameter/name")"
else
name="$__object_id"
fi
Environment variable usage idiom
--------------------------------
In type scripts you can support environment variables with default values if
environment variable is unset or null by using **${parameter:-[word]}**
parameter expansion.
Example using mktemp in a portable way that supports TMPDIR environment variable.
.. code-block:: sh
tempfile=$(mktemp "${TMPDIR:-/tmp}/cdist.XXXXXXXXXX")
Log level in types
------------------
cdist log level can be accessed from __cdist_log_level variable.One of:
+----------------+-----------------+
| Log level | Log level value |
+================+=================+
| OFF | 60 |
+----------------+-----------------+
| ERROR | 40 |
+----------------+-----------------+
| WARNING | 30 |
+----------------+-----------------+
| INFO | 20 |
+----------------+-----------------+
| VERBOSE | 15 |
+----------------+-----------------+
| DEBUG | 10 |
+----------------+-----------------+
| TRACE | 5 |
+----------------+-----------------+
It is available for initial manifest, explorer, type manifest,
type explorer, type gencode.
Detecting dry run
-----------------
If ``$__cdist_dry_run`` environment variable is set, then it's dry run.
It is available for initial manifest, explorer, type manifest,
type explorer, type gencode.
Hints for typewriters
----------------------
It must be assumed that the target is pretty dumb and thus does not have high
level tools like ruby installed. If a type requires specific tools to be present
on the target, there must be another type that provides this tool and the first
type should create an object of the specific type.
If your type wants to save temporary data, that may be used by other types
later on (for instance \__file), you can save them in the subdirectory
"files" below $__object (but you must create it yourself).
cdist will not touch this directory.
If your type contains static files, it's also recommended to place them in
a folder named "files" within the type (again, because cdist guarantees to
never ever touch this folder).
How to include a type into upstream cdist
-----------------------------------------
If you think your type may be useful for others, ensure it works with the
current master branch of cdist and have a look at `cdist hacking `_ on
how to submit it.
cdist-6.0.2/docs/src/cdist-quickstart.rst 000644 001751 001751 00000005165 13552030341 020643 0 ustar 00darko darko 000000 000000 Quickstart
==========
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.
For those who just want to configure a system with the
cdist configuration management and do not need (or want)
to understand everything.
This tutorial assumes you are configuring **localhost**, because
it is always available. Just replace **localhost** with your target
host for real life usage.
Cdist uses **ssh** for communication and transportation
and usually logs into the **target host** as the
**root** user. So you need to configure the **ssh server**
of the target host to allow root logins: Edit
the file **/etc/ssh/sshd_config** and add one of the following
lines::
# Allow login only via public key
PermitRootLogin without-password
# Allow login via password and public key
PermitRootLogin yes
As cdist uses ssh intensively, it is recommended to setup authentication
with public keys::
# Generate pubkey pair as a normal user
ssh-keygen
# Copy pubkey over to target host
ssh-copy-id root@localhost
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::
# Start agent and export variables
eval `ssh-agent`
# Add keys (requires password for every identity file)
ssh-add
At this point you should be able to **ssh root@localhost** without
re-entering the password. If something failed until here, ensure that
all steps went successfully and you have read and understood the
documentation.
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::
# Get cdist
git clone git@code.ungleich.ch:ungleich-public/cdist.git
# Create manifest (maps configuration to host(s)
cd cdist
echo '__file /etc/cdist-configured' > cdist/conf/manifest/init
# Configure localhost in verbose mode
./bin/cdist config -v localhost
# Find out that cdist created /etc/cdist-configured
ls -l /etc/cdist-configured
Note: cdist/conf is configuration directory shipped with cdist distribution.
If exists, ~/.cdist, is also automatically used as cdist configuration
directory. So in the above example you could create ~/.cdist directory,
then ~/.cdist/manifest sub-directory and create init manifest
~/.cdist/manifest/init.
That's it, you've successfully used cdist to configure your first host!
Continue reading the next sections, to understand what you did and how
to create a more sophisticated configuration.
cdist-6.0.2/docs/src/cdist-real-world.rst 000644 001751 001751 00000043201 13552030341 020512 0 ustar 00darko darko 000000 000000 Dive into real world cdist
==========================
Introduction
------------
This walkthrough shows real world cdist configuration example.
Sample target host is named **test.ungleich.ch**.
Just replace **test.ungleich.ch** with your target hostname.
Our goal is to configure python application hosting. For writing sample
application we will use `Bottle `_ WSGI micro web-framework.
It will use PostgreSQL database and it will list items from **items** table.
It will be served by uWSGI server. We will also use the Nginx web server
as a reverse proxy and we want HTTPS.
For HTTPS we will use Let's Encrypt certificate.
For setting up hosting we want to use cdist so we will write a new type
for that. This type will:
- install required packages
- create OS user, user home directory and application home directory
- create PostgreSQL database
- configure uWSGI
- configure Let's Encrypt certificate
- configure nginx.
Our type will not create the actual python application. Its intention is only
to configure hosing for specified user and project. It is up to the user to
create his/her applications.
So let's start.
Creating type layout
--------------------
We will create a new custom type. Let's call it **__sample_bottle_hosting**.
Go to **~/.cdist/type** directory (create it if it does not exist) and create
new type layout::
cd ~/.cdist/type
mkdir __sample_bottle_hosting
cd __sample_bottle_hosting
touch manifest gencode-remote
mkdir parameter
touch parameter/required
Creating __sample_bottle_hosting type parameters
------------------------------------------------
Our type will be configurable through the means of parameters. Let's define
the following parameters:
projectname
name for the project, needed for uWSGI ini file
user
user name
domain
target host domain, needed for Let's Encrypt certificate.
We define parameters to make our type reusable for different projects, user and domain.
Define required parameters::
printf "projectname\n" >> parameter/required
printf "user\n" >> parameter/required
printf "domain\n" >> parameter/required
For details on type parameters see `Defining parameters `_.
Creating __sample_bottle_hosting type manifest
----------------------------------------------
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 `os `_
global explorer::
os=$(cat "$__global/explorer/os")
case "$os" in
devuan)
:
;;
*)
echo "OS $os currently not supported" >&2
exit 1
;;
esac
If target host OS is not Devuan then we print error message to stderr
and exit. For other OS-es support we should check and change package names
we should install, because packages differ in different OS-es and in different
OS distributions like GNU/Linux distributions. There can also be a different
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.
Creating user and user directories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then we create user and his/her home directory and application home directory.
We will use existing cdist types `__user `_ and `__directory `_::
user="$(cat "$__object/parameter/user")"
home="/home/$user"
apphome="$home/app"
# create user
__user "$user" --home "$home" --shell /bin/bash
# create user home dir
require="__user/$user" __directory "$home" \
--owner "$user" --group "$user" --mode 0755
# create app home dir
require="__user/$user __directory/$home" __directory "$apphome" \
--state present --owner "$user" --group "$user" --mode 0755
First we define *user*, *home* and *apphome* variables. User is defined by type's
**user** parameter. Here we use **require** which is cdist's way to define dependencies.
User home directory should be created **after** user is created. And application
home directory is created **after** both user and user home directory are created.
For details on **require** see `Dependencies `_.
Installing packages
~~~~~~~~~~~~~~~~~~~
Install required packages using existing `__package `_ type.
Before installing package we want to update apt package index using
`__apt_update_index `_::
# define packages that need to be installed
packages_to_install="nginx uwsgi-plugin-python3 python3-dev python3-pip postgresql postgresql-contrib libpq-dev python3-venv uwsgi python3-psycopg2"
# update package index
__apt_update_index
# install packages
for package in $packages_to_install
do require="__apt_update_index" __package $package --state=present
done
Here we use shell for loop. It executes **require="__apt_update_index" __package**
for each member in a list we define in **packages_to_install** variable.
This is much nicer then having as many **require="__apt_update_index" __package**
lines as there are packages we want to install.
For python packages we use `__package_pip `_::
# install pip3 packages
for package in bottle bottle-pgsql; do
__package_pip --pip pip3 $package
done
Creating PostgreSQL database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create PostgreSQL database using `__postgres_database `_
and `__postgres_role `_ for creating database user::
#PostgreSQL db & user
postgres_server=postgresql
# create PostgreSQL db user
require="__package/postgresql" __postgres_role $user --login --createdb
# create PostgreSQL db
require="__postgres_role/$user __package/postgresql" __postgres_database $user \
--owner $user
Configuring uWSGI
~~~~~~~~~~~~~~~~~
Configure uWSGI using `__file `_ type::
# configure uWSGI
projectname="$(cat "$__object/parameter/projectname")"
require="__package/uwsgi" __file /etc/uwsgi/apps-enabled/$user.ini \
--owner root --group root --mode 0644 \
--state present \
--source - << EOF
[uwsgi]
socket = $apphome/uwsgi.sock
chdir = $apphome
wsgi-file = $projectname/wsgi.py
touch-reload = $projectname/wsgi.py
processes = 4
threads = 2
chmod-socket = 666
daemonize=true
vacuum = true
uid = $user
gid = $user
EOF
We require package uWSGI present in order to create **/etc/uwsgi/apps-enabled/$user.ini** file.
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 `_.
For feading 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).
Configuring nginx for Let's Encrypt and HTTPS redirection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Next configure nginx for Let's Encrypt and for HTTP -> HTTPS redirection. For this
purpose we will create new type **__sample_nginx_http_letsencrypt_and_ssl_redirect**
and use it here::
domain="$(cat "$__object/parameter/domain")"
webroot="/var/www/html"
__sample_nginx_http_letsencrypt_and_ssl_redirect "$domain" --webroot "$webroot"
Configuring certificate creation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After HTTP nginx configuration we will create Let's Encrypt certificate using
`__letsencrypt_cert `_ 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::
# create SSL cert
require="__package/nginx __sample_nginx_http_letsencrypt_and_ssl_redirect/$domain" \
__letsencrypt_cert --admin-email admin@test.ungleich.ch \
--webroot "$webroot" \
--automatic-renewal \
--renew-hook "service nginx reload" \
--domain "$domain" \
"$domain"
Configuring nginx HTTPS server with uWSGI upstream
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then we can configure nginx HTTPS server that will use created Let's Encrypt certificate::
# configure nginx
require="__package/nginx __letsencrypt_cert/$domain" \
__file "/etc/nginx/sites-enabled/https-$domain" \
--source - --mode 0644 << EOF
upstream _bottle {
server unix:$apphome/uwsgi.sock;
}
server {
listen 443;
listen [::]:443;
server_name $domain;
access_log /var/log/nginx/access.log;
ssl on;
ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;
client_max_body_size 256m;
location / {
try_files \$uri @uwsgi;
}
location @uwsgi {
include uwsgi_params;
uwsgi_pass _bottle;
}
}
EOF
Now our manifest is finished.
Complete __sample_bottle_hosting type manifest listing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is complete __sample_bottle_hosting type manifest listing,
located in ~/.cdist/type/__sample_bottle_hosting/manifest::
#!/bin/sh
os=$(cat "$__global/explorer/os")
case "$os" in
devuan)
:
;;
*)
echo "OS $os currently not supported" >&2
exit 1
;;
esac
projectname="$(cat "$__object/parameter/projectname")"
user="$(cat "$__object/parameter/user")"
home="/home/$user"
apphome="$home/app"
domain="$(cat "$__object/parameter/domain")"
# create user
__user "$user" --home "$home" --shell /bin/bash
# create user home dir
require="__user/$user" __directory "$home" \
--owner "$user" --group "$user" --mode 0755
# create app home dir
require="__user/$user __directory/$home" __directory "$apphome" \
--state present --owner "$user" --group "$user" --mode 0755
# define packages that need to be installed
packages_to_install="nginx uwsgi-plugin-python3 python3-dev python3-pip postgresql postgresql-contrib libpq-dev python3-venv uwsgi python3-psycopg2"
# update package index
__apt_update_index
# install packages
for package in $packages_to_install
do require="__apt_update_index" __package $package --state=present
done
# install pip3 packages
for package in bottle bottle-pgsql; do
__package_pip --pip pip3 $package
done
#PostgreSQL db & user
postgres_server=postgresql
# create PostgreSQL db user
require="__package/postgresql" __postgres_role $user --login --createdb
# create PostgreSQL db
require="__postgres_role/$user __package/postgresql" __postgres_database $user \
--owner $user
# configure uWSGI
require="__package/uwsgi" __file /etc/uwsgi/apps-enabled/$user.ini \
--owner root --group root --mode 0644 \
--state present \
--source - << EOF
[uwsgi]
socket = $apphome/uwsgi.sock
chdir = $apphome
wsgi-file = $projectname/wsgi.py
touch-reload = $projectname/wsgi.py
processes = 4
threads = 2
chmod-socket = 666
daemonize=true
vacuum = true
uid = $user
gid = $user
EOF
# setup nginx HTTP for Let's Encrypt and SSL redirect
domain="$(cat "$__object/parameter/domain")"
webroot="/var/www/html"
__sample_nginx_http_letsencrypt_and_ssl_redirect "$domain" --webroot "$webroot"
# create SSL cert
require="__package/nginx __sample_nginx_http_letsencrypt_and_ssl_redirect/$domain" \
__letsencrypt_cert --admin-email admin@test.ungleich.ch \
--webroot "$webroot" \
--automatic-renewal \
--renew-hook "service nginx reload" \
--domain "$domain" \
"$domain"
# configure nginx
require="__package/nginx __letsencrypt_cert/$domain" \
__file "/etc/nginx/sites-enabled/https-$domain" \
--source - --mode 0644 << EOF
upstream _bottle {
server unix:$apphome/uwsgi.sock;
}
server {
listen 443;
listen [::]:443;
server_name $domain;
access_log /var/log/nginx/access.log;
ssl on;
ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;
client_max_body_size 256m;
location / {
try_files \$uri @uwsgi;
}
location @uwsgi {
include uwsgi_params;
uwsgi_pass _bottle;
}
}
EOF
Creating __sample_bottle_hosting type gencode-remote
----------------------------------------------------
Now define **gencode-remote** 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::
echo "service uwsgi restart"
echo "service nginx restart"
Our **__sample_bottle_hosting** type is now finished.
Creating __sample_nginx_http_letsencrypt_and_ssl_redirect type
--------------------------------------------------------------
Let's now create **__sample_nginx_http_letsencrypt_and_ssl_redirect** type::
cd ~/.cdist/type
mkdir __sample_nginx_http_letsencrypt_and_ssl_redirect
cd __sample_nginx_http_letsencrypt_and_ssl_redirect
mkdir parameter
echo webroot > parameter/required
touch manifest
touch gencode-remote
Edit manifest::
domain="$__object_id"
webroot="$(cat "$__object/parameter/webroot")"
# make sure we have nginx package
__package nginx
# setup Let's Encrypt HTTP acme challenge, redirect HTTP to HTTPS
require="__package/nginx" __file "/etc/nginx/sites-enabled/http-$domain" \
--source - --mode 0644 << EOF
server {
listen *:80;
listen [::]:80;
server_name $domain;
# Let's Encrypt
location /.well-known/acme-challenge/ {
root $webroot;
}
# Everything else -> SSL
location / {
return 301 https://\$host\$request_uri;
}
}
EOF
Edit gencode-remote::
echo "service nginx reload"
Creating init manifest
----------------------
Next create init manifest::
cd ~/.cdist/manifest
printf "__sample_bottle_hosting --projectname sample --user app --domain \$__target_host sample\n" > sample
Using this init manifest our target host will be configured using our **__sample_bottle_hosting**
type with projectname *sample*, user *app* and domain equal to **__target_host**.
Here the last positional argument *sample* is type's object id. For details on
**__target_host** and **__object_id** see
`Environment variables (for reading) `_
reference.
Configuring host
----------------
Finally configure test.ungleich.ch::
cdist config -v -i ~/.cdist/manifest/sample test.ungleich.ch
After cdist configuration is successfully finished our host is ready.
Creating python bottle application
----------------------------------
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 hosing for specified user and project.
It is up to the user to create his/her applications.
Become app user::
su -l app
Preparing database
~~~~~~~~~~~~~~~~~~
We need to prepare database for our application. Create table and
insert some items::
psql -c "create table items (item varchar(255));"
psql -c "insert into items(item) values('spam');"
psql -c "insert into items(item) values('eggs');"
psql -c "insert into items(item) values('sausage');"
Creating application
~~~~~~~~~~~~~~~~~~~~
Next create sample app::
cd /home/app/app
mkdir sample
cd sample
Create app.py with the following content::
#!/usr/bin/env python3
import bottle
import bottle_pgsql
app = application = bottle.Bottle()
plugin = bottle_pgsql.Plugin('dbname=app user=app password=')
app.install(plugin)
@app.route('/')
def show_index(db):
db.execute('select * from items')
items = db.fetchall() or []
rv = 'Items: '
for item in items:
rv += '' + str(item['item']) + ' '
rv += ' '
return rv
if __name__ == '__main__':
bottle.run(app=app, host='0.0.0.0', port=8080)
Create wsgi.py with the following content::
import os
os.chdir(os.path.dirname(__file__))
import app
application = app.app
We have configured uWSGI with **touch-reload = $projectname/wsgi.py** so after
we have changed our **wsgi.py** file uWSGI reloads the application.
Our application selects and lists items from **items** table.
Openning application
~~~~~~~~~~~~~~~~~~~~
Finally try the application::
http://test.ungleich.ch/
It should redirect to HTTPS and return:
.. container:: highlight
.. raw:: html
Items:
What's next?
------------
Continue reading next sections ;)
cdist-6.0.2/docs/src/cdist-reference.rst.sh 000755 001751 001751 00000027421 13552030341 021022 0 ustar 00darko darko 000000 000000 #!/bin/sh
#
# 2010-2014 Nico Schottelius (nico-cdist at schottelius.org)
# 2014 Daniel Heule (hda at sfs.biz)
#
# This file is part of cdist.
#
# cdist is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cdist is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cdist. If not, see .
#
#
# Generate manpage that lists available types
#
__cdist_pwd="$(pwd -P)"
__cdist_mydir="${0%/*}";
__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)"
__cdist_myname=${0##*/};
__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
filename="${__cdist_myname%.sh}"
dest="$__cdist_abs_mydir/$filename"
cd "$__cdist_abs_mydir"
exec > "$dest"
cat << eof
Reference
=========
Variable, path and type reference for cdist
Explorers
---------
The following global explorers are available:
eof
(
cd ../../cdist/conf/explorer
for explorer in $(ls * | LC_ALL=C sort); do
echo "- $explorer"
done
)
cat << eof
Paths
-----
\$HOME/.cdist
The standard cdist configuration directory relative to your home directory.
This is usually the place you want to store your site specific configuration.
cdist/conf/
The distribution configuration directory.
This contains types and explorers to be used.
cdist/inventory/
The distribution inventory directory.
This path is relative to cdist installation directory.
cdist/preos/
The distribution PreOS plugins directory.
confdir
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).
confdir/files/
Cdist does not care about this directory besides providing access to it.
It is thought to be a general file storage area.
confdir/manifest/init
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.
confdir/manifest/*
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.
confdir/explorer/
Contains explorers to be run on the target hosts, see \`cdist explorer \`_.
confdir/type/
Contains all available types, which are used to provide
some kind of functionality. See \`cdist type \`_.
confdir/type//
Home of the type .
This directory is referenced by the variable __type (see below).
confdir/type//man.rst
Manpage in reStructuredText format (required for inclusion into upstream).
confdir/type//manifest
Used to generate additional objects from a type.
confdir/type//gencode-local
Used to generate code to be executed on the source host.
confdir/type//gencode-remote
Used to generate code to be executed on the target host.
confdir/type//parameter/required
Parameters required by type, \n separated list.
confdir/type//parameter/optional
Parameters optionally accepted by type, \n separated list.
confdir/type//parameter/default/*
Default values for optional parameters.
Assuming an optional parameter name of 'foo', it's default value would
be read from the file confdir/type//parameter/default/foo.
confdir/type//parameter/boolean
Boolean parameters accepted by type, \n separated list.
confdir/type//explorer
Location of the type specific explorers.
This directory is referenced by the variable __type_explorer (see below).
See \`cdist explorer \`_.
confdir/type//files
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).
out/
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).
out/explorer
Output of general explorers.
out/object
Objects created for the host.
out/object/
Contains all object specific information.
This directory is referenced by the variable __object (see below).
out/object//explorers
Output of type specific explorers, per object.
Types
-----
The following types are available:
eof
# If there is no such file then ls prints error to stderr,
# so redirect stderr to /dev/null.
for type in $(ls man7/cdist-type__*.rst 2>/dev/null | LC_ALL=C sort); do
no_dir="${type#man7/}";
no_type="${no_dir#cdist-type}";
name="${no_type%.rst}";
manref="${no_dir%.rst}"
man="${manref}(7)"
echo "- $name" "(\`${man} \`_)"
done
cat << eof
Objects
-------
For object to object communication and tests, the following paths are
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
(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
when the type was called.
Environment variables (for reading)
-----------------------------------
The following environment variables are exported by cdist:
__cdist_log_level, __cdist_log_level_name
cdist log level value and cdist log level name. One of:
+----------------+-----------------+
| Log level name | Log level value |
+================+=================+
| OFF | 60 |
+----------------+-----------------+
| ERROR | 40 |
+----------------+-----------------+
| WARNING | 30 |
+----------------+-----------------+
| INFO | 20 |
+----------------+-----------------+
| VERBOSE | 15 |
+----------------+-----------------+
| DEBUG | 10 |
+----------------+-----------------+
| TRACE | 5 |
+----------------+-----------------+
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.
__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)
-----------------------------------
The following environment variables influence the behaviour of cdist:
require
Setup dependencies between objects (see \`cdist manifest \`_).
__cdist_log_level
cdist log level value. One of:
+----------------+-----------------+
| Log level | Log level value |
+================+=================+
| OFF | 60 |
+----------------+-----------------+
| ERROR | 40 |
+----------------+-----------------+
| WARNING | 30 |
+----------------+-----------------+
| INFO | 20 |
+----------------+-----------------+
| VERBOSE | 15 |
+----------------+-----------------+
| DEBUG | 10 |
+----------------+-----------------+
| TRACE | 5 |
+----------------+-----------------+
If set cdist will set this log level in
accordance with configuration rules. If cdist invokation is used
in types then nested cdist will honor this specified log level if
not specified otherwise while invoking it.
CDIST_PATH
Colon delimited list of config directories.
CDIST_LOCAL_SHELL
Use this shell locally instead of /bin/sh to execute scripts.
CDIST_REMOTE_SHELL
Use this shell remotely instead of /bin/sh to execute scripts.
CDIST_OVERRIDE
Allow overwriting type parameters (see \`cdist manifest \`_).
CDIST_ORDER_DEPENDENCY
Create dependencies based on the execution order (see \`cdist manifest \`_).
Read also about \`perils of CDIST_ORDER_DEPENDENCY \`_.
CDIST_REMOTE_EXEC
Use this command for remote execution (should behave like ssh).
CDIST_REMOTE_COPY
Use this command for remote copy (should behave like scp).
CDIST_INVENTORY_DIR
Use this directory as inventory directory.
CDIST_BETA
Enable beta functionalities.
CDIST_CACHE_PATH_PATTERN
Custom cache path pattern.
eof
cdist-6.0.2/docs/src/cdist-remote-exec-copy.rst 000644 001751 001751 00000002200 13552030341 021621 0 ustar 00darko darko 000000 000000 Remote exec and copy commands
=============================
Cdist interacts with the target host in two ways:
- it executes code (__remote_exec)
- and it copies files (__remote_copy)
By default this is accomplished with ssh and scp respectively.
The default implementations used by cdist are::
__remote_exec: ssh -o User=root
__remote_copy: scp -o User=root
The user can override these defaults by providing custom implementations and
passing them to cdist with the --remote-exec and/or --remote-copy arguments.
For __remote_exec, the custom implementation must behave as if it where ssh.
For __remote_copy, it must behave like scp.
Please notice, custom implementations should work like ssh/scp so __remote_copy
must support IPv6 addresses enclosed in square brackets. For __remote_exec you
must take into account that for some options (like -L) IPv6 addresses can be
specified by enclosed in square brackets (see :strong:`ssh`\ (1) and
:strong:`scp`\ (1)).
With this simple interface the user can take total control of how cdist
interacts with the target when required, while the default implementation
remains as simple as possible.
cdist-6.0.2/docs/src/cdist-saving-output-streams.rst 000644 001751 001751 00000006450 13552030341 022750 0 ustar 00darko darko 000000 000000 Saving output streams
=====================
Description
-----------
Since version 4.8.0 cdist, by default, saves output streams to local cache.
Saving output streams is implemented because important information was lost
during a config run, hidden in all other output.
Now all created output is bound to the context where it was produced.
Saving output streams include stdout and stderr of init manifest, remote
commands and for each object stdout and stderr of manifest, gencode-\* and code-\*.
Output stream files are created only if some output is produced. For more info
on these cache files see `Local cache overview `_.
Also, in case of an error, cdist can now exit and show all information it has
about the error.
For example:
.. code-block:: sh
$ ./bin/cdist config -v -i ~/.cdist/manifest/init-output-streams $(cat ~/ungleich/data/opennebula-debian9-test )
INFO: 185.203.112.42: Starting configuration run
INFO: 185.203.112.42: Processing __myline/test
ERROR: 185.203.112.42: Command failed: '/bin/sh -e /tmp/tmpow6cwemh/75ee6a79e32da093da23fe4a13dd104b/data/object/__myline/test/.cdist-kisrqlpw/code-local'
return code: 1
---- BEGIN stdout ----
---- END stdout ----
Error processing object '__myline/test'
========================================
name: __myline/test
path: /tmp/tmpow6cwemh/75ee6a79e32da093da23fe4a13dd104b/data/object/__myline/test/.cdist-kisrqlpw
source: /home/darko/.cdist/manifest/init-output-streams
type: /tmp/tmpow6cwemh/75ee6a79e32da093da23fe4a13dd104b/data/conf/type/__myline
---- BEGIN manifest:stderr ----
myline manifest stderr
---- END manifest:stderr ----
---- BEGIN gencode-remote:stderr ----
test gencode-remote error
---- END gencode-remote:stderr ----
---- BEGIN code-local:stderr ----
error
---- END code-local:stderr ----
ERROR: cdist: Failed to configure the following hosts: 185.203.112.42
Upon successful run execution state is saved to local cache and temporary
directory is removed.
In case of an error temporary directory is not removed and can be further
discovered.
There is also an option :strong:`-S/--disable-saving-output-streams` for
disabling saving output streams. In this case error reporting can look
like this:
.. code-block:: sh
$ ./bin/cdist config -v -S -i ~/.cdist/manifest/init-output-streams $(cat ~/ungleich/data/opennebula-debian9-test )
INFO: 185.203.112.42: Starting configuration run
test stdout output streams
test stderr output streams
myline manifest stdout
myline manifest stderr
test gencode-remote error
INFO: 185.203.112.42: Processing __myline/test
error
ERROR: 185.203.112.42: Command failed: '/bin/sh -e /tmp/tmpzomy0wis/75ee6a79e32da093da23fe4a13dd104b/data/object/__myline/test/.cdist-n566pqut/code-local'
return code: 1
---- BEGIN stdout ----
---- END stdout ----
Error processing object '__myline/test'
========================================
name: __myline/test
path: /tmp/tmpzomy0wis/75ee6a79e32da093da23fe4a13dd104b/data/object/__myline/test/.cdist-n566pqut
source: /home/darko/.cdist/manifest/init-output-streams
type: /tmp/tmpzomy0wis/75ee6a79e32da093da23fe4a13dd104b/data/conf/type/__myline
ERROR: cdist: Failed to configure the following hosts: 185.203.112.42
cdist-6.0.2/docs/src/cdist-stages.rst 000644 001751 001751 00000005032 13552030341 017730 0 ustar 00darko darko 000000 000000 Execution stages
================
Description
-----------
When cdist is started, it passes through different stages.
Stage 1: target information retrieval
-------------------------------------
In this stage information is collected about the target host using so called
explorers. Every existing explorer is run on the target and the output of all
explorers are copied back into the local cache. The results can be used by
manifests and types.
Stage 2: run the initial manifest
---------------------------------
The initial manifest, which should be used for mappings of hosts to types,
is executed. This stage creates objects in a cconfig database that contains
the objects as defined in the manifest for the specific host. In this stage,
no conflicts may occur, i.e. no object of the same type with the same id may
be created, if it has different parameters.
Stage 3: object information retrieval
-------------------------------------
Every object is checked whether its type has explorers and if so, these are
executed on the target host. The results are transferred back
and can be used in the following stages to decide what changes need to be made
on the target to implement the desired state.
Stage 4: run the object manifest
--------------------------------
Every object is checked whether its type has a executable manifest. The
manifest script may generate and change the created objects. In other words,
one type can reuse other types.
For instance the object __apache/www.example.org is of type __apache, which may
contain a manifest script, which creates new objects of type __file.
The newly created objects are merged back into the existing tree. No conflicts
may occur during the merge. A conflict would mean that two different objects
try to create the same object, which indicates a broken configuration.
Stage 5: code generation
------------------------
In this stage for every created object its type is checked for executable
gencode scripts. The gencode scripts generate the code to be executed on the
target on stdout. If the gencode executables fail, they must print diagnostic
messages on stderr and exit non-zero.
Stage 6: code execution
-----------------------
For every object the resulting code from the previous stage is transferred to
the target host and executed there to apply the configuration changes.
Stage 7: cache
--------------
The cache stores the information from the current run for later use.
Summary
-------
If, and only if, all the stages complete without errors, the configuration
will be applied to the target.
cdist-6.0.2/docs/src/cdist-support.rst 000644 001751 001751 00000001147 13552030341 020161 0 ustar 00darko darko 000000 000000 Support
-------
Chat
~~~~
Chat with us: `ungleich chat `_.
Mailing list
~~~~~~~~~~~~
Bug reports, questions, patches, etc. should be send to the
`cdist mailing list `_.
Linkedin
~~~~~~~~
If you have an account
at `Linked in `_,
you can join the
`cdist group `_.
Commercial support
~~~~~~~~~~~~~~~~~~
You can request commercial support for cdist from
`ungleich `_.
cdist-6.0.2/docs/src/cdist-troubleshooting.rst 000644 001751 001751 00000003415 13552030341 021674 0 ustar 00darko darko 000000 000000 Troubleshooting
===============
Error in manifest is not considered an error by cdist
-----------------------------------------------------
Situation: You are executing other scripts from a manifest.
This script fails, but cdist does not recognise the error.
An example script would be something like this:
.. code-block:: sh
% cat ~/.cdist/manifest/init
"$__manifest/special"
% cat ~/.cdist/manifest/special
#!/bin/sh
echo "Here is an unclean exiting script"
somecommandthatdoesnotexist
echo "I continue here although previous command failed"
We can clearly see that **somecommandthatdoesnotexist**
will fail in ~/.cdist/manifest/special. But as the custom
script is not called with the -e flag (exit on failure) of shell,
it does not lead to an error. And thus cdist sees the exit 0
code of the last echo line instead of the failing command.
All scripts executed by cdist carry the -e flag.
To prevent the above from happening, there are three solutions available,
two of which can be used in the calling script:
.. code-block:: sh
# Execute as before, but abort on failure
sh -e "$__manifest/special"
# Source the script in our namespace, runs in a set -e environment:
. "$__manifest/special"
The third solution is to include a shebang header in every script
you write to use the -e flag:
.. code-block:: sh
% cat ~/.cdist/manifest/special
#!/bin/sh -e
...
Using debug dump helper script
------------------------------
Since cdist stores data to local cache that can be used for debugging there
is a helper script that dumps data from local cache,
`cdist-dump `_.
For more info see:
.. code-block:: sh
cdist-dump -h
Or from cdist git cloned directory:
.. code-block:: sh
./scripts/cdist-dump -h
cdist-6.0.2/docs/src/cdist-types.rst 000644 001751 001751 00000000113 13552030341 017601 0 ustar 00darko darko 000000 000000 cdist types
===========
.. toctree::
:titlesonly:
:glob:
man7/*
cdist-6.0.2/docs/src/cdist-upgrade.rst 000644 001751 001751 00000012513 13552030341 020073 0 ustar 00darko darko 000000 000000 How to upgrade cdist
====================
Update the git installation
---------------------------
To upgrade cdist in the current branch use
.. code-block:: sh
git pull
# Also update the manpages
./build man
export MANPATH=$MANPATH:$(pwd -P)/doc/man
If you stay on a version branche (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.
Safely upgrading to new versions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To upgrade to **any** further cdist version, you can take the
following procedure to do a safe upgrade:
.. code-block:: sh
# Create new branch to try out the update
git checkout -b upgrade_cdist
# Get latest cdist version in git database
git fetch -v
# see what will happen on merge - replace
# master with the branch you plan to merge
git diff upgrade_cdist..origin/master
# Merge the new version
git merge origin/master
Now you can ensure all custom types work with the new version.
Assume that you need to go back to an older version during
the migration/update, you can do so as follows:
.. code-block:: sh
# commit changes
git commit -m ...
# go back to original branch
git checkout master
After that, you can go back and continue the upgrade:
.. code-block:: sh
# git checkout upgrade_cdist
Update the python package
-------------------------
To upgrade to the lastet version do
.. code-block:: sh
pip install --upgrade cdist
General update instructions
---------------------------
Updating from 3.0 to 3.1
~~~~~~~~~~~~~~~~~~~~~~~~
The type **\_\_ssh_authorized_keys** now also manages existing keys,
not only the ones added by cdist.
Updating from 2.3 to 3.0
~~~~~~~~~~~~~~~~~~~~~~~~
The **changed** attribute of objects has been removed.
Use `messaging `_ instead.
Updating from 2.2 to 2.3
~~~~~~~~~~~~~~~~~~~~~~~~
No incompatibilities.
Updating from 2.1 to 2.2
~~~~~~~~~~~~~~~~~~~~~~~~
Starting with 2.2, the syntax for requiring a singleton type changed:
Old format:
.. code-block:: sh
require="__singleton_type/singleton" ...
New format:
.. code-block:: sh
require="__singleton_type" ...
Internally the "singleton" object id was dropped to make life more easy.
You can probably fix your configuration by running the following code
snippet (currently untested, please report back if it works for you):
.. code-block:: sh
find ~/.cdist/* -type f -exec sed -i 's,/singleton,,' {} \;
Updating from 2.0 to 2.1
~~~~~~~~~~~~~~~~~~~~~~~~
Have a look at the update guide for [[2.0 to 2.1|2.0-to-2.1]].
* Type **\_\_package* and \_\_process** use --state **present** or **absent**.
The states **removed/installed** and **stopped/running** have been removed.
Support for the new states is already present in 2.0.
* Type **\_\_directory**: Parameter --parents and --recursive are now boolean
The old "yes/no" values need to be removed.
* Type **\_\_rvm_ruby**: Parameter --default is now boolean
The old "yes/no" values need to be removed.
* Type **\_\_rvm_gemset**: Parameter --default is now boolean
The old "yes/no" values need to be removed.
* Type **\_\_addifnosuchline** and **\_\_removeline** have been replaced by **\_\_line**
* The **conf** directory is now located at **cdist/conf**.
You need to migrate your types, explorers and manifests
manually to the new location.
* Replace the variable **\_\_self** by **\_\_object_name**
Support for the variable **\_\_object_name** is already present in 2.0.
* The types **\_\_autofs**, **\_\_autofs_map** and **\_\_autofs_reload** have been removed
(no maintainer, no users)
* Type **\_\_user**: Parameter --groups removed (use the new \_\_user_groups type)
* Type **\_\_ssh_authorized_key** has been replaced by more flexible type
**\_\_ssh_authorized_keys**
Updating from 1.7 to 2.0
~~~~~~~~~~~~~~~~~~~~~~~~
* Ensure python (>= 3.2) is installed on the source host
* Use "cdist config host" instead of "cdist-deploy-to host"
* Use "cdist config -p host1 host2" instead of "cdist-mass-deploy"
* Use "cdist banner" for fun
* Use **\_\_object_name** instead of **\_\_self** in manifests
Updating from 1.6 to 1.7
~~~~~~~~~~~~~~~~~~~~~~~~
* If you used the global explorer **hardware_type**, you need to change
your code to use **machine** instead.
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
to --state removed.
Updating from 1.3 to 1.5
~~~~~~~~~~~~~~~~~~~~~~~~
No incompatibilities.
Updating from 1.2 to 1.3
~~~~~~~~~~~~~~~~~~~~~~~~
Rename **gencode** of every type to **gencode-remote**.
Updating from 1.1 to 1.2
~~~~~~~~~~~~~~~~~~~~~~~~
No incompatibilities.
Updating from 1.0 to 1.1
~~~~~~~~~~~~~~~~~~~~~~~~
In 1.1 the type **\_\_file** was split into **\_\_directory**, **\_\_file** and
**\_\_link**. The parameter **--type** was removed from **\_\_file**. Thus you
need to replace **\_\_file** calls in your manifests:
* Remove --type from all \_\_file calls
* If type was symlink, use \_\_link and --type symbolic
* If type was directory, use \_\_directory
cdist-6.0.2/docs/src/cdist-why.rst 000644 001751 001751 00000005016 13552030341 017253 0 ustar 00darko darko 000000 000000 Why should I use cdist?
=======================
There are several motivations to use cdist, these
are probably the most popular ones.
Known language
--------------
Cdist is being configured in
`shell script `_.
Shell script is used by UNIX system engineers for decades.
So when cdist is introduced, your staff does not need to learn a new
`DSL `_
or programming language.
Powerful language
-----------------
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
* High level string manipulation (using sed, awk, grep)
* Conditional support (**if, case**)
* Loop support (**for, while**)
* Support for dependencies between cdist types
More than shell scripting
-------------------------
If you compare regular shell scripting with cdist, there is one major
difference: When using cdist types,
the results are
`idempotent `_.
In practise that means it does not matter in which order you
call cdist types, the result is always the same.
Zero dependency configuration management
----------------------------------------
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
(**/bin/sh**). Compared to other configuration management systems,
it does not require to open up an additional port.
Push based distribution
-----------------------
Cdist uses the push based model for configuration. In this
scenario, one (or more) computers connect to the target hosts
and apply the configuration. That way the source host has
very little requirements: Cdist can even run on a sysadmin
notebook that is loosely connected to the network and has
limited amount of resources.
Furthermore, from a security point of view, only one machine
needs access to the target hosts. No target hosts will ever
need to connect back to the source host, which contains the
full configuration.
Highly scalable
---------------
If at some point you manage more hosts than can be handled from
a single source host, you can simply add more resources: Either
add more cores to one host or add hosts.
Cdist will utilise the given resources in parallel.
cdist-6.0.2/docs/src/conf.py 000644 001751 001751 00000024352 13552030341 016111 0 ustar 00darko darko 000000 000000 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# cdist-docs documentation build configuration file, created by
# sphinx-quickstart on Fri May 6 21:45:28 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys
import os
import sphinx_rtd_theme
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath(os.path.join(
os.path.dirname(os.path.realpath(__file__)), "..", "..")))
# Import cdist after sys.path fixup above.
import cdist.version # nopep8 - ignore error that import is not at top
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'cdist.sphinxext.manpage',
'sphinx.ext.extlinks',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = ['.rst']
# The encoding of source files.
# source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'cdist'
copyright = 'ungleich GmbH 2019'
# author = 'Darko Poljak'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = cdist.version.VERSION
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The reST default role (used for this markup: `text`) to use for all
# documents.
# default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
# add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
# show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
# If true, keep warnings as "system message" paragraphs in the built documents.
# keep_warnings = False
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
# The name for this set of Sphinx documents.
# " v documentation" by default.
# html_title = 'cdist-docs v0.0.1'
# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = '_static/cdist-logo.jpeg'
# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico)
# being 16x16 or 32x32
# pixels large.
# html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
# html_extra_path = []
# If not None, a 'Last updated on:' timestamp is inserted at every page
# bottom, using the given strftime format.
# The empty string is equivalent to '%b %d, %Y'.
# html_last_updated_fmt = None
# Custom sidebar templates, maps document names to template names.
# html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
# html_additional_pages = {}
# If false, no module index is generated.
# html_domain_indices = True
# If false, no index is generated.
# html_use_index = True
# If true, the index is split into individual pages for each letter.
# html_split_index = False
# If true, links to the reST sources are added to the pages.
# html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
# html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
# html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
# html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
# html_file_suffix = None
# html_file_suffix = ""
# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
# html_search_language = 'en'
# A dictionary with options for the search language support, empty by default.
# 'ja' uses this config value.
# 'zh' user can custom change `jieba` dictionary path.
# html_search_options = {'type': 'default'}
# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
# html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = 'cdistdoc'
# -- Options for LaTeX output ---------------------------------------------
# latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Latex figure (float) alignment
# 'figure_align': 'htbp',
# }
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'cdist.tex', 'cdist Documentation',
'Darko Poljak', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
root_mandir = os.path.dirname(os.path.realpath(__file__))
mandirs = []
for mansubdir in ('man1', 'man7'):
mandirs.append((os.path.join(root_mandir, mansubdir), mansubdir[-1]))
man_pages = []
for mandir, section in mandirs:
for root, dirs, files in os.walk(mandir):
for fname in files:
froot, fext = os.path.splitext(fname)
if fext == '.rst':
man_page = (os.path.join('man' + str(section), froot),
froot, '', [], section)
man_pages.append(man_page)
# man_pages = [
# ('cdist-type', 'cdist-type', 'cdist-type documentation',
# [author], 1),
# ('man7/cdist-type__file', 'cdist-type__file',
# '', [], 1),
# ('cdist-type__directory', 'cdist-type__directory',
# 'cdist-type__directory documentation', [author], 1),
# ]
# If true, show URL addresses after external links.
# man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'cdist', 'cdist Documentation',
'', 'cdist', 'Configuration management system.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
cdist-6.0.2/docs/src/docutils.conf 000644 001751 001751 00000000036 13552030341 017300 0 ustar 00darko darko 000000 000000 [parsers]
smart_quotes: false
cdist-6.0.2/docs/src/index.rst 000644 001751 001751 00000001541 13552030341 016446 0 ustar 00darko darko 000000 000000 cdist - usable configuration management
=======================================
cdist is a usable configuration management system.
It adheres to the KISS principle and
is being used in small up to enterprise grade environments.
.. toctree::
:maxdepth: 3
:glob:
:numbered:
:hidden:
cdist-why
cdist-features
cdist-os
cdist-install
cdist-upgrade
cdist-support
cdist-quickstart
cdist-real-world
man1/cdist
man1/cdist-dump
man1/cdist-new-type
cdist-bootstrap
cdist-configuration
cdist-manifest
cdist-type
cdist-types
cdist-explorer
cdist-messaging
cdist-parallelization
cdist-inventory
cdist-preos
cdist-integration
cdist-reference
cdist-best-practice
cdist-stages
cdist-cache
cdist-saving-output-streams
cdist-remote-exec-copy
cdist-hacker
cdist-troubleshooting
cdist-6.0.2/docs/src/man1/ 000755 001751 001751 00000000000 13552030341 015440 5 ustar 00darko darko 000000 000000 cdist-6.0.2/docs/src/man1/cdist-dump.rst 000644 001751 001751 00000003100 13552030341 020235 0 ustar 00darko darko 000000 000000 cdist-dump(1)
=============
NAME
----
cdist-dump - Dump data from local cdist cache
SYNOPSIS
--------
::
cdist-dump [options] [host...]
DESCRIPTION
-----------
cdist-dump is a helper script that dumps data from local cdist cache for
specified hosts. If host is not specified then all data from cache directory
is dumped. Default cache directory is '~/.cdist/cache'.
cdist-dump can be used for debugging existing types, host configuration and
new types.
OPTIONS
-------
**-a**
dump all
**-C CACHE-DIR**
use specified CACHE-DIR (default: ~/.cdist/cache)
**-c**
dump code-*
**-d DELIMITER**
delimiter used for filename and line number prefix (default: ':')
**-E**
dump global explorers
**-e**
dump type explorers
**-F**
disable filename prefix (enabled by default)
**-f**
enable filename prefix (default)
**-g**
dump gencode-*
**-h**
show this help screen and exit
**-L**
disable line number prefix (default)
**-l**
enable line number prefix (disabled by default)
**-m**
dump messages
**-o**
dump executions' stdout
**-p**
dump parameters
**-r**
dump executions' stderr
**-V**
show version and exit
**-v**
increase verbosity
EXAMPLES
--------
.. code-block:: sh
# Dump all
% cdist-dump -a
# Dump only code-* output
% cdist-dump -c
SEE ALSO
--------
:strong:`cdist`\ (1)
AUTHORS
-------
Darko Poljak
COPYING
-------
Copyright \(C) 2019 Darko Poljak. Free use of this software is
granted under the terms of the GNU General Public License v3 or later (GPLv3+).
cdist-6.0.2/docs/src/man1/cdist-new-type.rst 000644 001751 001751 00000002404 13552030341 021046 0 ustar 00darko darko 000000 000000 cdist-new-type(1)
=================
NAME
----
cdist-new-type - Create new type skeleton
SYNOPSIS
--------
::
cdist-new-type TYPE-NAME AUTHOR-NAME AUTHOR-EMAIL [TYPE-BASE-PATH]
DESCRIPTION
-----------
cdist-new-type is a helper script that creates new type skeleton.
It is then up to the type author to finish the type.
It creates skeletons for the following files:
* man.rst
* manifest
* gencode-remote.
Upon creation it prints the path to the newly created type directory.
ARGUMENTS
---------
**TYPE-NAME**
Name of the new type.
**AUTHOR-NAME**
Type author's full name.
**AUTHOR-NAME**
Type author's email.
**TYPE-BASE-PATH**
Path to the base directory of the type. If not set it defaults
to '$PWD/type'.
EXAMPLES
--------
.. code-block:: sh
# Create new type __foo in ~/.cdist directory.
$ cd ~/.cdist
$ cdist-new-type '__foo' 'Foo Bar' 'foo.bar at foobar.org'
/home/foo/.cdist/type/__foo
SEE ALSO
--------
:strong:`cdist`\ (1)
AUTHORS
-------
| Steven Armstrong
| Darko Poljak
COPYING
-------
Copyright \(C) 2019 Steven Armstrong, Darko Poljak. Free use of this software is
granted under the terms of the GNU General Public License v3 or later (GPLv3+).
cdist-6.0.2/docs/src/man1/cdist.rst 000644 001751 001751 00000071226 13552030341 017310 0 ustar 00darko darko 000000 000000 cdist(1)
========
NAME
----
cdist - Usable Configuration Management
SYNOPSIS
--------
::
cdist [-h] [-V] {banner,config,install,inventory,preos,shell} ...
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]
[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]
[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]
[host [host ...]]
cdist inventory add-tag [-h] [-l LOGLEVEL] [-q] [-v] [-b]
[-g CONFIG_FILE] [-I INVENTORY_DIR]
[-f HOSTFILE] [-T TAGFILE] [-t TAGLIST]
[host [host ...]]
cdist inventory del-host [-h] [-l LOGLEVEL] [-q] [-v] [-b]
[-g CONFIG_FILE] [-I INVENTORY_DIR] [-a]
[-f HOSTFILE]
[host [host ...]]
cdist inventory del-tag [-h] [-l LOGLEVEL] [-q] [-v] [-b]
[-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]
[host [host ...]]
cdist preos [-h] preos
cdist preos debian [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-a ARCH] [-B]
[-C] [-c CDIST_PARAMS] [-D DRIVE] [-e REMOTE_EXEC]
[-i MANIFEST] [-k KEYFILE ] [-m MIRROR]
[-P ROOT_PASSWORD] [-p PXE_BOOT_DIR] [-r]
[-S SCRIPT] [-s SUITE] [-y REMOTE_COPY]
target_dir
cdist preos devuan [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-a ARCH] [-B]
[-C] [-c CDIST_PARAMS] [-D DRIVE] [-e REMOTE_EXEC]
[-i MANIFEST] [-k KEYFILE ] [-m MIRROR]
[-P ROOT_PASSWORD] [-p PXE_BOOT_DIR] [-r]
[-S SCRIPT] [-s SUITE] [-y REMOTE_COPY]
target_dir
cdist preos ubuntu [-h] [-l LOGLEVEL] [-q] [-v] [-b] [-a ARCH] [-B]
[-C] [-c CDIST_PARAMS] [-D DRIVE] [-e REMOTE_EXEC]
[-i MANIFEST] [-k KEYFILE ] [-m MIRROR]
[-P ROOT_PASSWORD] [-p PXE_BOOT_DIR] [-r]
[-S SCRIPT] [-s SUITE] [-y REMOTE_COPY]
target_dir
cdist shell [-h] [-l LOGLEVEL] [-q] [-v] [-s SHELL]
DESCRIPTION
-----------
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.
GENERAL
-------
All commands accept the following options:
**-h, --help**
Show the help screen.
**-l LOGLEVEL, --log-level LOGLEVEL**
Set the specified verbosity level. The levels, in
order from the lowest to the highest, are: ERROR (-1),
WARNING (0), INFO (1), VERBOSE (2), DEBUG (3) TRACE (4
or higher). If used along with -v then -v increases
last set value and -l overwrites last set value.
**-q, --quiet**
Quiet mode: disables logging, including WARNING and ERROR.
**-v, --verbose**
Increase the verbosity level. Every instance of -v
increments the verbosity level by one. Its default
value is 0 which includes ERROR and WARNING levels.
The levels, in order from the lowest to the highest,
are: ERROR (-1), WARNING (0), INFO (1), VERBOSE (2),
DEBUG (3) TRACE (4 or higher). If used along with -l
then -l overwrites last set value and -v increases
last set value.
**-V, --version**
Show version and exit.
BANNER
------
Displays the cdist banner. Useful for printing
cdist posters - a must have for every office.
CONFIG/INSTALL
--------------
Configure/install one or more hosts.
Install command is currently in beta.
**-4, --force-ipv4**
Force to use IPv4 addresses only. No influence for
custom remote commands.
**-6, --force-ipv6**
Force to use IPv6 addresses only. No influence for
custom remote commands.
**-A, --all-tagged**
Use all hosts present in tags db. Currently in beta.
**-a, --all**
List hosts that have all specified tags, if -t/--tag
is specified.
**-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
:strong:`CACHE PATH PATTERN FORMAT` below.
**-c CONF_DIR, --conf-dir CONF_DIR**
Add a configuration directory. Can be specified multiple times.
If configuration directories contain conflicting types, explorers or
manifests, then the last one found is used.
**-f HOSTFILE, --file HOSTFILE**
Read specified file for a list of additional hosts to operate on
or if '-' is given, read stdin (one host per line).
If no host or host file is specified then, by default,
read hosts from stdin. For the file format see
:strong:`HOSTFILE FORMAT` below.
**-g CONFIG_FILE, --config-file CONFIG_FILE**
Use specified custom configuration file.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
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
inventory directory is used.
**-i MANIFEST, --initial-manifest MANIFEST**
Path to a cdist manifest or - to read from stdin.
**-j [JOBS], --jobs [JOBS]**
Operate in parallel in specified maximum number of
jobs. Global explorers, object prepare and object run
are supported. Without argument CPU count is used by
default.
**-n, --dry-run**
Do not execute code.
**-o OUT_PATH, --out-dir OUT_PATH**
Directory to save cdist output in.
**-P, --timestamp**
Timestamp log messages with the current local date and time
in the format: YYYYMMDDHHMMSS.us.
**-p [HOST_MAX], --parallel [HOST_MAX]**
Operate on multiple hosts in parallel for specified
maximum hosts at a time. Without argument CPU count is
used by default.
**-R [{tar,tgz,tbz2,txz}], --use-archiving [{tar,tgz,tbz2,txz}]**
Operate by using archiving with compression where
appropriate. Supported values are: tar - tar archive,
tgz - gzip tar archive (the default), tbz2 - bzip2 tar
archive and txz - lzma tar archive. Currently in beta.
**-r REMOTE_OUT_PATH, --remote-out-dir REMOTE_OUT_PATH**
Directory to save cdist output in on the target host.
**-S, --disable-saving-output-streams**
Disable saving output streams.
**-s, --sequential**
Operate on multiple hosts sequentially (default).
**--remote-copy REMOTE_COPY**
Command to use for remote copy (should behave like scp).
**--remote-exec REMOTE_EXEC**
Command to use for remote execution (should behave like ssh).
**-t, --tag**
Host is specified by tag, not hostname/address; list
all hosts that contain any of specified tags.
Currently in beta.
HOSTFILE FORMAT
~~~~~~~~~~~~~~~
The HOSTFILE contains one host per line.
A comment is started with '#' and continues to the end of the line.
Any leading and trailing whitespace on a line is ignored.
Empty lines are ignored/skipped.
The Hostfile lines are processed as follows. First, all comments are
removed. Then all leading and trailing whitespace characters are stripped.
If such a line results in empty line it is ignored/skipped. Otherwise,
host string is used.
CACHE PATH PATTERN FORMAT
~~~~~~~~~~~~~~~~~~~~~~~~~
Cache path pattern specifies path for a cache directory subdirectory.
In the path, '%N' will be substituted by the target host, '%h' will
be substituted by the calculated host directory, '%P' will be substituted
by the current process id. All format codes that
:strong:`python` :strong:`datetime.strftime()` function supports, except
'%h', are supported. These date/time directives format cdist config/install
start time.
If empty pattern is specified then default calculated host directory
is used.
Calculated host directory is a hash of a host cdist operates on.
Resulting path is used to specify cache path subdirectory under which
current host cache data are saved.
INVENTORY
---------
Manage inventory database.
Currently in beta with all sub-commands.
INVENTORY ADD-HOST
------------------
Add host(s) to inventory database.
**host**
Host(s) to add.
**-b, --beta**
Enable beta functionality.
**-f HOSTFILE, --file HOSTFILE**
Read additional hosts to add from specified file or
from stdin if '-' (each host on separate line). If no
host or host file is specified then, by default, read
from stdin. Hostfile format is the same as config hostfile format.
**-g CONFIG_FILE, --config-file CONFIG_FILE**
Use specified custom configuration file.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
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
inventory directory is used.
INVENTORY ADD-TAG
-----------------
Add tag(s) to inventory database.
**host**
List of host(s) for which tags are added.
**-b, --beta**
Enable beta functionality.
**-f HOSTFILE, --file HOSTFILE**
Read additional hosts to add tags from specified file
or from stdin if '-' (each host on separate line). If
no host or host file is specified then, by default,
read from stdin. If no tags/tagfile nor hosts/hostfile
are specified then tags are read from stdin and are
added to all hosts. Hostfile format is the same as config hostfile format.
**-g CONFIG_FILE, --config-file CONFIG_FILE**
Use specified custom configuration file.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
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
inventory directory is used.
**-T TAGFILE, --tag-file TAGFILE**
Read additional tags to add from specified file or
from stdin if '-' (each tag on separate line). If no
tag or tag file is specified then, by default, read
from stdin. If no tags/tagfile nor hosts/hostfile are
specified then tags are read from stdin and are added
to all hosts. Tagfile format is the same as config hostfile format.
**-t TAGLIST, --taglist TAGLIST**
Tag list to be added for specified host(s), comma
separated values.
INVENTORY DEL-HOST
------------------
Delete host(s) from inventory database.
**host**
Host(s) to delete.
**-a, --all**
Delete all hosts.
**-b, --beta**
Enable beta functionality.
**-f HOSTFILE, --file HOSTFILE**
Read additional hosts to delete from specified file or
from stdin if '-' (each host on separate line). If no
host or host file is specified then, by default, read
from stdin. Hostfile format is the same as config hostfile format.
**-g CONFIG_FILE, --config-file CONFIG_FILE**
Use specified custom configuration file.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
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
inventory directory is used.
INVENTORY DEL-TAG
-----------------
Delete tag(s) from inventory database.
**host**
List of host(s) for which tags are deleted.
**-a, --all**
Delete all tags for specified host(s).
**-b, --beta**
Enable beta functionality.
**-f HOSTFILE, --file HOSTFILE**
Read additional hosts to delete tags for from
specified file or from stdin if '-' (each host on
separate line). If no host or host file is specified
then, by default, read from stdin. If no tags/tagfile
nor hosts/hostfile are specified then tags are read
from stdin and are deleted from all hosts. Hostfile
format is the same as config hostfile format.
**-g CONFIG_FILE, --config-file CONFIG_FILE**
Use specified custom configuration file.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
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
inventory directory is used.
**-T TAGFILE, --tag-file TAGFILE**
Read additional tags from specified file or from stdin
if '-' (each tag on separate line). If no tag or tag
file is specified then, by default, read from stdin.
If no tags/tagfile nor hosts/hostfile are specified
then tags are read from stdin and are added to all
hosts. Tagfile format is the same as config hostfile format.
**-t TAGLIST, --taglist TAGLIST**
Tag list to be deleted for specified host(s), comma
separated values.
INVENTORY LIST
--------------
List inventory database.
**host**
Host(s) to list.
**-a, --all**
List hosts that have all specified tags, if -t/--tag
is specified.
**-b, --beta**
Enable beta functionality.
**-f HOSTFILE, --file HOSTFILE**
Read additional hosts to list from specified file or
from stdin if '-' (each host on separate line). If no
host or host file is specified then, by default, list
all. Hostfile format is the same as config hostfile format.
**-g CONFIG_FILE, --config-file CONFIG_FILE**
Use specified custom configuration file.
**-H, --host-only**
Suppress tags listing.
**-I INVENTORY_DIR, --inventory INVENTORY_DIR**
Use specified custom inventory directory. Inventory
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
inventory directory is used.
**-t, --tag**
Host is specified by tag, not hostname/address; list
all hosts that contain any of specified tags.
PREOS
-----
Create PreOS. Currently, the following PreOS-es are supported:
* debian
* ubuntu
* devuan
PREOS DEBIAN/DEVUAN
-------------------
**target_dir**
target directory where PreOS will be bootstrapped
**-a ARCH, --arch ARCH**
target debootstrap architecture, by default 'amd64'
**-B, --bootstrap**
do bootstrap step
**-b, --beta**
Enable beta functionality.
**-C, --configure**
do configure step
**-c CDIST_PARAMS, --cdist-params CDIST_PARAMS**
parameters that will be passed to cdist config, by
default '-v' is used
**-D DRIVE, --drive-boot DRIVE**
create bootable PreOS on specified drive
**-e REMOTE_EXEC, --remote-exec REMOTE_EXEC**
remote exec that cdist config will use, by default
internal script is used
**-i MANIFEST, --init-manifest MANIFEST**
init manifest that cdist config will use, by default
internal init manifest is used
**-k KEYFILE, --keyfile KEYFILE**
ssh key files that will be added to cdist config;
'``__ssh_authorized_keys root ...``' type is appended to initial manifest
**-m MIRROR, --mirror MIRROR**
use specified mirror for debootstrap
**-P ROOT_PASSWORD, --root-password ROOT_PASSWORD**
Set specified password for root, generated by default
**-p PXE_BOOT_DIR, --pxe-boot-dir PXE_BOOT_DIR**
PXE boot directory
**-r, --rm-bootstrap-dir**
remove target directory after finishing
**-S SCRIPT, --script SCRIPT**
use specified script for debootstrap
**-s SUITE, --suite SUITE**
suite used for debootstrap, by default 'stable'
**-y REMOTE_COPY, --remote-copy REMOTE_COPY**
remote copy that cdist config will use, by default
internal script is used
PREOS UBUNTU
------------
**target_dir**
target directory where PreOS will be bootstrapped
**-a ARCH, --arch ARCH**
target debootstrap architecture, by default 'amd64'
**-B, --bootstrap**
do bootstrap step
**-b, --beta**
Enable beta functionality.
**-C, --configure**
do configure step
**-c CDIST_PARAMS, --cdist-params CDIST_PARAMS**
parameters that will be passed to cdist config, by
default '-v' is used
**-D DRIVE, --drive-boot DRIVE**
create bootable PreOS on specified drive
**-e REMOTE_EXEC, --remote-exec REMOTE_EXEC**
remote exec that cdist config will use, by default
internal script is used
**-i MANIFEST, --init-manifest MANIFEST**
init manifest that cdist config will use, by default
internal init manifest is used
**-k KEYFILE, --keyfile KEYFILE**
ssh key files that will be added to cdist config;
'``__ssh_authorized_keys root ...``' type is appended to initial manifest
**-m MIRROR, --mirror MIRROR**
use specified mirror for debootstrap
**-P ROOT_PASSWORD, --root-password ROOT_PASSWORD**
Set specified password for root, generated by default
**-p PXE_BOOT_DIR, --pxe-boot-dir PXE_BOOT_DIR**
PXE boot directory
**-r, --rm-bootstrap-dir**
remove target directory after finishing
**-S SCRIPT, --script SCRIPT**
use specified script for debootstrap
**-s SUITE, --suite SUITE**
suite used for debootstrap, by default 'xenial'
**-y REMOTE_COPY, --remote-copy REMOTE_COPY**
remote copy that cdist config will use, by default
internal script is used
SHELL
-----
This command allows you to spawn a shell that enables access
to the types as commands. It can be thought as an
"interactive manifest" environment. See below for example
usage. Its primary use is for debugging type parameters.
**-s SHELL, --shell SHELL**
Select shell to use, defaults to current shell. Used shell should
be POSIX compatible shell.
CONFIGURATION
-------------
cdist obtains configuration data from the following sources in the following
order (from higher to lower precedence):
#. command-line options
#. configuration file specified at command-line
#. configuration file specified in CDIST_CONFIG_FILE environment variable
#. environment variables
#. user's configuration file (first one found of ~/.cdist.cfg, $XDG_CONFIG_HOME/cdist/cdist.cfg, in specified order)
#. system-wide configuration file (/etc/cdist.cfg).
CONFIGURATION FILE FORMAT
~~~~~~~~~~~~~~~~~~~~~~~~~
cdist configuration file is in the INI file format. Currently it supports
only [GLOBAL] section.
The possible keywords and their meanings are as follows:
:strong:`archiving`
Use specified archiving. Valid values include:
'none', 'tar', 'tgz', 'tbz2' and 'txz'.
:strong:`beta`
Enable beta functionality. It recognizes boolean values from
'yes'/'no', 'on'/'off', 'true'/'false' and '1'/'0'.
:strong:`cache_path_pattern`
Specify cache path pattern.
: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),
such as ':' for POSIX or ';' for Windows.
If also specified at command line then values from command line are
appended to this value.
:strong:`init_manifest`
Specify default initial manifest.
:strong:`inventory_dir`
Specify inventory directory.
:strong:`jobs`
Specify number of jobs for parallel processing. If -1 then the default,
number of CPU's in the system is used. If 0 then parallel processing in
jobs is disabled. If set to positive number then specified maximum
number of processes will be used.
:strong:`local_shell`
Shell command used for local execution.
:strong:`out_path`
Directory to save cdist output in.
:strong:`parallel`
Process hosts in parallel. If -1 then the default, number of CPU's in
the system is used. If 0 then parallel processing of hosts is disabled.
If set to positive number then specified maximum number of processes
will be used.
:strong:`remote_copy`
Command to use for remote copy (should behave like scp).
:strong:`remote_exec`
Command to use for remote execution (should behave like ssh).
:strong:`remote_out_path`
Directory to save cdist output in on the target host.
:strong:`remote_shell`
Shell command at remote host used for remote execution.
:strong:`save_output_streams`
Enable/disable saving output streams (enabled by default).
It recognizes boolean values from 'yes'/'no', 'on'/'off', 'true'/'false'
and '1'/'0'.
:strong:`timestamp`
Timestamp log messages with the current local date and time
in the format: YYYYMMDDHHMMSS.us.
:strong:`verbosity`
Set verbosity level. Valid values are:
'ERROR', 'WARNING', 'INFO', 'VERBOSE', 'DEBUG', 'TRACE' and 'OFF'.
FILES
-----
~/.cdist
Your personal cdist config directory. If exists it will be
automatically used.
~/.cdist/cache
Local cache directory.
~/.cdist/inventory
The home inventory directory. If ~/.cdist exists it will be used as
default inventory directory.
~/.cdist/preos
PreOS plugins directory, if existing.
cdist/conf
The distribution configuration directory. It contains official types and
explorers. This path is relative to cdist installation directory.
cdist/inventory
The distribution inventory directory.
This path is relative to cdist installation directory.
cdist/preos
The distribution PreOS plugins directory.
/etc/cdist.cfg
Global cdist configuration file, if exists.
~/.cdist.cfg or $XDG_CONFIG_HOME/cdist/cdist.cfg
Local cdist configuration file, if exists.
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
(see :strong:`scp`\ (1)).
EXAMPLES
--------
.. code-block:: sh
# Configure ikq05.ethz.ch with debug enabled
% cdist config -vvv ikq05.ethz.ch
# Configure hosts in parallel and use a different configuration directory
% cdist config -c ~/p/cdist-nutzung \
-p ikq02.ethz.ch ikq03.ethz.ch ikq04.ethz.ch
# Use custom remote exec / copy commands
% cdist config --remote-exec /path/to/my/remote/exec \
--remote-copy /path/to/my/remote/copy \
-p ikq02.ethz.ch ikq03.ethz.ch ikq04.ethz.ch
# Configure hosts read from file loadbalancers
% cdist config -f loadbalancers
# Configure hosts read from file web.hosts using 16 parallel jobs
% cdist config -j 16 -f web.hosts
# Display banner
cdist banner
# Show help
% cdist --help
# Show Version
% cdist --version
# Enter a shell that has access to emulated types
% cdist shell
% __git
usage: __git --source SOURCE [--state STATE] [--branch BRANCH]
[--group GROUP] [--owner OWNER] [--mode MODE] object_id
# Install ikq05.ethz.ch with debug enabled
% cdist install -vvv ikq05.ethz.ch
# List inventory content
% cdist inventory list -b
# List inventory for specified host localhost
% cdist inventory list -b localhost
# List inventory for specified tag loadbalancer
% cdist inventory list -b -t loadbalancer
# Add hosts to inventory
% cdist inventory add-host -b web1 web2 web3
# Delete hosts from file old-hosts from inventory
% cdist inventory del-host -b -f old-hosts
# Add tags to specified hosts
% cdist inventory add-tag -b -t europe,croatia,web,static web1 web2
# Add tag to all hosts in inventory
% cdist inventory add-tag -b -t vm
# Delete all tags from specified host
% cdist inventory del-tag -b -a localhost
# Delete tags read from stdin from hosts specified by file hosts
% cdist inventory del-tag -b -T - -f hosts
# Configure hosts from inventory with any of specified tags
% cdist config -b -t web dynamic
# Configure hosts from inventory with all specified tags
% cdist config -b -t -a web dynamic
# Configure all hosts from inventory db
$ cdist config -b -A
# Create default debian PreOS in debug mode
$ cdist preos debian /preos/preos-debian -vvvv -C \
-k ~/.ssh/id_rsa.pub -p /preos/pxe-debian
# Create ubuntu PreOS
$ cdist preos ubuntu /preos/preos-ubuntu -C \
-k ~/.ssh/id_rsa.pub -p /preos/pxe-ubuntu
# Create ubuntu PreOS on drive /dev/sdb
# and set root password to 'password'.
$ cdist preos ubuntu /mnt -B -C \
-k ~/.ssh/id_rsa.pub -D /dev/sdb \
-P password
ENVIRONMENT
-----------
TMPDIR, TEMP, TMP
Setup the base directory for the temporary directory.
See http://docs.python.org/py3k/library/tempfile.html for
more information. This is rather useful, if the standard
directory used does not allow executables.
CDIST_PATH
Colon delimited list of config directories.
CDIST_LOCAL_SHELL
Selects shell for local script execution, defaults to /bin/sh.
CDIST_REMOTE_SHELL
Selects shell for remote script execution, defaults to /bin/sh.
CDIST_OVERRIDE
Allow overwriting type parameters.
CDIST_ORDER_DEPENDENCY
Create dependencies based on the execution order.
CDIST_REMOTE_EXEC
Use this command for remote execution (should behave like ssh).
CDIST_REMOTE_COPY
Use this command for remote copy (should behave like scp).
CDIST_INVENTORY_DIR
Use this directory as inventory directory.
CDIST_BETA
Enable beta functionality.
CDIST_CACHE_PATH_PATTERN
Custom cache path pattern.
CDIST_CONFIG_FILE
Custom configuration file.
EXIT STATUS
-----------
The following exit values shall be returned:
0 Successful completion.
1 One or more host configurations failed.
AUTHORS
-------
Originally written by Nico Schottelius
and Steven Armstrong .
CAVEATS
-------
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.
This is controlled with sshd :strong:`MaxStartups` configuration options.
You may also encounter session open refusal. This happens with ssh multiplexing
when you reach maximum number of open sessions permitted per network
connection. In this case ssh will disable multiplexing.
This limit is controlled with sshd :strong:`MaxSessions` configuration
options. For more details refer to :strong:`sshd_config`\ (5).
When requirements for the same object are defined in different manifests (see
example below), for example, in init manifest and in some other type manifest
and those requirements differ then dependency resolver cannot detect
dependencies correctly. This happens because cdist cannot prepare all objects first
and run all objects afterwards. Some object can depend on the result of type
explorer(s) and explorers are executed during object run. cdist will detect
such case and display a warning message. An example of such a case:
.. code-block:: sh
init manifest:
__a a
require="__e/e" __b b
require="__f/f" __c c
__e e
__f f
require="__c/c" __d d
__g g
__h h
type __g manifest:
require="__c/c __d/d" __a a
Warning message:
WARNING: cdisttesthost: Object __a/a already exists with requirements:
/usr/home/darko/ungleich/cdist/cdist/test/config/fixtures/manifest/init-deps-resolver /tmp/tmp.cdist.test.ozagkg54/local/759547ff4356de6e3d9e08522b0d0807/data/conf/type/__g/manifest: set()
/tmp/tmp.cdist.test.ozagkg54/local/759547ff4356de6e3d9e08522b0d0807/data/conf/type/__g/manifest: {'__c/c', '__d/d'}
Dependency resolver could not handle dependencies as expected.
COPYING
-------
Copyright \(C) 2011-2017 Nico Schottelius. Free use of this software is
granted under the terms of the GNU General Public License v3 or later (GPLv3+).
cdist-6.0.2/docs/src/_static/cdist-logo.jpeg 000644 001751 001751 00000030420 13552030341 021144 0 ustar 00darko darko 000000 000000 ÿØÿÛ „
ÿÀ !" ÿÄ¢
} !1AQa"q2‘¡#B±ÁRÑđ$3br‚
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰’“”•–—˜™¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂĂÄÅÆÇÈÉỂÓÔƠÖרÙÚáâăäåæçèéêṇ̃óôơö÷øùú
w !1AQaq"2B‘¡±Á #3RđbrÑ
$4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰’“”•–—˜™¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂĂÄÅÆÇÈÉỂÓÔƠÖרÙÚâăäåæçèéệóôơö÷øùúÿÚ ? ưS¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢( ¢(̣+âÇü+⟃~'x«Ả<á́Í/RÊÜ̃Ău$Å#r€»,ꤜg…k“ÿ ‡×üdÿ ¡?Àßøyÿ ÉUñ¯Çßù.??́={ÿ £̃¸* ư?đZăÁ₫Ïưz^̣U~«₫Í¿o>7ü
đ_µ(4ëírÁn§µ¶bḅAq‘‘yï_Í
D¿đOÿ ù3_…ö_ư
èè:üßư¹à¦>?ư™₫=^øẪđƯư…•¼ïs«Çq$²<©¼ăË• 1‚}ëô‚¿àỴ̈z> ÿ °fŸÿ ¢€;ßø}ÆOúü
ÿ €·Ÿü•Gü>¿ă'ư ₫ÿ À[Ï₫J¯Ï(ú
ÿ ‚~Ơ~ ư¾j̃&ñ6‘¦éŸ«>SI,2(7
¶FfçÁùNƠôơ~zÁÿ äƯ|_ÿ c3ÿ é4ú@Q@Q@Q@Q@Q@Q@Q@WUÔí´M.óQ½”CgiÜM)航Yோäÿ ‚¿~Ï©#(¹ñ#…$]'ƒî2ôöƠñü>ö}ÿ ₫%ÿ ÁOÿ gR[ÿ Á^ÿ gÉî"‰¯Ø¢¢¶¹̣Ú+ˆ\I¨$GHÈ?•K@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@Q@̀§Çßù.??́={ÿ £̃¸*ï~>ÿ Éqøÿ aëßươÁP_Ñ/üÿ ₫L×áGư×ÿ Cz₫v«ú%ÿ ‚ÿ Éü(ÿ °:ÿ èo@A×áü³₫OGÄöÓÿ ôB×îơ|?ûZÿ Á1t¿Ú‹âíÇOîü=usk
´ö‚ÍgLÆ»U”îR2 Èç ü7¢¿XáÇÚwưK¯ü¯ÿ £₫}§ÑTºÿ ÁJÿ ñÊ ï?ạ̀n¾/ÿ ±™ÿ ô
ư¯ư?eÙáµÿ …¬µÛɨ>¡=Üđˆ€bˆUA8 îy&½ê€
(¢€
(¢€
(¢€
(¢€
(¢€
(¢€
(¢€9/‹¿̣J