From c818442ef2d3363175f8ba960eaf43b121264165 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 12 Apr 2014 19:40:41 +0200 Subject: [PATCH 01/42] also linke "files" subdir Signed-off-by: Nico Schottelius --- cdist/exec/local.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cdist/exec/local.py b/cdist/exec/local.py index 2f75ffd4..6b0ad9b5 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -33,6 +33,8 @@ import cdist import cdist.message from cdist import core +CONF_SUBDIRS_LINKED = [ "explorer", "files", "manifest", "type" ]: + class Local(object): """Execute commands locally. @@ -216,14 +218,14 @@ class Local(object): pass def _create_conf_path_and_link_conf_dirs(self): - # Link destination directories - for sub_dir in [ "explorer", "manifest", "type" ]: + # Create destination directories + for sub_dir in CONF_SUBDIRS_LINKED: self.mkdir(os.path.join(self.conf_path, sub_dir)) # Iterate over all directories and link the to the output dir for conf_dir in self.conf_dirs: self.log.debug("Checking conf_dir %s ..." % (conf_dir)) - for sub_dir in [ "explorer", "manifest", "type" ]: + for sub_dir in CONF_SUBDIRS_LINKED: current_dir = os.path.join(conf_dir, sub_dir) # Allow conf dirs to contain only partial content From aa8c5555b78591a48bccdd696389105bdac03e9a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Apr 2014 09:46:52 +0200 Subject: [PATCH 02/42] document __files Signed-off-by: Nico Schottelius --- docs/man/cdist-reference.text.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/man/cdist-reference.text.sh b/docs/man/cdist-reference.text.sh index 7081e762..c6e5053f 100755 --- a/docs/man/cdist-reference.text.sh +++ b/docs/man/cdist-reference.text.sh @@ -75,6 +75,10 @@ confdir:: 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 @@ -196,6 +200,10 @@ The following environment variables are exported by cdist: __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 From 2f68e21a96a5a09fd6b99512cdf73b2e00b5458c Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Sun, 5 Jun 2016 21:57:21 -0400 Subject: [PATCH 03/42] Add support for FreeBSD 10.x jails Separate __jail type into distinct __jail_freebsd9 and __jail_freebsd10 types --- cdist/conf/type/__jail/manifest | 13 + .../explorer/basepresent | 0 .../explorer/present | 0 .../explorer/status | 0 .../conf/type/__jail_freebsd10/gencode-local | 52 +++ .../conf/type/__jail_freebsd10/gencode-remote | 362 ++++++++++++++++++ cdist/conf/type/__jail_freebsd10/man.text | 119 ++++++ .../type/__jail_freebsd10/parameter/boolean | 3 + .../parameter/default/devfs-ruleset | 1 + .../parameter/default/jailbase | 1 + .../parameter/default/jaildir | 1 + .../__jail_freebsd10/parameter/default/state | 1 + .../type/__jail_freebsd10/parameter/optional | 8 + .../type/__jail_freebsd9/explorer/basepresent | 54 +++ .../type/__jail_freebsd9/explorer/present | 43 +++ .../conf/type/__jail_freebsd9/explorer/status | 52 +++ .../{__jail => __jail_freebsd9}/gencode-local | 0 .../gencode-remote | 7 +- cdist/conf/type/__jail_freebsd9/man.text | 120 ++++++ .../type/__jail_freebsd9/parameter/boolean | 3 + .../parameter/default/devfs-ruleset | 1 + .../parameter/default/jailbase | 1 + .../__jail_freebsd9/parameter/default/jaildir | 1 + .../__jail_freebsd9/parameter/default/state | 1 + .../type/__jail_freebsd9/parameter/optional | 8 + cdist/conf/type/__package/parameter/boolean | 1 + cdist/conf/type/__package/parameter/optional | 1 + 27 files changed, 851 insertions(+), 3 deletions(-) rename cdist/conf/type/{__jail => __jail_freebsd10}/explorer/basepresent (100%) rename cdist/conf/type/{__jail => __jail_freebsd10}/explorer/present (100%) rename cdist/conf/type/{__jail => __jail_freebsd10}/explorer/status (100%) create mode 100755 cdist/conf/type/__jail_freebsd10/gencode-local create mode 100755 cdist/conf/type/__jail_freebsd10/gencode-remote create mode 100644 cdist/conf/type/__jail_freebsd10/man.text create mode 100644 cdist/conf/type/__jail_freebsd10/parameter/boolean create mode 100644 cdist/conf/type/__jail_freebsd10/parameter/default/devfs-ruleset create mode 100644 cdist/conf/type/__jail_freebsd10/parameter/default/jailbase create mode 100644 cdist/conf/type/__jail_freebsd10/parameter/default/jaildir create mode 100644 cdist/conf/type/__jail_freebsd10/parameter/default/state create mode 100644 cdist/conf/type/__jail_freebsd10/parameter/optional create mode 100755 cdist/conf/type/__jail_freebsd9/explorer/basepresent create mode 100755 cdist/conf/type/__jail_freebsd9/explorer/present create mode 100755 cdist/conf/type/__jail_freebsd9/explorer/status rename cdist/conf/type/{__jail => __jail_freebsd9}/gencode-local (100%) rename cdist/conf/type/{__jail => __jail_freebsd9}/gencode-remote (98%) create mode 100644 cdist/conf/type/__jail_freebsd9/man.text create mode 100644 cdist/conf/type/__jail_freebsd9/parameter/boolean create mode 100644 cdist/conf/type/__jail_freebsd9/parameter/default/devfs-ruleset create mode 100644 cdist/conf/type/__jail_freebsd9/parameter/default/jailbase create mode 100644 cdist/conf/type/__jail_freebsd9/parameter/default/jaildir create mode 100644 cdist/conf/type/__jail_freebsd9/parameter/default/state create mode 100644 cdist/conf/type/__jail_freebsd9/parameter/optional create mode 100644 cdist/conf/type/__package/parameter/boolean diff --git a/cdist/conf/type/__jail/manifest b/cdist/conf/type/__jail/manifest index 2d29e263..6df52c59 100755 --- a/cdist/conf/type/__jail/manifest +++ b/cdist/conf/type/__jail/manifest @@ -37,6 +37,19 @@ jaildir="$(cat "$__object/parameter/jaildir")" __directory ${jaildir} --parents +set -- "$@" "$__object_id" "--state" "$state" +cd "$__object/parameter" +for property in $(ls .); do + set -- "$@" "--$property" "$(cat "$property")" +done + +ver="$(cat "$__global/explorer/os_version")" +if [ -n "$(echo "$ver" | grep '^10\.' )" ]; then # Version is 10.x + __jail_freebsd10 "$@" +else + __jail_freebsd9 "$@" +fi + # Debug #set +x diff --git a/cdist/conf/type/__jail/explorer/basepresent b/cdist/conf/type/__jail_freebsd10/explorer/basepresent similarity index 100% rename from cdist/conf/type/__jail/explorer/basepresent rename to cdist/conf/type/__jail_freebsd10/explorer/basepresent diff --git a/cdist/conf/type/__jail/explorer/present b/cdist/conf/type/__jail_freebsd10/explorer/present similarity index 100% rename from cdist/conf/type/__jail/explorer/present rename to cdist/conf/type/__jail_freebsd10/explorer/present diff --git a/cdist/conf/type/__jail/explorer/status b/cdist/conf/type/__jail_freebsd10/explorer/status similarity index 100% rename from cdist/conf/type/__jail/explorer/status rename to cdist/conf/type/__jail_freebsd10/explorer/status diff --git a/cdist/conf/type/__jail_freebsd10/gencode-local b/cdist/conf/type/__jail_freebsd10/gencode-local new file mode 100755 index 00000000..a88e8ae4 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/gencode-local @@ -0,0 +1,52 @@ +#!/bin/sh +# +# 2012 Jake Guffey (jake.guffey at eprotex.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 . +# +# +# The __jail type creates, configures, and deletes FreeBSD jails for use as +# virtual machines. +# + +# Debug +exec >&2 +set -x + +jaildir="$(cat "$__object/parameter/jaildir")" + +jailbase="$(cat "$__object/parameter/jailbase")" + +state="$(cat "$__object/parameter/state")" + +if [ "$state" = "present" ] && [ -z "$jailbase" ]; then + exec >&2 + echo "jailbase is a REQUIRED parameter when state=present!" + exit 1 +fi + +remotebase="${jaildir}/jailbase.tgz" +basepresent="$(cat "$__object/explorer/basepresent")" + +if [ "$state" = "present" ]; then + if [ "$basepresent" = "NONE" ]; then + echo "$__remote_copy" "${jailbase}" "$__target_host:${remotebase}" + fi # basepresent=NONE +fi # state=present + +# Debug +set +x + diff --git a/cdist/conf/type/__jail_freebsd10/gencode-remote b/cdist/conf/type/__jail_freebsd10/gencode-remote new file mode 100755 index 00000000..ae68616d --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/gencode-remote @@ -0,0 +1,362 @@ +#!/bin/sh +# +# 2012,2014,2016 Jake Guffey (jake.guffey at jointheirstm.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 . +# +# +# The __jail_freebsd10 type creates, configures, and deletes FreeBSD +# jails for use as virtual machines on FreeBSD 10.x. +# + +# Debug +#exec >&2 +#set -x + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +state="$(cat "$__object/parameter/state")" + +started="true" +# If the user wants the jail gone, it implies it shouldn't be started. +[ -f "$__object/parameter/stopped" -o "$state" = "absent" ] && started="false" + +if [ -f "$__object/parameter/ip" ]; then + ip="$(cat "$__object/parameter/ip")" +else +# IP is an optional param when $state=absent, but +# when $state=present, it's required. Enforce this. + if [ "$state" = "present" ]; then + exec >&2 + echo "If --state is 'present,' --ip must be given\!" + exit 1 + fi +fi + +if [ -f "$__object/parameter/hostname" ]; then + hostname="$(cat "$__object/parameter/hostname")" +else + hostname="$name" +fi + +if [ -f "$__object/parameter/devfs-disable" ]; then + devfsenable="false" +else + devfsenable="true" +fi + +devfsruleset="$(cat "$__object/parameter/devfs-ruleset")" + +# devfs_ruleset being defined without devfs_enable being true +# is pointless. Treat this as an error. +if [ -n "$devfsruleset" -a "$devfsenable" = "false" ]; then + exec >&2 + echo "Can't have --devfs-ruleset defined with --devfs-disable" + exit 1 +fi + +if [ -f "$__object/parameter/onboot" ]; then + onboot="true" +fi + +jaildir="$(cat "$__object/parameter/jaildir")" + +present="$(cat "$__object/explorer/present")" +#present="$(cat "$__type/explorer/present")" +status="$(cat "$__object/explorer/status")" + +# Handle ip="addr, addr" format +if [ $(expr "${ip}" : ".*, .*") -gt "0" ]; then + SAVE_IFS="$IFS" + IFS=", " + for cur_ip in ${ip}; do + # Just get the last IP address for SSH to listen on + mgmt_ip=$(echo "${ip}" | cut '-d ' -f1) # In case using "ip netmask" format rather than CIDR + done + IFS="$SAVE_IFS" +else + mgmt_ip=$(echo "${ip}" | cut '-d ' -f1) # In case using "ip netmask" format rather than CIDR +fi + +stopJail() { +# Check $status before issuing command + if [ "$status" = "STARTED" ]; then + echo "/etc/rc.d/jail stop ${name}" + echo "stop" >> "$__messages_out" + fi +} + +startJail() { +# Check $status before issuing command + if [ "$status" = "NOTSTART" ]; then + echo "/etc/rc.d/jail start ${name}" + echo "start" >> "$__messages_out" + fi +} + +deleteJail() { +# Unmount the jail's mountpoints if necessary + cat <=1 rw mount is mounted still + for DIR in "${output}"; do + umount -F "/etc/fstab.${name}" "\$(echo "${DIR}" | awk '{print $3}')" + done + fi + output="\$(mount | grep "\/${name} (")" || true + if [ -n "\${output}" ]; then # ro mount is mounted still + umount -F "/etc/fstab.${name}" "\$(echo "${output}" | awk '{print $3}')" + fi +EOF +# Remove the jail's rw mountpoints + echo "rm -rf \"${jaildir}/rw/${name}\"" +# Remove the jail directory + echo "rm -rf \"${jaildir}/${name}\"" +# Remove the jail's fstab + echo "rm -f \"/etc/fstab.${name}\"" +# Remove jail entry from jail.conf + cat <> "$__messages_out" +} + +createJail() { +# Create the jail directory +cat <> "$__messages_out" + +# Create the ro+rw mountpoint entries in fstab +cat </etc/fstab.${name} <>/etc/rc.conf + elif [ ! "\$(echo \$jail_enable | tr '[a-z]' '[A-Z]' | tr -d '"')" = "YES" ]; then # jail_enable="NO" + sed -i '.bak' 's/^jail_enable=.*$/jail_enable="YES"/g' /etc/rc.conf # fix this -^ + rm -f /etc/rc.conf.bak + fi + + jailfile=/etc/jail.conf + jailheader="${name} {" + + jaildata="path=\"${jaildir}/${name}\";" + + if [ "$devfsenable" = "true" ]; then + jaildata="\$jaildata + mount.devfs;" + else + jaildata="\$jaildata + mount.nodevfs;" + fi + + jaildata="\$jaildata + host.hostname=\"${hostname}\"; + ip4.addr=\"${ip}\"; + exec.start=\"/bin/sh /etc/rc\"; + exec.stop=\"/bin/sh /etc/rc.shutdown\"; + exec.consolelog=\"/var/log/jail_${name}_console.log\"; + mount.fstab=\"/etc/fstab.${name}\"; + allow.mount; + exec.clean; + allow.set_hostname=0; + allow.sysvipc=0; + allow.raw_sockets=0;" + + jailtrailer="}" + + if [ "$devfsenable" = "true" ] && [ "${devfsruleset}" = "jailrules" ]; then # The default ruleset is to be used + if [ ! -f /etc/devfs.rules ]; then + touch /etc/devfs.rules + fi + if [ -z "\$(grep '\[jailrules=' /etc/devfs.rules)" ]; then # The default ruleset doesn't exist + # Get the highest-numbered ruleset + highest="\$(sed -n 's/\[.*=\([0-9]*\)\]/\1/pg' /etc/devfs.rules | sort -u | tail -n 1)" || true + # increment by 1 + [ -z "\$highest" ] && highest=10 + let num="\${highest}+1" 2>&1 >/dev/null # Close the FD==fail... + # add default ruleset + cat >>/etc/devfs.rules <>\"\$jailfile\"" + +# Add $name to jail_list if $onboot=yes +if [ "$onboot" = "yes" ]; then + + # first check to see whether jail_enable="YES" exists in rc.conf or not and add it + # if necessary + + cat <> "$__messages_out" +fi + +# Add the normal entries into the jail's rc.conf +cat <"${jaildir}/rw/${name}/etc/rc.conf" +echo sshd_enable=\"YES\" >>"${jaildir}/rw/${name}/etc/rc.conf" +echo sendmail_enable=\"NONE\" >>"${jaildir}/rw/${name}/etc/rc.conf" +echo syslogd_enable=\"YES\" >>"${jaildir}/rw/${name}/etc/rc.conf" +echo syslogd_flags=\"-ss\" >>"${jaildir}/rw/${name}/etc/rc.conf" + +EOF +# Configure SSHd's listening address +cat < + + +NAME +---- +cdist-type__jail_freebsd_10 - Manage FreeBSD jails + + +DESCRIPTION +----------- +This type is used on FreeBSD 10.x to manage jails. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "present" or "absent", defaults to "present". + +jailbase:: + The location of the .tgz archive containing the base fs for your jails. + + +OPTIONAL PARAMETERS +------------------- +name:: + The name of the jail. Default is to use the object_id as the jail name. + +ip:: + The ifconfig style IP/netmask combination to use for the jail guest. If + the state parameter is "present," this parameter is required. + +hostname:: + The FQDN to use for the jail guest. Defaults to the name parameter. + +interface:: + The name of the physical interface on the jail server to bind the jail to. + Defaults to the first interface found in the output of ifconfig -l. + +devfs-ruleset:: + The name of the devfs ruleset to associate with the jail. Defaults to + "jailrules." This ruleset must be copied to the server via another type. + To use this option, devfs-enable must be "true." + +jaildir:: + The location on the remote server to use for hosting jail filesystems. + Defaults to /usr/jail. + +BOOLEAN PARAMETERS +------------------ +stopped:: + Do not start the jail + +devfs-disable:: + Whether to disallow devfs mounting within the jail + +onboot:: + Whether to add the jail to rc.conf's jail_list variable. + + +CAVEATS +------- +This type does not currently support modification of jail options. If, for +example a jail needs to have its IP address or netmask changed, the jail must +be removed then re-added with the correct IP address/netmask or the appropriate +modifications to jail.conf need to be made through alternate means. + +MESSAGES +-------- +start:: + The jail was started +stop:: + The jail was stopped +create: + The jail was created +delete:: + The jail was deleted +onboot:: + The jail was configured to start on boot + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create a jail called www +__jail_freebsd_10 www --state present --ip "192.168.1.2" --jailbase /my/jail/base.tgz + +# Remove the jail called www +__jail_freebsd_10 www --state absent --jailbase /my/jail/base.tgz + +# The jail www should not be started +__jail_freebsd_10 www --state present --stopped \ + --ip "192.168.1.2 netmask 255.255.255.0" \ + --jailbase /my/jail/base.tgz + +# Use the name variable explicitly +__jail_freebsd_10 thisjail --state present --name www \ + --ip "192.168.1.2" \ + --jailbase /my/jail/base.tgz + +# Go nuts +__jail_freebsd_10 lotsofoptions --state present --name testjail \ + --ip "192.168.1.100 netmask 255.255.255.0" \ + --hostname "testjail.example.com" --interface "em0" \ + --onboot --jailbase /my/jail/base.tgz --jaildir /jails +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__jail(7) + + +COPYING +------- +Copyright \(C) 2012-2016 Jake Guffey. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__jail_freebsd10/parameter/boolean b/cdist/conf/type/__jail_freebsd10/parameter/boolean new file mode 100644 index 00000000..39144f6f --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/parameter/boolean @@ -0,0 +1,3 @@ +onboot +stopped +devfs-disable diff --git a/cdist/conf/type/__jail_freebsd10/parameter/default/devfs-ruleset b/cdist/conf/type/__jail_freebsd10/parameter/default/devfs-ruleset new file mode 100644 index 00000000..f602aa0a --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/parameter/default/devfs-ruleset @@ -0,0 +1 @@ +jailrules diff --git a/cdist/conf/type/__jail_freebsd10/parameter/default/jailbase b/cdist/conf/type/__jail_freebsd10/parameter/default/jailbase new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/parameter/default/jailbase @@ -0,0 +1 @@ + diff --git a/cdist/conf/type/__jail_freebsd10/parameter/default/jaildir b/cdist/conf/type/__jail_freebsd10/parameter/default/jaildir new file mode 100644 index 00000000..ec7d86c6 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/parameter/default/jaildir @@ -0,0 +1 @@ +/usr/jail diff --git a/cdist/conf/type/__jail_freebsd10/parameter/default/state b/cdist/conf/type/__jail_freebsd10/parameter/default/state new file mode 100644 index 00000000..e7f6134f --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/parameter/default/state @@ -0,0 +1 @@ +present diff --git a/cdist/conf/type/__jail_freebsd10/parameter/optional b/cdist/conf/type/__jail_freebsd10/parameter/optional new file mode 100644 index 00000000..b36f0fa5 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd10/parameter/optional @@ -0,0 +1,8 @@ +name +ip +hostname +interface +devfs-ruleset +jaildir +jailbase +state diff --git a/cdist/conf/type/__jail_freebsd9/explorer/basepresent b/cdist/conf/type/__jail_freebsd9/explorer/basepresent new file mode 100755 index 00000000..034128d5 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/explorer/basepresent @@ -0,0 +1,54 @@ +#!/bin/sh +# +# 2012 Jake Guffey (jake.guffey at eprotex.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 . +# +# +# See if the jailbase.tgz or $jaildir/base dir exists +# + +# Debug +#exec >&2 +#set -x + +if [ -f "$__object/parameter/jaildir" ]; then + jaildir="$(cat "$__object/parameter/jaildir")" +else + jaildir="/usr/jail" +fi + +name="base:jailbase.tgz" +out="" + +save_IFS="$IFS" +IFS=":" +for cur in $name; do + if [ -e "${jaildir}/$cur" ]; then + out="${out}:${cur}" + fi +done +IFS="$save_IFS" + +if [ -z "$out" ]; then + echo "NONE" +else + echo "${out}" +fi + +# Debug +#set +x + diff --git a/cdist/conf/type/__jail_freebsd9/explorer/present b/cdist/conf/type/__jail_freebsd9/explorer/present new file mode 100755 index 00000000..ddfb805c --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/explorer/present @@ -0,0 +1,43 @@ +#!/bin/sh +# +# 2012 Jake Guffey (jake.guffey at eprotex.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 . +# +# +# See if the requested jail exists +# + +# Debug +#exec >&2 +#set -x + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name=$__object_id +fi + +if [ -f "$__object/parameter/jaildir" ]; then + jaildir="$(cat "$__object/parameter/jaildir")" +else + jaildir="/usr/jail" +fi + +[ -d "${jaildir}/$name" ] && echo "EXISTS" || echo "NOTEXIST" + +#set +x + diff --git a/cdist/conf/type/__jail_freebsd9/explorer/status b/cdist/conf/type/__jail_freebsd9/explorer/status new file mode 100755 index 00000000..1ceba212 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/explorer/status @@ -0,0 +1,52 @@ +#!/bin/sh +# +# 2012 Jake Guffey (jake.guffey at eprotex.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 . +# +# +# See if the requested jail is started +# + +# Debug +#exec >&2 +#set -x + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +if [ -f "$__object/parameter/jaildir" ]; then + jaildir="$(cat "$__object/parameter/jaildir")" +else + jaildir="/usr/jail" +fi +# backslash-escaped $jaildir +sjaildir="$(echo ${jaildir} | sed 's#/#\\/#g')" + +jls_output="$(jls | grep "[ ]${sjaildir}\/${name}\$")" || true + +if [ -n "${jls_output}" ]; then + echo "STARTED" +else + echo "NOTSTART" +fi + +# Debug +#set +x + diff --git a/cdist/conf/type/__jail/gencode-local b/cdist/conf/type/__jail_freebsd9/gencode-local similarity index 100% rename from cdist/conf/type/__jail/gencode-local rename to cdist/conf/type/__jail_freebsd9/gencode-local diff --git a/cdist/conf/type/__jail/gencode-remote b/cdist/conf/type/__jail_freebsd9/gencode-remote similarity index 98% rename from cdist/conf/type/__jail/gencode-remote rename to cdist/conf/type/__jail_freebsd9/gencode-remote index c88f3361..6a4c64de 100755 --- a/cdist/conf/type/__jail/gencode-remote +++ b/cdist/conf/type/__jail_freebsd9/gencode-remote @@ -1,6 +1,6 @@ #!/bin/sh # -# 2012,2014 Jake Guffey (jake.guffey at eprotex.com) +# 2012,2014,2016 Jake Guffey (jake.guffey at jointheirstm.org) # # This file is part of cdist. # @@ -18,8 +18,8 @@ # along with cdist. If not, see . # # -# The __jail type creates, configures, and deletes FreeBSD jails for use as -# virtual machines. +# The __jail_freebsd9 type creates, configures, and deletes FreeBSD jails +# for use as virtual machines on FreeBSD 9.x and before. # # Debug @@ -354,3 +354,4 @@ else # The jail does not currently exist exit 0 fi fi + diff --git a/cdist/conf/type/__jail_freebsd9/man.text b/cdist/conf/type/__jail_freebsd9/man.text new file mode 100644 index 00000000..c51f326d --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/man.text @@ -0,0 +1,120 @@ +cdist-type__jail_freebsd9(7) +============================ +Jake Guffey + + +NAME +---- +cdist-type__jail_freebsd9 - Manage FreeBSD jails + + +DESCRIPTION +----------- +This type is used on FreeBSD 9.x and before to manage jails. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "present" or "absent", defaults to "present". + +jailbase:: + The location of the .tgz archive containing the base fs for your jails. + + +OPTIONAL PARAMETERS +------------------- +name:: + The name of the jail. Default is to use the object_id as the jail name. + +ip:: + The ifconfig style IP/netmask combination to use for the jail guest. If + the state parameter is "present," this parameter is required. + +hostname:: + The FQDN to use for the jail guest. Defaults to the name parameter. + +interface:: + The name of the physical interface on the jail server to bind the jail to. + Defaults to the first interface found in the output of ifconfig -l. + +devfs-ruleset:: + The name of the devfs ruleset to associate with the jail. Defaults to + "jailrules." This ruleset must be copied to the server via another type. + To use this option, devfs-enable must be "true." + +jaildir:: + The location on the remote server to use for hosting jail filesystems. + Defaults to /usr/jail. + +BOOLEAN PARAMETERS +------------------ +stopped:: + Do not start the jail + +devfs-disable:: + Whether to disallow devfs mounting within the jail + +onboot:: + Whether to add the jail to rc.conf's jail_list variable. + + +CAVEATS +------- +This type does not currently support modification of jail options. If, for +example a jail needs to have its IP address or netmask changed, the jail must +be removed then re-added with the correct IP address/netmask or the appropriate +line (jail__ip="...") modified within rc.conf through some alternate +means. + +MESSAGES +-------- +start:: + The jail was started +stop:: + The jail was stopped +create: + The jail was created +delete:: + The jail was deleted +onboot:: + The jail was configured to start on boot + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create a jail called www +__jail_freebsd9 www --state present --ip "192.168.1.2" --jailbase /my/jail/base.tgz + +# Remove the jail called www +__jail_freebsd9 www --state absent --jailbase /my/jail/base.tgz + +# The jail www should not be started +__jail_freebsd9 www --state present --stopped \ + --ip "192.168.1.2 netmask 255.255.255.0" \ + --jailbase /my/jail/base.tgz + +# Use the name variable explicitly +__jail_freebsd9 thisjail --state present --name www \ + --ip "192.168.1.2" \ + --jailbase /my/jail/base.tgz + +# Go nuts +__jail_freebsd9 lotsofoptions --state present --name testjail \ + --ip "192.168.1.100 netmask 255.255.255.0" \ + --hostname "testjail.example.com" --interface "em0" \ + --onboot --jailbase /my/jail/base.tgz --jaildir /jails +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__jail + + +COPYING +------- +Copyright \(C) 2012-2016 Jake Guffey. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__jail_freebsd9/parameter/boolean b/cdist/conf/type/__jail_freebsd9/parameter/boolean new file mode 100644 index 00000000..39144f6f --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/parameter/boolean @@ -0,0 +1,3 @@ +onboot +stopped +devfs-disable diff --git a/cdist/conf/type/__jail_freebsd9/parameter/default/devfs-ruleset b/cdist/conf/type/__jail_freebsd9/parameter/default/devfs-ruleset new file mode 100644 index 00000000..f602aa0a --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/parameter/default/devfs-ruleset @@ -0,0 +1 @@ +jailrules diff --git a/cdist/conf/type/__jail_freebsd9/parameter/default/jailbase b/cdist/conf/type/__jail_freebsd9/parameter/default/jailbase new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/parameter/default/jailbase @@ -0,0 +1 @@ + diff --git a/cdist/conf/type/__jail_freebsd9/parameter/default/jaildir b/cdist/conf/type/__jail_freebsd9/parameter/default/jaildir new file mode 100644 index 00000000..ec7d86c6 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/parameter/default/jaildir @@ -0,0 +1 @@ +/usr/jail diff --git a/cdist/conf/type/__jail_freebsd9/parameter/default/state b/cdist/conf/type/__jail_freebsd9/parameter/default/state new file mode 100644 index 00000000..e7f6134f --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/parameter/default/state @@ -0,0 +1 @@ +present diff --git a/cdist/conf/type/__jail_freebsd9/parameter/optional b/cdist/conf/type/__jail_freebsd9/parameter/optional new file mode 100644 index 00000000..b36f0fa5 --- /dev/null +++ b/cdist/conf/type/__jail_freebsd9/parameter/optional @@ -0,0 +1,8 @@ +name +ip +hostname +interface +devfs-ruleset +jaildir +jailbase +state diff --git a/cdist/conf/type/__package/parameter/boolean b/cdist/conf/type/__package/parameter/boolean new file mode 100644 index 00000000..effcb218 --- /dev/null +++ b/cdist/conf/type/__package/parameter/boolean @@ -0,0 +1 @@ +upgrade diff --git a/cdist/conf/type/__package/parameter/optional b/cdist/conf/type/__package/parameter/optional index d674f32e..bb3f5154 100644 --- a/cdist/conf/type/__package/parameter/optional +++ b/cdist/conf/type/__package/parameter/optional @@ -4,3 +4,4 @@ type pkgsite state ptype +repo From bcd4e5f29b96f4e9e486533fc5b645680a6cc46d Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Sun, 5 Jun 2016 21:57:56 -0400 Subject: [PATCH 04/42] Removed debugging from __jail_freebsd10/gencode-local --- cdist/conf/type/__jail_freebsd10/gencode-local | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cdist/conf/type/__jail_freebsd10/gencode-local b/cdist/conf/type/__jail_freebsd10/gencode-local index a88e8ae4..d4b89730 100755 --- a/cdist/conf/type/__jail_freebsd10/gencode-local +++ b/cdist/conf/type/__jail_freebsd10/gencode-local @@ -23,8 +23,8 @@ # # Debug -exec >&2 -set -x +#exec >&2 +#set -x jaildir="$(cat "$__object/parameter/jaildir")" @@ -48,5 +48,5 @@ if [ "$state" = "present" ]; then fi # state=present # Debug -set +x +#set +x From bcd5e9827b2d887e31b1e2a12b1b8b40b077ee15 Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Sun, 5 Jun 2016 22:16:42 -0400 Subject: [PATCH 05/42] Fix man pages Migrate (re-migrate) from text -> rst and update docs to reflect new developments --- cdist/conf/type/__jail/man.rst | 6 +- .../__jail_freebsd10/{man.text => man.rst} | 84 +++++++++---------- .../__jail_freebsd9/{man.text => man.rst} | 80 +++++++++--------- 3 files changed, 81 insertions(+), 89 deletions(-) rename cdist/conf/type/__jail_freebsd10/{man.text => man.rst} (59%) rename cdist/conf/type/__jail_freebsd9/{man.text => man.rst} (60%) diff --git a/cdist/conf/type/__jail/man.rst b/cdist/conf/type/__jail/man.rst index 38ec4f96..826dce21 100644 --- a/cdist/conf/type/__jail/man.rst +++ b/cdist/conf/type/__jail/man.rst @@ -2,12 +2,12 @@ cdist-type__jail(7) =================== Manage FreeBSD jails -Jake Guffey +Jake Guffey DESCRIPTION ----------- -This type is used on FreeBSD to manage jails. +This type is used on FreeBSD to manage jails by calling the appropriate per-version subtype. REQUIRED PARAMETERS @@ -112,5 +112,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2012 Jake Guffey. Free use of this software is +Copyright \(C) 2012,2016 Jake Guffey. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__jail_freebsd10/man.text b/cdist/conf/type/__jail_freebsd10/man.rst similarity index 59% rename from cdist/conf/type/__jail_freebsd10/man.text rename to cdist/conf/type/__jail_freebsd10/man.rst index b5df9d5d..7e167549 100644 --- a/cdist/conf/type/__jail_freebsd10/man.text +++ b/cdist/conf/type/__jail_freebsd10/man.rst @@ -1,61 +1,58 @@ -cdist-type__jail_freebsd_10(7) -============================== +cdist-type__jail_freebsd10(7) +============================= +Manage FreeBSD jails + Jake Guffey -NAME ----- -cdist-type__jail_freebsd_10 - Manage FreeBSD jails - - DESCRIPTION ----------- -This type is used on FreeBSD 10.x to manage jails. +This type is used on FreeBSD >= 10.0 to manage jails. REQUIRED PARAMETERS ------------------- -state:: +state Either "present" or "absent", defaults to "present". -jailbase:: +jailbase The location of the .tgz archive containing the base fs for your jails. OPTIONAL PARAMETERS ------------------- -name:: +name The name of the jail. Default is to use the object_id as the jail name. -ip:: +ip The ifconfig style IP/netmask combination to use for the jail guest. If the state parameter is "present," this parameter is required. -hostname:: +hostname The FQDN to use for the jail guest. Defaults to the name parameter. -interface:: +interface The name of the physical interface on the jail server to bind the jail to. Defaults to the first interface found in the output of ifconfig -l. -devfs-ruleset:: +devfs-ruleset The name of the devfs ruleset to associate with the jail. Defaults to "jailrules." This ruleset must be copied to the server via another type. To use this option, devfs-enable must be "true." -jaildir:: +jaildir The location on the remote server to use for hosting jail filesystems. Defaults to /usr/jail. BOOLEAN PARAMETERS ------------------ -stopped:: +stopped Do not start the jail -devfs-disable:: +devfs-disable Whether to disallow devfs mounting within the jail -onboot:: +onboot Whether to add the jail to rc.conf's jail_list variable. @@ -68,49 +65,48 @@ modifications to jail.conf need to be made through alternate means. MESSAGES -------- -start:: +start The jail was started -stop:: +stop The jail was stopped create: The jail was created -delete:: +delete The jail was deleted -onboot:: +onboot The jail was configured to start on boot EXAMPLES -------- --------------------------------------------------------------------------------- -# Create a jail called www -__jail_freebsd_10 www --state present --ip "192.168.1.2" --jailbase /my/jail/base.tgz +.. code-block:: sh -# Remove the jail called www -__jail_freebsd_10 www --state absent --jailbase /my/jail/base.tgz + # Create a jail called www + __jail_freebsd10 www --state present --ip "192.168.1.2" --jailbase /my/jail/base.tgz -# The jail www should not be started -__jail_freebsd_10 www --state present --stopped \ - --ip "192.168.1.2 netmask 255.255.255.0" \ - --jailbase /my/jail/base.tgz + # Remove the jail called www + __jail_freebsd10 www --state absent --jailbase /my/jail/base.tgz -# Use the name variable explicitly -__jail_freebsd_10 thisjail --state present --name www \ - --ip "192.168.1.2" \ - --jailbase /my/jail/base.tgz + # The jail www should not be started + __jail_freebsd10 www --state present --stopped \ + --ip "192.168.1.2 netmask 255.255.255.0" \ + --jailbase /my/jail/base.tgz -# Go nuts -__jail_freebsd_10 lotsofoptions --state present --name testjail \ - --ip "192.168.1.100 netmask 255.255.255.0" \ - --hostname "testjail.example.com" --interface "em0" \ - --onboot --jailbase /my/jail/base.tgz --jaildir /jails --------------------------------------------------------------------------------- + # Use the name variable explicitly + __jail_freebsd10 thisjail --state present --name www \ + --ip "192.168.1.2" \ + --jailbase /my/jail/base.tgz + + # Go nuts + __jail_freebsd10 lotsofoptions --state present --name testjail \ + --ip "192.168.1.100 netmask 255.255.255.0" \ + --hostname "testjail.example.com" --interface "em0" \ + --onboot --jailbase /my/jail/base.tgz --jaildir /jails SEE ALSO -------- -- cdist-type(7) -- cdist-type__jail(7) +- `cdist-type(7) `_ COPYING diff --git a/cdist/conf/type/__jail_freebsd9/man.text b/cdist/conf/type/__jail_freebsd9/man.rst similarity index 60% rename from cdist/conf/type/__jail_freebsd9/man.text rename to cdist/conf/type/__jail_freebsd9/man.rst index c51f326d..1fe20186 100644 --- a/cdist/conf/type/__jail_freebsd9/man.text +++ b/cdist/conf/type/__jail_freebsd9/man.rst @@ -1,61 +1,58 @@ cdist-type__jail_freebsd9(7) ============================ -Jake Guffey +Manage FreeBSD jails - -NAME ----- -cdist-type__jail_freebsd9 - Manage FreeBSD jails +Jake Guffey DESCRIPTION ----------- -This type is used on FreeBSD 9.x and before to manage jails. +This type is used on FreeBSD <= 9.x to manage jails. REQUIRED PARAMETERS ------------------- -state:: +state Either "present" or "absent", defaults to "present". -jailbase:: +jailbase The location of the .tgz archive containing the base fs for your jails. OPTIONAL PARAMETERS ------------------- -name:: +name The name of the jail. Default is to use the object_id as the jail name. -ip:: +ip The ifconfig style IP/netmask combination to use for the jail guest. If the state parameter is "present," this parameter is required. -hostname:: +hostname The FQDN to use for the jail guest. Defaults to the name parameter. -interface:: +interface The name of the physical interface on the jail server to bind the jail to. Defaults to the first interface found in the output of ifconfig -l. -devfs-ruleset:: +devfs-ruleset The name of the devfs ruleset to associate with the jail. Defaults to "jailrules." This ruleset must be copied to the server via another type. To use this option, devfs-enable must be "true." -jaildir:: +jaildir The location on the remote server to use for hosting jail filesystems. Defaults to /usr/jail. BOOLEAN PARAMETERS ------------------ -stopped:: +stopped Do not start the jail -devfs-disable:: +devfs-disable Whether to disallow devfs mounting within the jail -onboot:: +onboot Whether to add the jail to rc.conf's jail_list variable. @@ -69,49 +66,48 @@ means. MESSAGES -------- -start:: +start The jail was started -stop:: +stop The jail was stopped create: The jail was created -delete:: +delete The jail was deleted -onboot:: +onboot The jail was configured to start on boot EXAMPLES -------- --------------------------------------------------------------------------------- -# Create a jail called www -__jail_freebsd9 www --state present --ip "192.168.1.2" --jailbase /my/jail/base.tgz +.. code-block:: sh -# Remove the jail called www -__jail_freebsd9 www --state absent --jailbase /my/jail/base.tgz + # Create a jail called www + __jail_freebsd9 www --state present --ip "192.168.1.2" --jailbase /my/jail/base.tgz -# The jail www should not be started -__jail_freebsd9 www --state present --stopped \ - --ip "192.168.1.2 netmask 255.255.255.0" \ - --jailbase /my/jail/base.tgz + # Remove the jail called www + __jail_freebsd9 www --state absent --jailbase /my/jail/base.tgz -# Use the name variable explicitly -__jail_freebsd9 thisjail --state present --name www \ - --ip "192.168.1.2" \ - --jailbase /my/jail/base.tgz + # The jail www should not be started + __jail_freebsd9 www --state present --stopped \ + --ip "192.168.1.2 netmask 255.255.255.0" \ + --jailbase /my/jail/base.tgz -# Go nuts -__jail_freebsd9 lotsofoptions --state present --name testjail \ - --ip "192.168.1.100 netmask 255.255.255.0" \ - --hostname "testjail.example.com" --interface "em0" \ - --onboot --jailbase /my/jail/base.tgz --jaildir /jails --------------------------------------------------------------------------------- + # Use the name variable explicitly + __jail_freebsd9 thisjail --state present --name www \ + --ip "192.168.1.2" \ + --jailbase /my/jail/base.tgz + + # Go nuts + __jail_freebsd9 lotsofoptions --state present --name testjail \ + --ip "192.168.1.100 netmask 255.255.255.0" \ + --hostname "testjail.example.com" --interface "em0" \ + --onboot --jailbase /my/jail/base.tgz --jaildir /jails SEE ALSO -------- -- cdist-type(7) -- cdist-type__jail +- `cdist-type(7) `_ COPYING From d2e5fa7167c981e6a3bdd66eb123732581a41da5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 6 Jun 2016 18:39:24 +0200 Subject: [PATCH 06/42] Add some thoughts about improving speed --- docs/2016-06-06.org | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/2016-06-06.org diff --git a/docs/2016-06-06.org b/docs/2016-06-06.org new file mode 100644 index 00000000..8e3624a8 --- /dev/null +++ b/docs/2016-06-06.org @@ -0,0 +1,7 @@ +* 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 From 8246642a45563772a7142188d5bca564982d4aaf Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 3 Jun 2016 12:11:31 +0200 Subject: [PATCH 07/42] Bugfix: ssh mux controlpath too long on some envs. --- scripts/cdist | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/cdist b/scripts/cdist index 6baa28f3..55113be0 100755 --- a/scripts/cdist +++ b/scripts/cdist @@ -26,8 +26,11 @@ def inspect_ssh_mux_opts(control_path_dir="~/.ssh/"): import subprocess import os - control_path = os.path.join(control_path_dir, - "cdist.socket.master-%l-%r@%h:%p") + # socket is always local to each cdist run, it is created in + # temp directory that is created at starting cdist, so + # control_path file name can be static, it will always be + # unique due to unique temp directory name + control_path = os.path.join(control_path_dir, "ssh-control-path") wanted_mux_opts = { "ControlPath": control_path, "ControlMaster": "auto", @@ -147,7 +150,7 @@ def commandline(): # didn't specify command line options nor env vars: # inspect multiplexing options for default cdist.REMOTE_COPY/EXEC if args_dict['remote_copy'] is None or args_dict['remote_exec'] is None: - control_path_dir = tempfile.mkdtemp() + control_path_dir = tempfile.mkdtemp(prefix="cdist") import atexit atexit.register(lambda: shutil.rmtree(control_path_dir)) mux_opts = inspect_ssh_mux_opts(control_path_dir) From fd8e10e12adaf9c4dce88868ea26bb5ee859db8e Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 3 Jun 2016 12:20:28 +0200 Subject: [PATCH 08/42] Improve error reporting for local and remote run. --- cdist/__init__.py | 4 ++-- cdist/exec/local.py | 13 ++++++++----- cdist/exec/remote.py | 13 ++++++++----- cdist/exec/util.py | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 cdist/exec/util.py diff --git a/cdist/__init__.py b/cdist/__init__.py index 4454a3ac..e789499c 100644 --- a/cdist/__init__.py +++ b/cdist/__init__.py @@ -41,8 +41,8 @@ BANNER = """ "P' "" "" """ -REMOTE_COPY = "scp -o User=root -q" -REMOTE_EXEC = "ssh -o User=root -q" +REMOTE_COPY = "scp -o User=root" +REMOTE_EXEC = "ssh -o User=root" class Error(Exception): """Base exception class for this project""" diff --git a/cdist/exec/local.py b/cdist/exec/local.py index c0554831..15f49a89 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -33,6 +33,7 @@ import tempfile import cdist import cdist.message from cdist import core +import cdist.exec.util as exec_util class Local(object): """Execute commands locally. @@ -203,12 +204,14 @@ class Local(object): env.update(message.env) try: + output = exec_util.call_get_output(command, env=env) + self.log.debug("Local output: {}".format(output)) if return_output: - return subprocess.check_output(command, env=env).decode() - else: - subprocess.check_call(command, env=env) - except subprocess.CalledProcessError: - raise cdist.Error("Command failed: " + " ".join(command)) + return output.decode() + except subprocess.CalledProcessError as e: + raise cdist.Error("Command failed: " + " ".join(command) + + " with returncode: {} and output: {}".format( + e.returncode, e.output)) except OSError as error: raise cdist.Error(" ".join(command) + ": " + error.args[1]) finally: diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py index 77e2c8be..c78f02cb 100644 --- a/cdist/exec/remote.py +++ b/cdist/exec/remote.py @@ -26,6 +26,7 @@ import sys import glob import subprocess import logging +import cdist.exec.util as exec_util import cdist @@ -167,12 +168,14 @@ class Remote(object): self.log.debug("Remote run: %s", command) try: + output = exec_util.call_get_output(command, env=os_environ) + self.log.debug("Remote output: {}".format(output)) if return_output: - return subprocess.check_output(command, env=os_environ).decode() - else: - subprocess.check_call(command, env=os_environ) - except subprocess.CalledProcessError: - raise cdist.Error("Command failed: " + " ".join(command)) + return output.decode() + except subprocess.CalledProcessError as e: + raise cdist.Error("Command failed: " + " ".join(command) + + " with returncode: {} and output: {}".format( + e.returncode, e.output)) except OSError as error: raise cdist.Error(" ".join(command) + ": " + error.args[1]) except UnicodeDecodeError: diff --git a/cdist/exec/util.py b/cdist/exec/util.py new file mode 100644 index 00000000..983f455c --- /dev/null +++ b/cdist/exec/util.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# +# 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 subprocess +from tempfile import TemporaryFile + +import cdist + +def call_get_output(command, env=None): + """Run the given command with the given environment. + Return the stdout and stderr output as a byte string. + """ + assert isinstance(command, (list, tuple)), "list or tuple argument expected, got: {}".format(command) + + with TemporaryFile() as fout: + subprocess.check_call(command, env=env, + stdout=fout, stderr=subprocess.STDOUT) + fout.seek(0) + output = fout.read() + + return output From 88b20610cbed739a8d6b7e6edda05457d7ffdf6e Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 6 Jun 2016 22:21:17 +0200 Subject: [PATCH 09/42] Update changelog. --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index dada1d90..b0a8be4c 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Core: Improve error reporting for local and remote run command (Darko Poljak) + 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) From 35bf9aeaa5930383eee9ed58ac7eb07ecb12217b Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Mon, 6 Jun 2016 18:01:14 -0400 Subject: [PATCH 10/42] Updated changelog for jail types --- docs/changelog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/changelog b/docs/changelog index dada1d90..9d95c1ea 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,11 @@ Changelog --------- +4.1.1: 2016-06-06 + * 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) + 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) From e4fe8e8f37e9c9a3da90094cdd49fdd160862987 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 7 Jun 2016 13:44:35 +0200 Subject: [PATCH 11/42] Implement bash and zsh completions. --- completions/bash/cdist-completion.bash | 59 ++++++++++++++++++++++++++ completions/zsh/_cdist | 48 +++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 completions/bash/cdist-completion.bash create mode 100644 completions/zsh/_cdist diff --git a/completions/bash/cdist-completion.bash b/completions/bash/cdist-completion.bash new file mode 100644 index 00000000..3d396bb4 --- /dev/null +++ b/completions/bash/cdist-completion.bash @@ -0,0 +1,59 @@ +_cdist() +{ + local cur prev prevprev opts cmds projects + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + prevprev="${COMP_WORDS[COMP_CWORD-2]}" + opts="-h --help -d --debug -v --verbose -V --version" + cmds="banner shell config" + + case "${prevprev}" in + shell) + case "${prev}" in + -s|--shell) + shells=$(grep -v '^#' /etc/shells) + COMPREPLY=( $(compgen -W "${shells}" -- ${cur}) ) + return 0 + ;; + esac + ;; + esac + + case "${prev}" in + -*) + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + ;; + banner) + opts="-h --help -d --debug -v --verbose" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + ;; + shell) + opts="-h --help -d --debug -v --verbose -s --shell" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + ;; + config) + opts="-h --help -d --debug -v --verbose \ + -c --conf-dir -f --file -i --initial-manifest -n --dry-run \ + -o --out-dir -p --parallel -s --sequential --remote-copy \ + --remote-exec" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + ;; + *) + ;; + esac + + if [[ ${cur} == -* ]]; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi + + COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) ) + return 0 +} + +complete -F _cdist cdist diff --git a/completions/zsh/_cdist b/completions/zsh/_cdist new file mode 100644 index 00000000..2bf324a6 --- /dev/null +++ b/completions/zsh/_cdist @@ -0,0 +1,48 @@ +#compdef cdist + +_cdist() +{ + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments \ + '1: :->opts_cmds'\ + '*: :->opts' + + case $state in + opts_cmds) + _arguments '1:Options and commands:(banner config shell -h --help -d --debug -v --verbose -V --version)' + ;; + *) + case $words[2] in + -*) + opts=(-h --help -d --debug -v --verbose -V --version) + compadd "$@" -- $opts + ;; + banner) + opts=(-h --help -d --debug -v --verbose) + compadd "$@" -- $opts + ;; + shell) + case $words[3] in + -s|--shell) + shells=($(grep -v '^#' /etc/shells)) + compadd "$@" -- $shells + ;; + *) + opts=(-h --help -d --debug -v --verbose -s --shell) + compadd "$@" -- $opts + ;; + esac + ;; + config) + opts=(-h --help -d --debug -v --verbose -c --conf-dir -f --file -i --initial-manifest -n --dry-run -o --out-dir -p --parallel -s --sequential --remote-copy --remote-exec) + compadd "$@" -- $opts + ;; + *) + ;; + esac + esac +} + +_cdist "$@" From bd9008794c5f620ae3957af78881887c9e85d3cc Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 10 Jun 2016 07:50:07 +0200 Subject: [PATCH 12/42] Conflicting requirements bugfix. --- cdist/emulator.py | 37 +++++++++++++++++++--- cdist/test/emulator/__init__.py | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 4 deletions(-) diff --git a/cdist/emulator.py b/cdist/emulator.py index 3f553412..f5a9f645 100644 --- a/cdist/emulator.py +++ b/cdist/emulator.py @@ -77,6 +77,9 @@ class Emulator(object): self.type_name = os.path.basename(argv[0]) self.cdist_type = core.CdistType(self.type_base_path, self.type_name) + # if set then object already exists and this var holds existing + # requirements + self._existing_reqs = None self.__init_log() @@ -150,10 +153,18 @@ class Emulator(object): self.parameters[key] = value if self.cdist_object.exists and not 'CDIST_OVERRIDE' in self.env: + # make existing requirements a set, so we can compare it + # later with new requirements + self._existing_reqs = set(self.cdist_object.requirements) if self.cdist_object.parameters != self.parameters: - raise cdist.Error("Object %s already exists with conflicting parameters:\n%s: %s\n%s: %s" - % (self.cdist_object.name, " ".join(self.cdist_object.source), self.cdist_object.parameters, self.object_source, self.parameters) - ) + errmsg = ("Object %s already exists with conflicting " + "parameters:\n%s: %s\n%s: %s" % (self.cdist_object.name, + " ".join(self.cdist_object.source), + self.cdist_object.parameters, + self.object_source, + self.parameters)) + self.log.error(errmsg) + raise cdist.Error(errmsg) else: if self.cdist_object.exists: self.log.debug('Object %s override forced with CDIST_OVERRIDE',self.cdist_object.name) @@ -210,7 +221,7 @@ class Emulator(object): # if no second last line, we are on the first type, so do not set a requirement pass - + reqs = set() if "require" in self.env: requirements = self.env['require'] self.log.debug("reqs = " + requirements) @@ -234,6 +245,24 @@ class Emulator(object): # (__file//bar => __file/bar) # This ensures pattern matching is done against sanitised list self.cdist_object.requirements.append(cdist_object.name) + reqs.add(cdist_object.name) + if self._existing_reqs is not None: + # if object exists then compare existing and new requirements + self.log.debug("OBJ: {} {}".format(self.cdist_type, self.object_id)) + self.log.debug("EXISTING REQS: {}".format(self._existing_reqs)) + self.log.debug("REQS: {}".format(reqs)) + + if self._existing_reqs != reqs: + errmsg = ("Object {} already exists with conflicting " + "requirements:\n{}: {}\n{}: {}".format( + self.cdist_object.name, + " ".join(self.cdist_object.source), + self._existing_reqs, + self.object_source, + reqs)) + self.log.error(errmsg) + raise cdist.Error(errmsg) + def record_auto_requirements(self): """An object shall automatically depend on all objects that it defined in it's type manifest. diff --git a/cdist/test/emulator/__init__.py b/cdist/test/emulator/__init__.py index f90e5320..b91c1e8f 100644 --- a/cdist/test/emulator/__init__.py +++ b/cdist/test/emulator/__init__.py @@ -133,6 +133,56 @@ class EmulatorTestCase(test.CdistTestCase): self.assertEqual(list(file_object.requirements), ['__planet/mars']) # if we get here all is fine +class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): + + def setUp(self): + self.temp_dir = self.mkdtemp() + handle, self.script = self.mkstemp(dir=self.temp_dir) + os.close(handle) + base_path = self.temp_dir + + self.local = local.Local( + target_host=self.target_host, + base_path=base_path, + exec_path=test.cdist_exec_path, + add_conf_dirs=[conf_dir]) + self.local.create_files_dirs() + + self.manifest = core.Manifest(self.target_host, self.local) + self.env = self.manifest.env_initial_manifest(self.script) + self.env['__cdist_object_marker'] = self.local.object_marker_name + + def tearDown(self): + shutil.rmtree(self.temp_dir) + + def test_object_conflicting_requirements_req_none(self): + argv = ['__directory', 'spam'] + emu = emulator.Emulator(argv, env=self.env) + emu.run() + argv = ['__file', 'eggs'] + self.env['require'] = '__directory/spam' + emu = emulator.Emulator(argv, env=self.env) + emu.run() + argv = ['__file', 'eggs'] + if 'require' in self.env: + del self.env['require'] + emu = emulator.Emulator(argv, env=self.env) + self.assertRaises(cdist.Error, emu.run) + + def test_object_conflicting_requirements_none_req(self): + argv = ['__directory', 'spam'] + emu = emulator.Emulator(argv, env=self.env) + emu.run() + argv = ['__file', 'eggs'] + if 'require' in self.env: + del self.env['require'] + emu = emulator.Emulator(argv, env=self.env) + emu.run() + argv = ['__file', 'eggs'] + self.env['require'] = '__directory/spam' + emu = emulator.Emulator(argv, env=self.env) + self.assertRaises(cdist.Error, emu.run) + class AutoRequireEmulatorTestCase(test.CdistTestCase): @@ -366,3 +416,8 @@ class StdinTestCase(test.CdistTestCase): stdin_saved_by_emulator = fd.read() self.assertEqual(random_string, stdin_saved_by_emulator) + + +if __name__ == '__main__': + import unittest + unittest.main() From 0049b62cca56929ab2ab2feca3b22b24fa9cbdb1 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 11 Jun 2016 12:02:13 +0200 Subject: [PATCH 13/42] Add files conf subdirectory for static files. --- cdist/core/code.py | 3 +++ cdist/core/manifest.py | 2 ++ cdist/exec/local.py | 3 ++- cdist/test/code/__init__.py | 6 ++++++ .../fixtures/conf/type/__dump_environment/gencode-local | 1 + cdist/test/manifest/__init__.py | 7 +++++++ .../test/manifest/fixtures/conf/manifest/dump_environment | 1 + .../fixtures/conf/type/__dump_environment/manifest | 1 + docs/changelog | 3 +++ 9 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cdist/core/code.py b/cdist/core/code.py index 5374bcdf..64517532 100644 --- a/cdist/core/code.py +++ b/cdist/core/code.py @@ -50,6 +50,7 @@ gencode-local __object_id: the objects id __object_fq: full qualified object id, iow: $type.name + / + object_id __type: full qualified path to the type's dir + __files: full qualified path to the files dir returns: string containing the generated code or None @@ -63,6 +64,7 @@ gencode-remote __object_id: the objects id __object_fq: full qualified object id, iow: $type.name + / + object_id __type: full qualified path to the type's dir + __files: full qualified path to the files dir returns: string containing the generated code or None @@ -91,6 +93,7 @@ class Code(object): self.env = { '__target_host': self.target_host, '__global': self.local.base_path, + '__files': self.local.files_path, } def _run_gencode(self, cdist_object, which): diff --git a/cdist/core/manifest.py b/cdist/core/manifest.py index 240e57a1..3b71a215 100644 --- a/cdist/core/manifest.py +++ b/cdist/core/manifest.py @@ -36,6 +36,7 @@ common: __cdist_manifest: full qualified path of the manifest == script __cdist_type_base_path: full qualified path to the directory where types are defined for use in type emulator == local.type_path + __files: full qualified path to the files dir initial manifest is: script: full qualified path to the initial manifest @@ -96,6 +97,7 @@ class Manifest(object): '__cdist_type_base_path': self.local.type_path, # for use in type emulator '__global': self.local.base_path, '__target_host': self.target_host, + '__files': self.local.files_path, } if self.log.getEffectiveLevel() == logging.DEBUG: self.env.update({'__cdist_debug': "yes" }) diff --git a/cdist/exec/local.py b/cdist/exec/local.py index fa003cb0..6f4bd239 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -34,7 +34,7 @@ import cdist import cdist.message from cdist import core -CONF_SUBDIRS_LINKED = [ "explorer", "files", "manifest", "type" ]: +CONF_SUBDIRS_LINKED = [ "explorer", "files", "manifest", "type" ] class Local(object): """Execute commands locally. @@ -111,6 +111,7 @@ class Local(object): self.global_explorer_out_path = os.path.join(self.base_path, "explorer") self.object_path = os.path.join(self.base_path, "object") self.messages_path = os.path.join(self.base_path, "messages") + self.files_path = os.path.join(self.conf_path, "files") # Depending on conf_path self.global_explorer_path = os.path.join(self.conf_path, "explorer") diff --git a/cdist/test/code/__init__.py b/cdist/test/code/__init__.py index 689fcff6..811d3a33 100644 --- a/cdist/test/code/__init__.py +++ b/cdist/test/code/__init__.py @@ -82,6 +82,7 @@ class CodeTestCase(test.CdistTestCase): self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) self.assertEqual(output_dict['__object_name'], self.cdist_object.name) + self.assertEqual(output_dict['__files'], self.local.files_path) def test_run_gencode_remote_environment(self): output_string = self.code.run_gencode_remote(self.cdist_object) @@ -97,6 +98,7 @@ class CodeTestCase(test.CdistTestCase): self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) self.assertEqual(output_dict['__object_name'], self.cdist_object.name) + self.assertEqual(output_dict['__files'], self.local.files_path) def test_transfer_code_remote(self): self.cdist_object.code_remote = self.code.run_gencode_remote(self.cdist_object) @@ -112,3 +114,7 @@ class CodeTestCase(test.CdistTestCase): self.cdist_object.code_remote = self.code.run_gencode_remote(self.cdist_object) self.code.transfer_code_remote(self.cdist_object) self.code.run_code_remote(self.cdist_object) + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local b/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local index 771894fb..5883c268 100755 --- a/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local +++ b/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local @@ -6,3 +6,4 @@ echo "echo __type: $__type" echo "echo __object: $__object" echo "echo __object_id: $__object_id" echo "echo __object_name: $__object_name" +echo "echo __files: $__files" diff --git a/cdist/test/manifest/__init__.py b/cdist/test/manifest/__init__.py index cc60c844..f9eb8b8a 100644 --- a/cdist/test/manifest/__init__.py +++ b/cdist/test/manifest/__init__.py @@ -81,6 +81,7 @@ class ManifestTestCase(test.CdistTestCase): self.assertEqual(output_dict['__global'], self.local.base_path) self.assertEqual(output_dict['__cdist_type_base_path'], self.local.type_path) self.assertEqual(output_dict['__manifest'], self.local.manifest_path) + self.assertEqual(output_dict['__files'], self.local.files_path) def test_type_manifest_environment(self): cdist_type = core.CdistType(self.local.type_path, '__dump_environment') @@ -105,6 +106,7 @@ class ManifestTestCase(test.CdistTestCase): self.assertEqual(output_dict['__object'], cdist_object.absolute_path) self.assertEqual(output_dict['__object_id'], cdist_object.object_id) self.assertEqual(output_dict['__object_name'], cdist_object.name) + self.assertEqual(output_dict['__files'], self.local.files_path) def test_debug_env_setup(self): current_level = self.log.getEffectiveLevel() @@ -112,3 +114,8 @@ class ManifestTestCase(test.CdistTestCase): manifest = cdist.core.manifest.Manifest(self.target_host, self.local) self.assertTrue("__cdist_debug" in manifest.env) self.log.setLevel(current_level) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/cdist/test/manifest/fixtures/conf/manifest/dump_environment b/cdist/test/manifest/fixtures/conf/manifest/dump_environment index 7ce983ab..df901910 100755 --- a/cdist/test/manifest/fixtures/conf/manifest/dump_environment +++ b/cdist/test/manifest/fixtures/conf/manifest/dump_environment @@ -6,4 +6,5 @@ __target_host: $__target_host __global: $__global __cdist_type_base_path: $__cdist_type_base_path __manifest: $__manifest +__files: $__files DONE diff --git a/cdist/test/manifest/fixtures/conf/type/__dump_environment/manifest b/cdist/test/manifest/fixtures/conf/type/__dump_environment/manifest index e135de35..13efe038 100755 --- a/cdist/test/manifest/fixtures/conf/type/__dump_environment/manifest +++ b/cdist/test/manifest/fixtures/conf/type/__dump_environment/manifest @@ -10,4 +10,5 @@ __self: $__self __object: $__object __object_id: $__object_id __object_name: $__object_name +__files: $__files DONE diff --git a/docs/changelog b/docs/changelog index dada1d90..ca567627 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,6 +1,9 @@ Changelog --------- +next: + * Core: Add files directory for static files (Darko Poljak) + 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) From d7583e7a1a33763df579e5ef0294b4f42616e52e Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 12 Jun 2016 17:55:29 +0200 Subject: [PATCH 14/42] Add __files to shell env. --- cdist/shell.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cdist/shell.py b/cdist/shell.py index d0921bc9..83b2acf7 100644 --- a/cdist/shell.py +++ b/cdist/shell.py @@ -60,6 +60,7 @@ class Shell(object): '__target_host': self.target_host, '__manifest': self.local.manifest_path, '__explorer': self.local.global_explorer_path, + '__files': self.local.files_path, } self.env.update(additional_env) From e6d439f2e984fab61594c12d346e21c2c5373f6d Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 12 Jun 2016 20:51:14 +0200 Subject: [PATCH 15/42] Fix changelog: 'next'. --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 9d95c1ea..8ad8e953 100644 --- a/docs/changelog +++ b/docs/changelog @@ -1,7 +1,7 @@ Changelog --------- -4.1.1: 2016-06-06 +next: * 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) From 2e1cc0a89b489abfa07d72a584eb45aafb19f2e9 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 22 Jun 2016 12:20:34 +0200 Subject: [PATCH 16/42] Update changelog. --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 8ad8e953..207125db 100644 --- a/docs/changelog +++ b/docs/changelog @@ -2,6 +2,7 @@ Changelog --------- next: + * Custom: Add bash and zsh completions (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) From 5ee20f7886d81be81407c33cc205d82d1dc51c2e Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 22 Jun 2016 12:23:31 +0200 Subject: [PATCH 17/42] Update changelog. --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index 8ad8e953..31f2bb35 100644 --- a/docs/changelog +++ b/docs/changelog @@ -2,6 +2,7 @@ Changelog --------- next: + * Core: Fix conflicting requirements (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) From 9802467bbb26ae74d5702f814a440642009edfc9 Mon Sep 17 00:00:00 2001 From: Stephan Leemburg Date: Wed, 22 Jun 2016 13:17:03 +0200 Subject: [PATCH 18/42] Add openvz/lxc discovery --- cdist/conf/explorer/machine_type | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cdist/conf/explorer/machine_type b/cdist/conf/explorer/machine_type index 74789f5a..c0541ad5 100755 --- a/cdist/conf/explorer/machine_type +++ b/cdist/conf/explorer/machine_type @@ -22,6 +22,17 @@ # FIXME: other system types (not linux ...) +if [ -d "/proc/vz" -a ! -d "/proc/bc" ]; then + echo openvz + exit +fi + +if [ -e "/proc/1/environ" ] && + cat "/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container='; then + echo lxc + exit +fi + if [ -r /proc/cpuinfo ]; then # this should only exist on virtual guest machines, # tested on vmware, xen, kvm From 98160624a0069521d9593f46fae61b73cfb68d12 Mon Sep 17 00:00:00 2001 From: Stephan Leemburg Date: Wed, 22 Jun 2016 13:17:03 +0200 Subject: [PATCH 19/42] Add openvz/lxc discovery --- cdist/conf/explorer/machine_type | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cdist/conf/explorer/machine_type b/cdist/conf/explorer/machine_type index 74789f5a..c0541ad5 100755 --- a/cdist/conf/explorer/machine_type +++ b/cdist/conf/explorer/machine_type @@ -22,6 +22,17 @@ # FIXME: other system types (not linux ...) +if [ -d "/proc/vz" -a ! -d "/proc/bc" ]; then + echo openvz + exit +fi + +if [ -e "/proc/1/environ" ] && + cat "/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container='; then + echo lxc + exit +fi + if [ -r /proc/cpuinfo ]; then # this should only exist on virtual guest machines, # tested on vmware, xen, kvm From 95461cded786c58fd09962756809e55666198fc7 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 22 Jun 2016 13:24:12 +0200 Subject: [PATCH 20/42] Fix tabulation (Dmitry Bogatov). --- docs/man/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/man/Makefile b/docs/man/Makefile index 721acaf6..c2e398c5 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -9,7 +9,7 @@ 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/) + $(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. From 9300eda3c6fa7960d6d179fe0cfde073b84ad309 Mon Sep 17 00:00:00 2001 From: Stephan Leemburg Date: Wed, 22 Jun 2016 13:32:51 +0200 Subject: [PATCH 21/42] Add scientific --- cdist/conf/explorer/os | 5 +++++ cdist/conf/explorer/os_version | 2 +- cdist/conf/type/__consul/manifest | 2 +- cdist/conf/type/__consul_agent/manifest | 2 +- cdist/conf/type/__consul_template/manifest | 2 +- cdist/conf/type/__hostname/gencode-remote | 2 +- cdist/conf/type/__hostname/manifest | 2 +- cdist/conf/type/__locale/manifest | 2 +- cdist/conf/type/__package/manifest | 2 +- cdist/conf/type/__package_update_index/gencode-remote | 2 +- cdist/conf/type/__package_upgrade_all/gencode-remote | 2 +- cdist/conf/type/__package_yum/gencode-remote | 2 +- cdist/conf/type/__postfix/manifest | 2 +- cdist/conf/type/__postfix_master/manifest | 2 +- cdist/conf/type/__postfix_postconf/explorer/value | 2 +- cdist/conf/type/__postfix_postconf/gencode-remote | 2 +- cdist/conf/type/__postfix_reload/gencode-remote | 2 +- cdist/conf/type/__start_on_boot/explorer/state | 2 +- cdist/conf/type/__start_on_boot/gencode-remote | 2 +- cdist/conf/type/__timezone/manifest | 2 +- cdist/conf/type/__yum_repo/manifest | 2 +- docs/web/cdist/os.mdwn | 1 + 22 files changed, 26 insertions(+), 20 deletions(-) diff --git a/cdist/conf/explorer/os b/cdist/conf/explorer/os index de1d29c3..550192d4 100755 --- a/cdist/conf/explorer/os +++ b/cdist/conf/explorer/os @@ -72,6 +72,11 @@ if [ -f /etc/owl-release ]; then fi ### Redhat and derivatives +if grep -q ^Scientific /etc/redhat-release 2>/dev/null; then + echo scientific + exit 0 +fi + if grep -q ^CentOS /etc/redhat-release 2>/dev/null; then echo centos exit 0 diff --git a/cdist/conf/explorer/os_version b/cdist/conf/explorer/os_version index 6c7becdc..58f750b0 100755 --- a/cdist/conf/explorer/os_version +++ b/cdist/conf/explorer/os_version @@ -54,7 +54,7 @@ case "$($__explorer/os)" in owl) cat /etc/owl-release ;; - redhat|centos|mitel) + redhat|centos|mitel|scientific) cat /etc/redhat-release ;; slackware) diff --git a/cdist/conf/type/__consul/manifest b/cdist/conf/type/__consul/manifest index 0187d959..b16c5749 100755 --- a/cdist/conf/type/__consul/manifest +++ b/cdist/conf/type/__consul/manifest @@ -23,7 +23,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - centos|redhat|ubuntu|debian|archlinux|gentoo) + scientific|centos|redhat|ubuntu|debian|archlinux|gentoo) # any linux should work : ;; diff --git a/cdist/conf/type/__consul_agent/manifest b/cdist/conf/type/__consul_agent/manifest index b4d1d75c..7f180494 100755 --- a/cdist/conf/type/__consul_agent/manifest +++ b/cdist/conf/type/__consul_agent/manifest @@ -23,7 +23,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - centos|debian|redhat|ubuntu) + scientific|centos|debian|redhat|ubuntu) # whitelist safeguard : ;; diff --git a/cdist/conf/type/__consul_template/manifest b/cdist/conf/type/__consul_template/manifest index cedcb413..4448cc71 100755 --- a/cdist/conf/type/__consul_template/manifest +++ b/cdist/conf/type/__consul_template/manifest @@ -22,7 +22,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - centos|redhat) + scientific|centos|redhat) # whitelist safeguard service_onchange='service consul-template status >/dev/null && service consul-template reload || true' \ ;; diff --git a/cdist/conf/type/__hostname/gencode-remote b/cdist/conf/type/__hostname/gencode-remote index 9fac7bf4..c1808de0 100755 --- a/cdist/conf/type/__hostname/gencode-remote +++ b/cdist/conf/type/__hostname/gencode-remote @@ -40,7 +40,7 @@ case "$os" in exit 0 fi ;; - centos) + scientific|centos) if [ "$name_sysconfig" = "$name_should" -a "$name_running" = "$name_should" ]; then exit 0 fi diff --git a/cdist/conf/type/__hostname/manifest b/cdist/conf/type/__hostname/manifest index 76f962e0..842075e0 100755 --- a/cdist/conf/type/__hostname/manifest +++ b/cdist/conf/type/__hostname/manifest @@ -38,7 +38,7 @@ case "$os" in # handled in gencode-remote : ;; - centos) + scientific|centos) __key_value sysconfig-hostname \ --file /etc/sysconfig/network \ --delimiter '=' \ diff --git a/cdist/conf/type/__locale/manifest b/cdist/conf/type/__locale/manifest index c1837ae3..d360e9f3 100644 --- a/cdist/conf/type/__locale/manifest +++ b/cdist/conf/type/__locale/manifest @@ -30,7 +30,7 @@ case "$os" in # Debian needs a seperate package __package locales --state present ;; - archlinux|suse|ubuntu|centos) + archlinux|suse|ubuntu|scientific|centos) : ;; *) diff --git a/cdist/conf/type/__package/manifest b/cdist/conf/type/__package/manifest index 6b0daa98..c745f85f 100755 --- a/cdist/conf/type/__package/manifest +++ b/cdist/conf/type/__package/manifest @@ -30,7 +30,7 @@ else # By default determine package manager based on operating system os="$(cat "$__global/explorer/os")" case "$os" in - amazon|centos|fedora|redhat) type="yum" ;; + amazon|scientific|centos|fedora|redhat) type="yum" ;; archlinux) type="pacman" ;; debian|ubuntu|devuan) type="apt" ;; freebsd) diff --git a/cdist/conf/type/__package_update_index/gencode-remote b/cdist/conf/type/__package_update_index/gencode-remote index 589e7202..bf6a532d 100755 --- a/cdist/conf/type/__package_update_index/gencode-remote +++ b/cdist/conf/type/__package_update_index/gencode-remote @@ -29,7 +29,7 @@ else # By default determine package manager based on operating system os="$(cat "$__global/explorer/os")" case "$os" in - amazon|centos|fedora|redhat) type="yum" ;; + amazon|scientific|centos|fedora|redhat) type="yum" ;; debian|ubuntu|devuan) type="apt" ;; archlinux) type="pacman" ;; *) diff --git a/cdist/conf/type/__package_upgrade_all/gencode-remote b/cdist/conf/type/__package_upgrade_all/gencode-remote index 4d034816..9dd3ddf6 100755 --- a/cdist/conf/type/__package_upgrade_all/gencode-remote +++ b/cdist/conf/type/__package_upgrade_all/gencode-remote @@ -30,7 +30,7 @@ else # By default determine package manager based on operating system os="$(cat "$__global/explorer/os")" case "$os" in - amazon|centos|fedora|redhat) type="yum" ;; + amazon|scientific|centos|fedora|redhat) type="yum" ;; debian|ubuntu|devuan) type="apt" ;; archlinux) type="pacman" ;; *) diff --git a/cdist/conf/type/__package_yum/gencode-remote b/cdist/conf/type/__package_yum/gencode-remote index 32a794a0..08c5c2b5 100755 --- a/cdist/conf/type/__package_yum/gencode-remote +++ b/cdist/conf/type/__package_yum/gencode-remote @@ -37,7 +37,7 @@ fi state_should="$(cat "$__object/parameter/state")" -if grep -q -E "(centos|redhat|amazon)" "$__global/explorer/os"; then +if grep -q -E "(scientific|centos|redhat|amazon)" "$__global/explorer/os"; then opts="-y --quiet" else opts="--assumeyes --quiet" diff --git a/cdist/conf/type/__postfix/manifest b/cdist/conf/type/__postfix/manifest index 43443e1e..b425e072 100755 --- a/cdist/conf/type/__postfix/manifest +++ b/cdist/conf/type/__postfix/manifest @@ -22,7 +22,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - ubuntu|debian|archlinux|suse|centos|devuan) + ubuntu|debian|archlinux|suse|scientific|centos|devuan) __package postfix --state present ;; *) diff --git a/cdist/conf/type/__postfix_master/manifest b/cdist/conf/type/__postfix_master/manifest index 3d82c526..af71b88e 100755 --- a/cdist/conf/type/__postfix_master/manifest +++ b/cdist/conf/type/__postfix_master/manifest @@ -22,7 +22,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - ubuntu|debian|archlinux|centos|devuan) + ubuntu|debian|archlinux|scientific|centos|devuan) : ;; *) diff --git a/cdist/conf/type/__postfix_postconf/explorer/value b/cdist/conf/type/__postfix_postconf/explorer/value index d451bce6..17126c94 100755 --- a/cdist/conf/type/__postfix_postconf/explorer/value +++ b/cdist/conf/type/__postfix_postconf/explorer/value @@ -22,7 +22,7 @@ os=$("$__explorer/os") case "$os" in - ubuntu|debian|archlinux|suse|centos|devuan) + ubuntu|debian|archlinux|suse|scientific|centos|devuan) : ;; *) diff --git a/cdist/conf/type/__postfix_postconf/gencode-remote b/cdist/conf/type/__postfix_postconf/gencode-remote index b3557640..f886499b 100755 --- a/cdist/conf/type/__postfix_postconf/gencode-remote +++ b/cdist/conf/type/__postfix_postconf/gencode-remote @@ -21,7 +21,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - ubuntu|debian|archlinux|suse|centos|devuan) + ubuntu|debian|archlinux|suse|scientific|centos|devuan) : ;; *) diff --git a/cdist/conf/type/__postfix_reload/gencode-remote b/cdist/conf/type/__postfix_reload/gencode-remote index 7323606c..0efd6022 100755 --- a/cdist/conf/type/__postfix_reload/gencode-remote +++ b/cdist/conf/type/__postfix_reload/gencode-remote @@ -22,7 +22,7 @@ os=$(cat "$__global/explorer/os") case "$os" in - ubuntu|debian|archlinux|centos|devuan) + ubuntu|debian|archlinux|scientific|centos|devuan) echo "postfix reload" ;; *) diff --git a/cdist/conf/type/__start_on_boot/explorer/state b/cdist/conf/type/__start_on_boot/explorer/state index ca0f3a51..d49f01c7 100644 --- a/cdist/conf/type/__start_on_boot/explorer/state +++ b/cdist/conf/type/__start_on_boot/explorer/state @@ -47,7 +47,7 @@ else [ -f "/etc/init/${name}.conf" ] && state="present" ;; - amazon|centos|fedora|owl|redhat) + amazon|scientific|centos|fedora|owl|redhat) state=$(chkconfig --level "$runlevel" "$name" || echo absent) [ "$state" ] || state="present" ;; diff --git a/cdist/conf/type/__start_on_boot/gencode-remote b/cdist/conf/type/__start_on_boot/gencode-remote index 057f9f48..e77132c9 100644 --- a/cdist/conf/type/__start_on_boot/gencode-remote +++ b/cdist/conf/type/__start_on_boot/gencode-remote @@ -59,7 +59,7 @@ case "$state_should" in echo rc-update add \"$name\" \"$target_runlevel\" ;; - amazon|centos|fedora|owl|redhat|suse) + amazon|scientific|centos|fedora|owl|redhat|suse) echo chkconfig \"$name\" on ;; diff --git a/cdist/conf/type/__timezone/manifest b/cdist/conf/type/__timezone/manifest index 8ddfd122..bcbe41c3 100755 --- a/cdist/conf/type/__timezone/manifest +++ b/cdist/conf/type/__timezone/manifest @@ -38,7 +38,7 @@ case "$os" in # whitelist : ;; - centos) + scientific|centos) __package tzdata --state present export require="__package/tzdata" __file /etc/sysconfig/clock \ diff --git a/cdist/conf/type/__yum_repo/manifest b/cdist/conf/type/__yum_repo/manifest index 9bb63c3c..950c3b7a 100755 --- a/cdist/conf/type/__yum_repo/manifest +++ b/cdist/conf/type/__yum_repo/manifest @@ -22,7 +22,7 @@ os=$(cat "$__global/explorer/os") state="$(cat "$__object/parameter/state")" case "$os" in - centos) + scientific|centos) repo_name="$__object_id" export repo_name repo_file="/etc/yum.repos.d/${repo_name}.repo" diff --git a/docs/web/cdist/os.mdwn b/docs/web/cdist/os.mdwn index 24992439..3677f52c 100644 --- a/docs/web/cdist/os.mdwn +++ b/docs/web/cdist/os.mdwn @@ -5,6 +5,7 @@ cdist was tested or is know to run on at least * [Archlinux](http://www.archlinux.org/) * [Debian](http://www.debian.org/) * [CentOS](http://www.centos.org/) + * [Scientific](https://www.scientificlinux.org/) * [Fedora](http://fedoraproject.org/) * [FreeBSD](http://www.freebsd.org) * [Gentoo](http://www.gentoo.org/) From d48b65ed53cd0e376198f443b6ea8913324876d6 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 23 Jun 2016 10:56:37 +0200 Subject: [PATCH 22/42] Fix process error handling in local. --- cdist/exec/local.py | 9 ++++----- cdist/exec/util.py | 49 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/cdist/exec/local.py b/cdist/exec/local.py index e02a33aa..5a0a8644 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -207,14 +207,13 @@ class Local(object): env.update(message.env) try: - output = exec_util.call_get_output(command, env=env) - self.log.debug("Local output: {}".format(output)) + output, errout = exec_util.call_get_output(command, env=env) + self.log.debug("Local stdout: {}".format(output)) + self.log.debug("Local stderr: {}".format(errout)) if return_output: return output.decode() except subprocess.CalledProcessError as e: - raise cdist.Error("Command failed: " + " ".join(command) - + " with returncode: {} and output: {}".format( - e.returncode, e.output)) + exec_util.handle_called_process_error(e, command) except OSError as error: raise cdist.Error(" ".join(command) + ": " + error.args[1]) finally: diff --git a/cdist/exec/util.py b/cdist/exec/util.py index 983f455c..15430f13 100644 --- a/cdist/exec/util.py +++ b/cdist/exec/util.py @@ -20,20 +20,61 @@ # import subprocess +import sys from tempfile import TemporaryFile import cdist +STDERR_UNSUPPORTED = 'Not supported in this python version' + def call_get_output(command, env=None): """Run the given command with the given environment. - Return the stdout and stderr output as a byte string. + Return the tuple of stdout and stderr output as a byte strings. """ - assert isinstance(command, (list, tuple)), "list or tuple argument expected, got: {}".format(command) + + assert isinstance(command, (list, tuple)), ( + "list or tuple argument expected, got: {}".format(command)) + + if sys.version_info >= (3, 5): + return call_get_out_err(command, env) + else: + return (call_get_stdout(command, env), STDERR_UNSUPPORTED) + +def handle_called_process_error(err, command): + if sys.version_info >= (3, 5): + errout = err.stderr + else: + errout = STDERR_UNSUPPORTED + raise cdist.Error("Command failed: " + " ".join(command) + + " with returncode: {} and stdout: {}, stderr: {}".format( + err.returncode, err.output, errout)) + +def call_get_stdout(command, env=None): + """Run the given command with the given environment. + Return the stdout output as a byte string, stderr is ignored. + """ + assert isinstance(command, (list, tuple)), ( + "list or tuple argument expected, got: {}".format(command)) with TemporaryFile() as fout: - subprocess.check_call(command, env=env, - stdout=fout, stderr=subprocess.STDOUT) + subprocess.check_call(command, env=env, stdout=fout) fout.seek(0) output = fout.read() return output + +def call_get_out_err(command, env=None): + """Run the given command with the given environment. + Return the tuple of stdout and stderr output as a byte strings. + """ + assert isinstance(command, (list, tuple)), ( + "list or tuple argument expected, got: {}".format(command)) + + with TemporaryFile() as fout, TemporaryFile() as ferr: + subprocess.check_call(command, env=env, + stdout=fout, stderr=ferr) + fout.seek(0) + ferr.seek(0) + output = (fout.read(), ferr.read()) + + return output From b89077f9a50df525a3ab996b0a83baa1c8f8c1c1 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 23 Jun 2016 16:08:59 +0200 Subject: [PATCH 23/42] Better sphinx manpage ext. Add custom dotman Makefile target for custom .cdist directory. --- Makefile | 23 ++++++ cdist/conf/type/__apt_key/man.rst | 5 +- cdist/conf/type/__apt_key_uri/man.rst | 5 +- cdist/conf/type/__apt_norecommends/man.rst | 5 +- cdist/conf/type/__apt_ppa/man.rst | 5 +- cdist/conf/type/__apt_source/man.rst | 5 +- cdist/conf/type/__apt_update_index/man.rst | 5 +- cdist/conf/type/__block/man.rst | 5 +- cdist/conf/type/__ccollect_source/man.rst | 5 +- cdist/conf/type/__cdist/man.rst | 5 +- cdist/conf/type/__cdistmarker/man.rst | 5 +- cdist/conf/type/__config_file/man.rst | 5 +- cdist/conf/type/__consul/man.rst | 5 +- cdist/conf/type/__consul_agent/man.rst | 5 +- cdist/conf/type/__consul_check/man.rst | 5 +- cdist/conf/type/__consul_reload/man.rst | 5 +- cdist/conf/type/__consul_service/man.rst | 5 +- cdist/conf/type/__consul_template/man.rst | 5 +- .../type/__consul_template_template/man.rst | 5 +- cdist/conf/type/__consul_watch_checks/man.rst | 5 +- cdist/conf/type/__consul_watch_event/man.rst | 5 +- cdist/conf/type/__consul_watch_key/man.rst | 5 +- .../type/__consul_watch_keyprefix/man.rst | 5 +- cdist/conf/type/__consul_watch_nodes/man.rst | 5 +- .../conf/type/__consul_watch_service/man.rst | 5 +- .../conf/type/__consul_watch_services/man.rst | 5 +- cdist/conf/type/__cron/man.rst | 5 +- .../type/__debconf_set_selections/man.rst | 5 +- cdist/conf/type/__directory/man.rst | 5 +- cdist/conf/type/__dog_vdi/man.rst | 5 +- cdist/conf/type/__file/man.rst | 5 +- cdist/conf/type/__firewalld_rule/man.rst | 5 +- cdist/conf/type/__git/man.rst | 5 +- cdist/conf/type/__group/man.rst | 5 +- cdist/conf/type/__hostname/man.rst | 5 +- cdist/conf/type/__iptables_apply/man.rst | 5 +- cdist/conf/type/__iptables_rule/man.rst | 5 +- cdist/conf/type/__issue/man.rst | 5 +- cdist/conf/type/__jail/man.rst | 5 +- cdist/conf/type/__jail_freebsd10/man.rst | 5 +- cdist/conf/type/__jail_freebsd9/man.rst | 5 +- cdist/conf/type/__key_value/man.rst | 5 +- cdist/conf/type/__line/man.rst | 5 +- cdist/conf/type/__link/man.rst | 5 +- cdist/conf/type/__locale/man.rst | 5 +- cdist/conf/type/__motd/man.rst | 5 +- cdist/conf/type/__mount/man.rst | 5 +- cdist/conf/type/__mysql_database/man.rst | 5 +- cdist/conf/type/__package/man.rst | 5 +- cdist/conf/type/__package_apt/man.rst | 5 +- cdist/conf/type/__package_emerge/man.rst | 5 +- .../__package_emerge_dependencies/man.rst | 5 +- cdist/conf/type/__package_luarocks/man.rst | 5 +- cdist/conf/type/__package_opkg/man.rst | 5 +- cdist/conf/type/__package_pacman/man.rst | 5 +- cdist/conf/type/__package_pip/man.rst | 5 +- cdist/conf/type/__package_pkg_freebsd/man.rst | 5 +- cdist/conf/type/__package_pkg_openbsd/man.rst | 5 +- .../conf/type/__package_pkgng_freebsd/man.rst | 5 +- cdist/conf/type/__package_rubygem/man.rst | 5 +- .../conf/type/__package_update_index/man.rst | 5 +- cdist/conf/type/__package_upgrade_all/man.rst | 5 +- cdist/conf/type/__package_yum/man.rst | 5 +- cdist/conf/type/__package_zypper/man.rst | 5 +- cdist/conf/type/__pacman_conf/man.rst | 5 +- .../conf/type/__pacman_conf_integrate/man.rst | 5 +- cdist/conf/type/__pf_apply/man.rst | 7 +- cdist/conf/type/__pf_ruleset/man.rst | 5 +- cdist/conf/type/__postfix/man.rst | 5 +- cdist/conf/type/__postfix_master/man.rst | 5 +- cdist/conf/type/__postfix_postconf/man.rst | 5 +- cdist/conf/type/__postfix_postmap/man.rst | 5 +- cdist/conf/type/__postfix_reload/man.rst | 5 +- cdist/conf/type/__postgres_database/man.rst | 5 +- cdist/conf/type/__postgres_role/man.rst | 5 +- cdist/conf/type/__process/man.rst | 5 +- cdist/conf/type/__pyvenv/man.rst | 5 +- cdist/conf/type/__qemu_img/man.rst | 5 +- cdist/conf/type/__rbenv/man.rst | 5 +- cdist/conf/type/__rsync/man.rst | 5 +- cdist/conf/type/__rvm/man.rst | 5 +- cdist/conf/type/__rvm_gem/man.rst | 5 +- cdist/conf/type/__rvm_gemset/man.rst | 5 +- cdist/conf/type/__rvm_ruby/man.rst | 5 +- cdist/conf/type/__ssh_authorized_key/man.rst | 5 +- cdist/conf/type/__ssh_authorized_keys/man.rst | 5 +- cdist/conf/type/__ssh_dot_ssh/man.rst | 7 +- cdist/conf/type/__staged_file/man.rst | 5 +- cdist/conf/type/__start_on_boot/man.rst | 5 +- cdist/conf/type/__timezone/man.rst | 5 +- cdist/conf/type/__update_alternatives/man.rst | 5 +- cdist/conf/type/__user/man.rst | 5 +- cdist/conf/type/__user_groups/man.rst | 5 +- cdist/conf/type/__yum_repo/man.rst | 5 +- cdist/conf/type/__zypper_repo/man.rst | 5 +- cdist/conf/type/__zypper_service/man.rst | 5 +- cdist/sphinxext/__init__.py | 0 cdist/sphinxext/manpage.py | 80 +++++++++++++++++++ docs/man/Makefile | 2 +- docs/man/cdist-reference.rst.sh | 5 +- docs/man/conf.py | 17 ++-- docs/man/man1/cdist.rst | 5 +- docs/man/man7/cdist-best-practice.rst | 5 +- docs/man/man7/cdist-bootstrap.rst | 5 +- docs/man/man7/cdist-explorer.rst | 5 +- docs/man/man7/cdist-hacker.rst | 5 +- docs/man/man7/cdist-manifest.rst | 5 +- docs/man/man7/cdist-messaging.rst | 5 +- docs/man/man7/cdist-quickstart.rst | 5 +- docs/man/man7/cdist-remote-exec-copy.rst | 5 +- docs/man/man7/cdist-stages.rst | 5 +- docs/man/man7/cdist-troubleshooting.rst | 5 +- docs/man/man7/cdist-tutorial.rst | 5 +- docs/man/man7/cdist-type.rst | 5 +- 114 files changed, 549 insertions(+), 122 deletions(-) create mode 100644 cdist/sphinxext/__init__.py create mode 100644 cdist/sphinxext/manpage.py diff --git a/Makefile b/Makefile index e584fc63..d00739bb 100644 --- a/Makefile +++ b/Makefile @@ -88,6 +88,29 @@ man-latest-link: web-pub ssh staticweb.ungleich.ch \ "cd /home/services/www/nico/nico.schottelius.org/www/software/cdist/man/ && rm -f latest && ln -sf "$(CHANGELOG_VERSION)" latest" +# Manpages: .cdist Types +DOT_CDIST_PATH=${HOME}/.cdist +DOTMAN7DSTDIR=$(MAN7DSTDIR) +DOTTYPEDIR=$(DOT_CDIST_PATH)/type +$(info $(DOTTYPEDIR)) +DOTMANTYPESRC=$(shell ls $(DOTTYPEDIR)/*/man.rst) +$(info $(DOTMANTYPESRC)) +DOTMANTYPEPREFIX=$(subst $(DOTTYPEDIR)/,$(DOTMAN7DSTDIR)/cdist-type,$(DOTMANTYPESRC)) +$(info $(DOTMANTYPEPREFIX)) +DOTMANTYPES=$(subst /man.rst,.rst,$(DOTMANTYPEPREFIX)) +$(info $(DOTMANTYPES)) + +# Link manpage: do not create man.html but correct named file +$(DOTMAN7DSTDIR)/cdist-type%.rst: $(DOTTYPEDIR)/%/man.rst + ln -sf "$^" $@ + +# Manpages #3: generic part +dotmansphinxman: $(DOTMANTYPES) + $(SPHINXM) + +dotman: dotmansphinxman + + ################################################################################ # Speeches # diff --git a/cdist/conf/type/__apt_key/man.rst b/cdist/conf/type/__apt_key/man.rst index 43dc89b1..cb4c4108 100644 --- a/cdist/conf/type/__apt_key/man.rst +++ b/cdist/conf/type/__apt_key/man.rst @@ -1,6 +1,9 @@ cdist-type__apt_key(7) ====================== -Manage the list of keys used by apt + +NAME +---- +cdist-type__apt_key - Manage the list of keys used by apt Steven Armstrong diff --git a/cdist/conf/type/__apt_key_uri/man.rst b/cdist/conf/type/__apt_key_uri/man.rst index a235e13a..ee8d1601 100644 --- a/cdist/conf/type/__apt_key_uri/man.rst +++ b/cdist/conf/type/__apt_key_uri/man.rst @@ -1,6 +1,9 @@ cdist-type__apt_key_uri(7) ========================== -Add apt key from uri + +NAME +---- +cdist-type__apt_key_uri - Add apt key from uri Steven Armstrong diff --git a/cdist/conf/type/__apt_norecommends/man.rst b/cdist/conf/type/__apt_norecommends/man.rst index 232bb166..09ea9d16 100644 --- a/cdist/conf/type/__apt_norecommends/man.rst +++ b/cdist/conf/type/__apt_norecommends/man.rst @@ -1,6 +1,9 @@ cdist-type__apt_norecommends(7) =============================== -Configure apt to not install recommended packages + +NAME +---- +cdist-type__apt_norecommends - Configure apt to not install recommended packages Steven Armstrong diff --git a/cdist/conf/type/__apt_ppa/man.rst b/cdist/conf/type/__apt_ppa/man.rst index e39bd6b2..922b18d5 100644 --- a/cdist/conf/type/__apt_ppa/man.rst +++ b/cdist/conf/type/__apt_ppa/man.rst @@ -1,6 +1,9 @@ cdist-type__apt_ppa(7) ====================== -Manage ppa repositories + +NAME +---- +cdist-type__apt_ppa - Manage ppa repositories Steven Armstrong diff --git a/cdist/conf/type/__apt_source/man.rst b/cdist/conf/type/__apt_source/man.rst index 70649c4b..2e09aee5 100644 --- a/cdist/conf/type/__apt_source/man.rst +++ b/cdist/conf/type/__apt_source/man.rst @@ -1,6 +1,9 @@ cdist-type__apt_source(7) ========================= -Manage apt sources + +NAME +---- +cdist-type__apt_source - Manage apt sources Steven Armstrong diff --git a/cdist/conf/type/__apt_update_index/man.rst b/cdist/conf/type/__apt_update_index/man.rst index 2fc66c65..ce8610f3 100644 --- a/cdist/conf/type/__apt_update_index/man.rst +++ b/cdist/conf/type/__apt_update_index/man.rst @@ -1,6 +1,9 @@ cdist-type__apt_update_index(7) =============================== -Update apt's package index + +NAME +---- +cdist-type__apt_update_index - Update apt's package index Steven Armstrong diff --git a/cdist/conf/type/__block/man.rst b/cdist/conf/type/__block/man.rst index 4b7d61dc..bd5304d8 100644 --- a/cdist/conf/type/__block/man.rst +++ b/cdist/conf/type/__block/man.rst @@ -1,6 +1,9 @@ cdist-type__block(7) ==================== -Manage blocks of text in files + +NAME +---- +cdist-type__block - Manage blocks of text in files Steven Armstrong diff --git a/cdist/conf/type/__ccollect_source/man.rst b/cdist/conf/type/__ccollect_source/man.rst index 12fb8f42..29baa5c4 100644 --- a/cdist/conf/type/__ccollect_source/man.rst +++ b/cdist/conf/type/__ccollect_source/man.rst @@ -1,6 +1,9 @@ cdist-type__ccollect_source(7) ============================== -Manage ccollect sources + +NAME +---- +cdist-type__ccollect_source - Manage ccollect sources Nico Schottelius diff --git a/cdist/conf/type/__cdist/man.rst b/cdist/conf/type/__cdist/man.rst index f15d3b73..c0e8365e 100644 --- a/cdist/conf/type/__cdist/man.rst +++ b/cdist/conf/type/__cdist/man.rst @@ -1,6 +1,9 @@ cdist-type__cdist(7) ==================== -Manage cdist installations + +NAME +---- +cdist-type__cdist - Manage cdist installations Nico Schottelius diff --git a/cdist/conf/type/__cdistmarker/man.rst b/cdist/conf/type/__cdistmarker/man.rst index 22e711b6..efd696ef 100644 --- a/cdist/conf/type/__cdistmarker/man.rst +++ b/cdist/conf/type/__cdistmarker/man.rst @@ -1,6 +1,9 @@ cdist-type__cdistmarker(7) ========================== -Add a timestamped cdist marker. + +NAME +---- +cdist-type__cdistmarker - Add a timestamped cdist marker. Daniel Maher diff --git a/cdist/conf/type/__config_file/man.rst b/cdist/conf/type/__config_file/man.rst index 49b63984..8eec81b0 100644 --- a/cdist/conf/type/__config_file/man.rst +++ b/cdist/conf/type/__config_file/man.rst @@ -1,6 +1,9 @@ cdist-type__config_file(7) ========================== -Manages config files + +NAME +---- +cdist-type__config_file - _Manages config files Steven Armstrong diff --git a/cdist/conf/type/__consul/man.rst b/cdist/conf/type/__consul/man.rst index 77fae852..e6a9d2d7 100644 --- a/cdist/conf/type/__consul/man.rst +++ b/cdist/conf/type/__consul/man.rst @@ -1,6 +1,9 @@ cdist-type__consul(7) ===================== -Install consul + +NAME +---- +cdist-type__consul - Install consul Steven Armstrong diff --git a/cdist/conf/type/__consul_agent/man.rst b/cdist/conf/type/__consul_agent/man.rst index 8285cb25..25ad4d5b 100644 --- a/cdist/conf/type/__consul_agent/man.rst +++ b/cdist/conf/type/__consul_agent/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_agent(7) =========================== -Manage the consul agent + +NAME +---- +cdist-type__consul_agent - Manage the consul agent Steven Armstrong diff --git a/cdist/conf/type/__consul_check/man.rst b/cdist/conf/type/__consul_check/man.rst index 1de65358..f04645fd 100644 --- a/cdist/conf/type/__consul_check/man.rst +++ b/cdist/conf/type/__consul_check/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_check(7) ============================= -Manages consul checks + +NAME +---- +cdist-type__consul_check - Manages consul checks Steven Armstrong diff --git a/cdist/conf/type/__consul_reload/man.rst b/cdist/conf/type/__consul_reload/man.rst index f66bb545..38618aba 100644 --- a/cdist/conf/type/__consul_reload/man.rst +++ b/cdist/conf/type/__consul_reload/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_reload(7) ============================ -Reload consul + +NAME +---- +cdist-type__consul_reload - Reload consul Steven Armstrong diff --git a/cdist/conf/type/__consul_service/man.rst b/cdist/conf/type/__consul_service/man.rst index 9a8efaab..f7d34f4a 100644 --- a/cdist/conf/type/__consul_service/man.rst +++ b/cdist/conf/type/__consul_service/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_service(7) ============================= -Manages consul services + +NAME +---- +cdist-type__consul_service - Manages consul services Steven Armstrong diff --git a/cdist/conf/type/__consul_template/man.rst b/cdist/conf/type/__consul_template/man.rst index bcdb94e3..8e01ee04 100644 --- a/cdist/conf/type/__consul_template/man.rst +++ b/cdist/conf/type/__consul_template/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_template(7) ============================== -Manage the consul-template service + +NAME +---- +cdist-type__consul_template - Manage the consul-template service Steven Armstrong diff --git a/cdist/conf/type/__consul_template_template/man.rst b/cdist/conf/type/__consul_template_template/man.rst index 20d0a619..30832bc8 100644 --- a/cdist/conf/type/__consul_template_template/man.rst +++ b/cdist/conf/type/__consul_template_template/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_template_template(7) ======================================= -Manage consul-template templates + +NAME +---- +cdist-type__consul_template_template - Manage consul-template templates Steven Armstrong diff --git a/cdist/conf/type/__consul_watch_checks/man.rst b/cdist/conf/type/__consul_watch_checks/man.rst index c1e8c0a7..cfb451d6 100644 --- a/cdist/conf/type/__consul_watch_checks/man.rst +++ b/cdist/conf/type/__consul_watch_checks/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_watch_checks(7) ================================== -Manages consul checks watches + +NAME +---- +cdist-type__consul_watch_checks - Manages consul checks watches Steven Armstrong diff --git a/cdist/conf/type/__consul_watch_event/man.rst b/cdist/conf/type/__consul_watch_event/man.rst index ea9bc61a..871c0704 100644 --- a/cdist/conf/type/__consul_watch_event/man.rst +++ b/cdist/conf/type/__consul_watch_event/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_watch_event(7) ================================= -Manages consul event watches + +NAME +---- +cdist-type__consul_watch_event - Manages consul event watches Steven Armstrong diff --git a/cdist/conf/type/__consul_watch_key/man.rst b/cdist/conf/type/__consul_watch_key/man.rst index 90e952b8..d7554df2 100644 --- a/cdist/conf/type/__consul_watch_key/man.rst +++ b/cdist/conf/type/__consul_watch_key/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_watch_key(7) =============================== -Manages consul key watches + +NAME +---- +cdist-type__consul_watch_key - Manages consul key watches Steven Armstrong diff --git a/cdist/conf/type/__consul_watch_keyprefix/man.rst b/cdist/conf/type/__consul_watch_keyprefix/man.rst index 8ee5822d..42f675a4 100644 --- a/cdist/conf/type/__consul_watch_keyprefix/man.rst +++ b/cdist/conf/type/__consul_watch_keyprefix/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_watch_keyprefix(7) ===================================== -Manages consul keyprefix watches + +NAME +---- +cdist-type__consul_watch_keyprefix - Manages consul keyprefix watches Steven Armstrong diff --git a/cdist/conf/type/__consul_watch_nodes/man.rst b/cdist/conf/type/__consul_watch_nodes/man.rst index b5f0a5ce..c92a8d01 100644 --- a/cdist/conf/type/__consul_watch_nodes/man.rst +++ b/cdist/conf/type/__consul_watch_nodes/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_watch_nodes(7) ================================= -Manages consul nodes watches + +NAME +---- +cdist-type__consul_watch_nodes - Manages consul nodes watches Steven Armstrong diff --git a/cdist/conf/type/__consul_watch_service/man.rst b/cdist/conf/type/__consul_watch_service/man.rst index 1cc2c00d..f37a0dea 100644 --- a/cdist/conf/type/__consul_watch_service/man.rst +++ b/cdist/conf/type/__consul_watch_service/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_watch_service(7) =================================== -Manages consul service watches + +NAME +---- +cdist-type__consul_watch_service - Manages consul service watches Steven Armstrong diff --git a/cdist/conf/type/__consul_watch_services/man.rst b/cdist/conf/type/__consul_watch_services/man.rst index bf766222..3d39da00 100644 --- a/cdist/conf/type/__consul_watch_services/man.rst +++ b/cdist/conf/type/__consul_watch_services/man.rst @@ -1,6 +1,9 @@ cdist-type__consul_watch_services(7) ==================================== -Manages consul services watches + +NAME +---- +cdist-type__consul_watch_services - Manages consul services watches Steven Armstrong diff --git a/cdist/conf/type/__cron/man.rst b/cdist/conf/type/__cron/man.rst index 353f6bae..33f2b185 100644 --- a/cdist/conf/type/__cron/man.rst +++ b/cdist/conf/type/__cron/man.rst @@ -1,6 +1,9 @@ cdist-type__cron(7) =================== -Installs and manages cron jobs + +NAME +---- +cdist-type__cron - Installs and manages cron jobs Steven Armstrong diff --git a/cdist/conf/type/__debconf_set_selections/man.rst b/cdist/conf/type/__debconf_set_selections/man.rst index 37aa65b9..60cdd5f0 100644 --- a/cdist/conf/type/__debconf_set_selections/man.rst +++ b/cdist/conf/type/__debconf_set_selections/man.rst @@ -1,6 +1,9 @@ cdist-type__debconf_set_selections(7) ===================================== -Setup debconf selections + +NAME +---- +cdist-type__debconf_set_selections - Setup debconf selections Nico Schottelius diff --git a/cdist/conf/type/__directory/man.rst b/cdist/conf/type/__directory/man.rst index 279763a1..8ca292ff 100644 --- a/cdist/conf/type/__directory/man.rst +++ b/cdist/conf/type/__directory/man.rst @@ -1,6 +1,9 @@ cdist-type__directory(7) ======================== -Manage a directory + +NAME +---- +cdist-type__directory - Manage a directory Nico Schottelius diff --git a/cdist/conf/type/__dog_vdi/man.rst b/cdist/conf/type/__dog_vdi/man.rst index 3e6155a6..3e0c27c9 100644 --- a/cdist/conf/type/__dog_vdi/man.rst +++ b/cdist/conf/type/__dog_vdi/man.rst @@ -1,6 +1,9 @@ cdist-type__dog_vdi(7) ====================== -Manage Sheepdog VM images + +NAME +---- +cdist-type__dog_vdi - Manage Sheepdog VM images Nico Schottelius diff --git a/cdist/conf/type/__file/man.rst b/cdist/conf/type/__file/man.rst index 73336581..89efebdb 100644 --- a/cdist/conf/type/__file/man.rst +++ b/cdist/conf/type/__file/man.rst @@ -1,6 +1,9 @@ cdist-type__file(7) =================== -Manage files. + +NAME +---- +cdist-type__file - Manage files. Nico Schottelius diff --git a/cdist/conf/type/__firewalld_rule/man.rst b/cdist/conf/type/__firewalld_rule/man.rst index d953b3d2..4533e193 100644 --- a/cdist/conf/type/__firewalld_rule/man.rst +++ b/cdist/conf/type/__firewalld_rule/man.rst @@ -1,6 +1,9 @@ cdist-type__firewalld_rule(7) ============================= -Configure firewalld rules + +NAME +---- +cdist-type__firewalld_rule - Configure firewalld rules Nico Schottelius diff --git a/cdist/conf/type/__git/man.rst b/cdist/conf/type/__git/man.rst index 75f6e48b..3ccc1e91 100644 --- a/cdist/conf/type/__git/man.rst +++ b/cdist/conf/type/__git/man.rst @@ -1,6 +1,9 @@ cdist-type__git(7) ================== -Get and or keep git repositories up-to-date + +NAME +---- +cdist-type__git - Get and or keep git repositories up-to-date Nico Schottelius diff --git a/cdist/conf/type/__group/man.rst b/cdist/conf/type/__group/man.rst index 912dd226..6a7d5a55 100644 --- a/cdist/conf/type/__group/man.rst +++ b/cdist/conf/type/__group/man.rst @@ -1,6 +1,9 @@ cdist-type__group(7) ==================== -Manage groups + +NAME +---- +cdist-type__group - Manage groups Steven Armstrong diff --git a/cdist/conf/type/__hostname/man.rst b/cdist/conf/type/__hostname/man.rst index 32d452f7..bd5d5a21 100644 --- a/cdist/conf/type/__hostname/man.rst +++ b/cdist/conf/type/__hostname/man.rst @@ -1,6 +1,9 @@ cdist-type__hostname(7) ======================= -Set the hostname + +NAME +---- +cdist-type__hostname - Set the hostname Steven Armstrong diff --git a/cdist/conf/type/__iptables_apply/man.rst b/cdist/conf/type/__iptables_apply/man.rst index 40605351..6a94b0af 100644 --- a/cdist/conf/type/__iptables_apply/man.rst +++ b/cdist/conf/type/__iptables_apply/man.rst @@ -1,6 +1,9 @@ cdist-type__iptables_apply(7) ============================= -Apply the rules + +NAME +---- +cdist-type__iptables_apply - Apply the rules Nico Schottelius diff --git a/cdist/conf/type/__iptables_rule/man.rst b/cdist/conf/type/__iptables_rule/man.rst index 5ee02f9c..b6ff6a32 100644 --- a/cdist/conf/type/__iptables_rule/man.rst +++ b/cdist/conf/type/__iptables_rule/man.rst @@ -1,6 +1,9 @@ cdist-type__iptables_rule(7) ============================ -Deploy iptable rulesets + +NAME +---- +cdist-type__iptables_rule - Deploy iptable rulesets Nico Schottelius diff --git a/cdist/conf/type/__issue/man.rst b/cdist/conf/type/__issue/man.rst index 4a6c1f8d..59fa6694 100644 --- a/cdist/conf/type/__issue/man.rst +++ b/cdist/conf/type/__issue/man.rst @@ -1,6 +1,9 @@ cdist-type__issue(7) ==================== -Manage issue + +NAME +---- +cdist-type__issue - Manage issue Nico Schottelius diff --git a/cdist/conf/type/__jail/man.rst b/cdist/conf/type/__jail/man.rst index 826dce21..6bbfbf47 100644 --- a/cdist/conf/type/__jail/man.rst +++ b/cdist/conf/type/__jail/man.rst @@ -1,6 +1,9 @@ cdist-type__jail(7) =================== -Manage FreeBSD jails + +NAME +---- +cdist-type__jail - Manage FreeBSD jails Jake Guffey diff --git a/cdist/conf/type/__jail_freebsd10/man.rst b/cdist/conf/type/__jail_freebsd10/man.rst index 7e167549..1a3515f0 100644 --- a/cdist/conf/type/__jail_freebsd10/man.rst +++ b/cdist/conf/type/__jail_freebsd10/man.rst @@ -1,6 +1,9 @@ cdist-type__jail_freebsd10(7) ============================= -Manage FreeBSD jails + +NAME +---- +cdist-type__jail_freeebsd10 - Manage FreeBSD jails Jake Guffey diff --git a/cdist/conf/type/__jail_freebsd9/man.rst b/cdist/conf/type/__jail_freebsd9/man.rst index 1fe20186..1e442ac0 100644 --- a/cdist/conf/type/__jail_freebsd9/man.rst +++ b/cdist/conf/type/__jail_freebsd9/man.rst @@ -1,6 +1,9 @@ cdist-type__jail_freebsd9(7) ============================ -Manage FreeBSD jails + +NAME +---- +cdist-type__jail_freebsd9 - Manage FreeBSD jails Jake Guffey diff --git a/cdist/conf/type/__key_value/man.rst b/cdist/conf/type/__key_value/man.rst index 4b259c75..467be78b 100644 --- a/cdist/conf/type/__key_value/man.rst +++ b/cdist/conf/type/__key_value/man.rst @@ -1,6 +1,9 @@ cdist-type__key_value(7) ======================== -Change property values in files + +NAME +---- +cdist-type__key_value - Change property values in files Steven Armstrong diff --git a/cdist/conf/type/__line/man.rst b/cdist/conf/type/__line/man.rst index f6d71a5a..81f57039 100644 --- a/cdist/conf/type/__line/man.rst +++ b/cdist/conf/type/__line/man.rst @@ -1,6 +1,9 @@ cdist-type__line(7) =================== -Manage lines in files + +NAME +---- +cdist-type__line - Manage lines in files Nico Schottelius diff --git a/cdist/conf/type/__link/man.rst b/cdist/conf/type/__link/man.rst index 654b097b..750874c1 100644 --- a/cdist/conf/type/__link/man.rst +++ b/cdist/conf/type/__link/man.rst @@ -1,6 +1,9 @@ cdist-type__link(7) =================== -Manage links (hard and symbolic) + +NAME +---- +cdist-type__link - Manage links (hard and symbolic) Nico Schottelius diff --git a/cdist/conf/type/__locale/man.rst b/cdist/conf/type/__locale/man.rst index df337739..2d947da8 100644 --- a/cdist/conf/type/__locale/man.rst +++ b/cdist/conf/type/__locale/man.rst @@ -1,6 +1,9 @@ cdist-type__locale(7) ===================== -Configure locales + +NAME +---- +cdit-type__locale - Configure locales Nico Schottelius diff --git a/cdist/conf/type/__motd/man.rst b/cdist/conf/type/__motd/man.rst index 988e2d02..1de8b258 100644 --- a/cdist/conf/type/__motd/man.rst +++ b/cdist/conf/type/__motd/man.rst @@ -1,6 +1,9 @@ cdist-type__motd(7) =================== -Manage message of the day + +NAME +---- +cdist-type__motd - Manage message of the day Nico Schottelius diff --git a/cdist/conf/type/__mount/man.rst b/cdist/conf/type/__mount/man.rst index 696dfbd4..eab304db 100644 --- a/cdist/conf/type/__mount/man.rst +++ b/cdist/conf/type/__mount/man.rst @@ -1,6 +1,9 @@ cdist-type__mount(7) ==================== -Manage filesystem mounts + +NAME +---- +cdit-type__mount - Manage filesystem mounts Steven Armstrong diff --git a/cdist/conf/type/__mysql_database/man.rst b/cdist/conf/type/__mysql_database/man.rst index 88f1eecd..d8d2626d 100644 --- a/cdist/conf/type/__mysql_database/man.rst +++ b/cdist/conf/type/__mysql_database/man.rst @@ -1,6 +1,9 @@ cdist-type__mysql_database(7) ============================= -Manage a MySQL database + +NAME +---- +cdist-type__mysql_database - Manage a MySQL database Benedikt Koeppel diff --git a/cdist/conf/type/__package/man.rst b/cdist/conf/type/__package/man.rst index 1ada06a7..b412af69 100644 --- a/cdist/conf/type/__package/man.rst +++ b/cdist/conf/type/__package/man.rst @@ -1,6 +1,9 @@ cdist-type__package(7) ====================== -Manage packages + +NAME +---- +cdist-type__package - Manage packages Steven Armstrong diff --git a/cdist/conf/type/__package_apt/man.rst b/cdist/conf/type/__package_apt/man.rst index ec28c0cc..65ebf6fa 100644 --- a/cdist/conf/type/__package_apt/man.rst +++ b/cdist/conf/type/__package_apt/man.rst @@ -1,6 +1,9 @@ cdist-type__package_apt(7) ========================== -Manage packages with apt-get + +NAME +---- +cdist-type__package_apt - Manage packages with apt-get Nico Schottelius diff --git a/cdist/conf/type/__package_emerge/man.rst b/cdist/conf/type/__package_emerge/man.rst index fe06031e..c9ac59b9 100644 --- a/cdist/conf/type/__package_emerge/man.rst +++ b/cdist/conf/type/__package_emerge/man.rst @@ -1,6 +1,9 @@ cdist-type__package_emerge(7) ============================= -Manage packages with portage + +NAME +---- +cdist-type__package_emerge - Manage packages with portage Thomas Oettli diff --git a/cdist/conf/type/__package_emerge_dependencies/man.rst b/cdist/conf/type/__package_emerge_dependencies/man.rst index 21af86e3..1c4d291b 100644 --- a/cdist/conf/type/__package_emerge_dependencies/man.rst +++ b/cdist/conf/type/__package_emerge_dependencies/man.rst @@ -1,6 +1,9 @@ cdist-type__package_emerge_dependencies(7) ========================================== -Install dependencies for __package_emerge + +NAME +---- +cdist-type__package_emerge_dependencies - Install dependencies for __package_emerge Thomas Oettli diff --git a/cdist/conf/type/__package_luarocks/man.rst b/cdist/conf/type/__package_luarocks/man.rst index ff7fea83..e097b4d6 100644 --- a/cdist/conf/type/__package_luarocks/man.rst +++ b/cdist/conf/type/__package_luarocks/man.rst @@ -1,6 +1,9 @@ cdist-type__package_luarocks(7) =============================== -Manage luarocks packages + +NAME +---- +cdist-type__package_luarocks - Manage luarocks packages Christian G. Warden diff --git a/cdist/conf/type/__package_opkg/man.rst b/cdist/conf/type/__package_opkg/man.rst index 9af17988..0104bbf2 100644 --- a/cdist/conf/type/__package_opkg/man.rst +++ b/cdist/conf/type/__package_opkg/man.rst @@ -1,6 +1,9 @@ cdist-type__package_opkg(7) =========================== -Manage packages with opkg + +NAME +---- +cdist-type__package_opkg - Manage packages with opkg Giel van Schijndel diff --git a/cdist/conf/type/__package_pacman/man.rst b/cdist/conf/type/__package_pacman/man.rst index 3d8845a5..6f3fc5b3 100644 --- a/cdist/conf/type/__package_pacman/man.rst +++ b/cdist/conf/type/__package_pacman/man.rst @@ -1,6 +1,9 @@ cdist-type__package_pacman(7) ============================= -Manage packages with pacman + +NAME +---- +cdist-type__package_pacman - Manage packages with pacman Nico Schottelius diff --git a/cdist/conf/type/__package_pip/man.rst b/cdist/conf/type/__package_pip/man.rst index b312fff5..0630274a 100644 --- a/cdist/conf/type/__package_pip/man.rst +++ b/cdist/conf/type/__package_pip/man.rst @@ -1,6 +1,9 @@ cdist-type__package_pip(7) ========================== -Manage packages with pip + +NAME +---- +cdist-type__package_pip - Manage packages with pip Nico Schottelius diff --git a/cdist/conf/type/__package_pkg_freebsd/man.rst b/cdist/conf/type/__package_pkg_freebsd/man.rst index c728cc9a..9246d09c 100644 --- a/cdist/conf/type/__package_pkg_freebsd/man.rst +++ b/cdist/conf/type/__package_pkg_freebsd/man.rst @@ -1,6 +1,9 @@ cdist-type__package_pkg_freebsd(7) ================================== -Manage FreeBSD packages + +NAME +---- +cdist-type__package_pkg_freebsd - Manage FreeBSD packages Jake Guffey diff --git a/cdist/conf/type/__package_pkg_openbsd/man.rst b/cdist/conf/type/__package_pkg_openbsd/man.rst index f9a746b9..f584864b 100644 --- a/cdist/conf/type/__package_pkg_openbsd/man.rst +++ b/cdist/conf/type/__package_pkg_openbsd/man.rst @@ -1,6 +1,9 @@ cdist-type__package_pkg(7) ========================== -Manage OpenBSD packages + +NAME +---- +cdist-type__package_pkg - Manage OpenBSD packages Andi Brönnimann diff --git a/cdist/conf/type/__package_pkgng_freebsd/man.rst b/cdist/conf/type/__package_pkgng_freebsd/man.rst index 36f1a7d8..b81ef75c 100644 --- a/cdist/conf/type/__package_pkgng_freebsd/man.rst +++ b/cdist/conf/type/__package_pkgng_freebsd/man.rst @@ -1,6 +1,9 @@ cdist-type__package_pkgng_freebsd(7) ==================================== -Manage FreeBSD packages with pkg-ng + +NAME +---- +cdist-type__package_pkgng_freebsd - Manage FreeBSD packages with pkg-ng Jake Guffey diff --git a/cdist/conf/type/__package_rubygem/man.rst b/cdist/conf/type/__package_rubygem/man.rst index 4cb9af04..d74149b0 100644 --- a/cdist/conf/type/__package_rubygem/man.rst +++ b/cdist/conf/type/__package_rubygem/man.rst @@ -1,6 +1,9 @@ cdist-type__package_rubygem(7) ============================== -Manage rubygem packages + +NAME +---- +cdist-type__package_rubygem - Manage rubygem packages Chase Allen James diff --git a/cdist/conf/type/__package_update_index/man.rst b/cdist/conf/type/__package_update_index/man.rst index a16d29ce..ae05b3c5 100644 --- a/cdist/conf/type/__package_update_index/man.rst +++ b/cdist/conf/type/__package_update_index/man.rst @@ -1,6 +1,9 @@ cdist-type__package_update_index(7) =================================== -Update the package index + +NAME +---- +cdist-type__update_index - Update the package index Ricardo Catalinas Jiménez diff --git a/cdist/conf/type/__package_upgrade_all/man.rst b/cdist/conf/type/__package_upgrade_all/man.rst index 146a8259..af6a2373 100644 --- a/cdist/conf/type/__package_upgrade_all/man.rst +++ b/cdist/conf/type/__package_upgrade_all/man.rst @@ -1,6 +1,9 @@ cdist-type__package_upgrade_all(7) ================================== -Upgrade all the installed packages + +NAME +---- +cdist-type__package_upgrade_all - Upgrade all the installed packages Ricardo Catalinas Jiménez diff --git a/cdist/conf/type/__package_yum/man.rst b/cdist/conf/type/__package_yum/man.rst index 65e56c7a..440d0723 100644 --- a/cdist/conf/type/__package_yum/man.rst +++ b/cdist/conf/type/__package_yum/man.rst @@ -1,6 +1,9 @@ cdist-type__package_yum(7) ========================== -Manage packages with yum + +NAME +---- +cdist-type__package_yum - Manage packages with yum Nico Schottelius diff --git a/cdist/conf/type/__package_zypper/man.rst b/cdist/conf/type/__package_zypper/man.rst index 2df22e72..74648c9e 100644 --- a/cdist/conf/type/__package_zypper/man.rst +++ b/cdist/conf/type/__package_zypper/man.rst @@ -1,6 +1,9 @@ cdist-type__package_zypper(7) ============================= -Manage packages with zypper + +NAME +---- +cdist-type__package_zypper - Manage packages with zypper Daniel Heule diff --git a/cdist/conf/type/__pacman_conf/man.rst b/cdist/conf/type/__pacman_conf/man.rst index 930035fa..0a8eb62a 100644 --- a/cdist/conf/type/__pacman_conf/man.rst +++ b/cdist/conf/type/__pacman_conf/man.rst @@ -1,6 +1,9 @@ cdist-type__pacman_conf(7) ========================== -Manage pacman configuration + +NAME +---- +cdist-type__pacman_conf - Manage pacman configuration Dominique Roux diff --git a/cdist/conf/type/__pacman_conf_integrate/man.rst b/cdist/conf/type/__pacman_conf_integrate/man.rst index 6a856efe..30ef6cd9 100644 --- a/cdist/conf/type/__pacman_conf_integrate/man.rst +++ b/cdist/conf/type/__pacman_conf_integrate/man.rst @@ -1,6 +1,9 @@ cdist-type__pacman_conf_integrate(7) ==================================== -Integrate default pacman.conf to cdist conform and vice versa + +NAME +---- +cdist-type__pacman_conf_integrate - Integrate default pacman.conf to cdist conform and vice versa Dominique Roux diff --git a/cdist/conf/type/__pf_apply/man.rst b/cdist/conf/type/__pf_apply/man.rst index 0b440e2d..acebcb96 100644 --- a/cdist/conf/type/__pf_apply/man.rst +++ b/cdist/conf/type/__pf_apply/man.rst @@ -1,12 +1,11 @@ cdist-type__pf_apply(7) ======================= -Apply pf(4) ruleset on \*BSD - -Jake Guffey - NAME ---- +cdist-type__pf_apply - Apply pf(4) ruleset on \*BSD + +Jake Guffey DESCRIPTION diff --git a/cdist/conf/type/__pf_ruleset/man.rst b/cdist/conf/type/__pf_ruleset/man.rst index b3e9b073..7edc0f91 100644 --- a/cdist/conf/type/__pf_ruleset/man.rst +++ b/cdist/conf/type/__pf_ruleset/man.rst @@ -1,6 +1,9 @@ cdist-type__pf_ruleset(7) ========================= -Copy a pf(4) ruleset to $__target_host + +NAME +---- +cdist-type__pf_ruleset - Copy a pf(4) ruleset to $__target_host Jake Guffey diff --git a/cdist/conf/type/__postfix/man.rst b/cdist/conf/type/__postfix/man.rst index d10a9960..73347e38 100644 --- a/cdist/conf/type/__postfix/man.rst +++ b/cdist/conf/type/__postfix/man.rst @@ -1,6 +1,9 @@ cdist-type__postfix(7) ====================== -Install postfix + +NAME +---- +cdist-type__postfix - Install postfix Steven Armstrong diff --git a/cdist/conf/type/__postfix_master/man.rst b/cdist/conf/type/__postfix_master/man.rst index 4853e687..86fa5f8c 100644 --- a/cdist/conf/type/__postfix_master/man.rst +++ b/cdist/conf/type/__postfix_master/man.rst @@ -1,6 +1,9 @@ cdist-type__postfix_master(7) ============================= -Configure postfix master.cf + +NAME +---- +cdist-type__postfix_master - Configure postfix master.cf Steven Armstrong diff --git a/cdist/conf/type/__postfix_postconf/man.rst b/cdist/conf/type/__postfix_postconf/man.rst index e07e136f..ab0192b8 100644 --- a/cdist/conf/type/__postfix_postconf/man.rst +++ b/cdist/conf/type/__postfix_postconf/man.rst @@ -1,6 +1,9 @@ cdist-type__postfix_postconf(7) =============================== -Configure postfix main.cf + +NAME +---- +cdist-type__postfix_postconf - Configure postfix main.cf Steven Armstrong diff --git a/cdist/conf/type/__postfix_postmap/man.rst b/cdist/conf/type/__postfix_postmap/man.rst index ecee6722..5e9d3c2d 100644 --- a/cdist/conf/type/__postfix_postmap/man.rst +++ b/cdist/conf/type/__postfix_postmap/man.rst @@ -1,6 +1,9 @@ cdist-type__postfix_postmap(7) ============================== -Run postmap on the given file + +NAME +---- +cdist-type__postfix_postmap - Run postmap on the given file Steven Armstrong diff --git a/cdist/conf/type/__postfix_reload/man.rst b/cdist/conf/type/__postfix_reload/man.rst index c5101953..330ed51c 100644 --- a/cdist/conf/type/__postfix_reload/man.rst +++ b/cdist/conf/type/__postfix_reload/man.rst @@ -1,6 +1,9 @@ cdist-type__postfix_reload(7) ============================= -Tell postfix to reload its configuration + +NAME +---- +cdist-type__postfix_reload - Tell postfix to reload its configuration Steven Armstrong diff --git a/cdist/conf/type/__postgres_database/man.rst b/cdist/conf/type/__postgres_database/man.rst index 152ee910..34cd2f03 100644 --- a/cdist/conf/type/__postgres_database/man.rst +++ b/cdist/conf/type/__postgres_database/man.rst @@ -1,6 +1,9 @@ cdist-type__postgres_database(7) ================================ -Create/drop postgres databases + +NAME +---- +cdist-type__postgres_database - Create/drop postgres databases Steven Armstrong diff --git a/cdist/conf/type/__postgres_role/man.rst b/cdist/conf/type/__postgres_role/man.rst index 6384568f..4b8d291f 100644 --- a/cdist/conf/type/__postgres_role/man.rst +++ b/cdist/conf/type/__postgres_role/man.rst @@ -1,6 +1,9 @@ cdist-type__postgres_role(7) ============================ -Manage postgres roles + +NAME +---- +cdist-type__postgres_role - Manage postgres roles Steven Armstrong diff --git a/cdist/conf/type/__process/man.rst b/cdist/conf/type/__process/man.rst index 09032a1a..3f17076d 100644 --- a/cdist/conf/type/__process/man.rst +++ b/cdist/conf/type/__process/man.rst @@ -1,6 +1,9 @@ cdist-type__process(7) ====================== -Start or stop process + +NAME +---- +cdist-type__process - Start or stop process Nico Schottelius diff --git a/cdist/conf/type/__pyvenv/man.rst b/cdist/conf/type/__pyvenv/man.rst index bdc1166c..ff7a922b 100755 --- a/cdist/conf/type/__pyvenv/man.rst +++ b/cdist/conf/type/__pyvenv/man.rst @@ -1,6 +1,9 @@ cdist-type__pyvenv(7) ===================== -Create or remove python virtual environment + +NAME +---- +cdist-type__pyvenv - Create or remove python virtual environment Darko Poljak diff --git a/cdist/conf/type/__qemu_img/man.rst b/cdist/conf/type/__qemu_img/man.rst index 598e06ab..4492c260 100644 --- a/cdist/conf/type/__qemu_img/man.rst +++ b/cdist/conf/type/__qemu_img/man.rst @@ -1,6 +1,9 @@ cdist-type__qemu_img(7) ======================= -Manage VM disk images + +NAME +---- +cdist-type__qemu_img - Manage VM disk images Nico Schottelius diff --git a/cdist/conf/type/__rbenv/man.rst b/cdist/conf/type/__rbenv/man.rst index 314507fe..d13f407c 100644 --- a/cdist/conf/type/__rbenv/man.rst +++ b/cdist/conf/type/__rbenv/man.rst @@ -1,6 +1,9 @@ cdist-type__rbenv(7) ==================== -Manage rbenv installation + +NAME +---- +cdist-type__rbenv - Manage rbenv installation Nico Schottelius diff --git a/cdist/conf/type/__rsync/man.rst b/cdist/conf/type/__rsync/man.rst index bc7b1bca..afca11d5 100644 --- a/cdist/conf/type/__rsync/man.rst +++ b/cdist/conf/type/__rsync/man.rst @@ -1,6 +1,9 @@ cdist-type__rsync(7) ==================== -Mirror directories using rsync + +NAME +---- +cdist-type__rsync - Mirror directories using rsync Nico Schottelius diff --git a/cdist/conf/type/__rvm/man.rst b/cdist/conf/type/__rvm/man.rst index 8a3f72f5..5aa264e0 100644 --- a/cdist/conf/type/__rvm/man.rst +++ b/cdist/conf/type/__rvm/man.rst @@ -1,6 +1,9 @@ cdist-type__rvm(7) ================== -Install rvm for a given user + +NAME +---- +cdist-type__rvm - Install rvm for a given user Evax Software diff --git a/cdist/conf/type/__rvm_gem/man.rst b/cdist/conf/type/__rvm_gem/man.rst index 39d93065..c6011f45 100644 --- a/cdist/conf/type/__rvm_gem/man.rst +++ b/cdist/conf/type/__rvm_gem/man.rst @@ -1,6 +1,9 @@ cdist-type__rvm_gemset(7) ========================== -Manage Ruby gems through rvm + +NAME +---- +cdist-type__rvm_gemset - Manage Ruby gems through rvm Evax Software diff --git a/cdist/conf/type/__rvm_gemset/man.rst b/cdist/conf/type/__rvm_gemset/man.rst index 422130cb..6792b14e 100644 --- a/cdist/conf/type/__rvm_gemset/man.rst +++ b/cdist/conf/type/__rvm_gemset/man.rst @@ -1,6 +1,9 @@ cdist-type__rvm_gemset(7) ========================== -Manage gemsets through rvm + +NAME +---- +cdist-type__rvm_gemset - Manage gemsets through rvm Evax Software diff --git a/cdist/conf/type/__rvm_ruby/man.rst b/cdist/conf/type/__rvm_ruby/man.rst index dbb1c9a2..235731cd 100644 --- a/cdist/conf/type/__rvm_ruby/man.rst +++ b/cdist/conf/type/__rvm_ruby/man.rst @@ -1,6 +1,9 @@ cdist-type__rvm_ruby(7) ======================= -Manage ruby installations through rvm + +NAME +---- +cdist-type__rvm_ruby - Manage ruby installations through rvm Evax Software diff --git a/cdist/conf/type/__ssh_authorized_key/man.rst b/cdist/conf/type/__ssh_authorized_key/man.rst index 984ea51b..767fb1d2 100644 --- a/cdist/conf/type/__ssh_authorized_key/man.rst +++ b/cdist/conf/type/__ssh_authorized_key/man.rst @@ -1,6 +1,9 @@ cdist-type__ssh_authorized_key(7) ================================= -Manage a single ssh authorized key entry + +NAME +---- +cdist-type__ssh_authorized_key - Manage a single ssh authorized key entry Steven Armstrong diff --git a/cdist/conf/type/__ssh_authorized_keys/man.rst b/cdist/conf/type/__ssh_authorized_keys/man.rst index 0907c2b3..54e294b3 100644 --- a/cdist/conf/type/__ssh_authorized_keys/man.rst +++ b/cdist/conf/type/__ssh_authorized_keys/man.rst @@ -1,6 +1,9 @@ cdist-type__ssh_authorized_keys(7) ================================== -Manage ssh authorized_keys files + +NAME +---- +cdist-type__ssh_authorized_keys - Manage ssh authorized_keys files Steven Armstrong diff --git a/cdist/conf/type/__ssh_dot_ssh/man.rst b/cdist/conf/type/__ssh_dot_ssh/man.rst index 1b84c924..12b4c2e7 100644 --- a/cdist/conf/type/__ssh_dot_ssh/man.rst +++ b/cdist/conf/type/__ssh_dot_ssh/man.rst @@ -1,12 +1,11 @@ cdist-type__ssh_dot_ssh(7) ========================== -Manage .ssh directory - -Nico Schottelius - NAME ---- +cdist-type__ssh_dot_ssh - Manage .ssh directory + +Nico Schottelius DESCRIPTION diff --git a/cdist/conf/type/__staged_file/man.rst b/cdist/conf/type/__staged_file/man.rst index ed977b28..aec11707 100644 --- a/cdist/conf/type/__staged_file/man.rst +++ b/cdist/conf/type/__staged_file/man.rst @@ -1,6 +1,9 @@ cdist-type__staged_file(7) ========================== -Manage staged files + +NAME +---- +cdist-type__staged_file - Manage staged files Steven Armstrong diff --git a/cdist/conf/type/__start_on_boot/man.rst b/cdist/conf/type/__start_on_boot/man.rst index 2fb2c7d9..2f07362b 100644 --- a/cdist/conf/type/__start_on_boot/man.rst +++ b/cdist/conf/type/__start_on_boot/man.rst @@ -1,6 +1,9 @@ cdist-type__start_on_boot(7) ============================ -Manage stuff to be started at boot + +NAME +---- +cdist-type__start_on_boot - Manage stuff to be started at boot Nico Schottelius diff --git a/cdist/conf/type/__timezone/man.rst b/cdist/conf/type/__timezone/man.rst index 083f4fe6..838f4c46 100644 --- a/cdist/conf/type/__timezone/man.rst +++ b/cdist/conf/type/__timezone/man.rst @@ -1,6 +1,9 @@ cdist-type__timezone(7) ======================= -Allows one to configure the desired localtime timezone. + +NAME +---- +cdist-type__timezone - Allows one to configure the desired localtime timezone. Ramon Salvadó diff --git a/cdist/conf/type/__update_alternatives/man.rst b/cdist/conf/type/__update_alternatives/man.rst index 477ee88c..f321b02f 100644 --- a/cdist/conf/type/__update_alternatives/man.rst +++ b/cdist/conf/type/__update_alternatives/man.rst @@ -1,6 +1,9 @@ cdist-type__update_alternatives(7) ================================== -Configure alternatives + +NAME +---- +cdist-type__update_alternatives - Configure alternatives Nico Schottelius diff --git a/cdist/conf/type/__user/man.rst b/cdist/conf/type/__user/man.rst index c690a559..6a055a4e 100644 --- a/cdist/conf/type/__user/man.rst +++ b/cdist/conf/type/__user/man.rst @@ -1,6 +1,9 @@ cdist-type__user(7) =================== -Manage users + +NAME +---- +cdist-type__user - Manage users Steven Armstrong diff --git a/cdist/conf/type/__user_groups/man.rst b/cdist/conf/type/__user_groups/man.rst index 4458a6cf..8857feb1 100644 --- a/cdist/conf/type/__user_groups/man.rst +++ b/cdist/conf/type/__user_groups/man.rst @@ -1,6 +1,9 @@ cdist-type__user_groups(7) ========================== -Manage user groups + +NAME +---- +cdist-type__user_groups - Manage user groups Steven Armstrong diff --git a/cdist/conf/type/__yum_repo/man.rst b/cdist/conf/type/__yum_repo/man.rst index 396f271c..3df9f1b9 100644 --- a/cdist/conf/type/__yum_repo/man.rst +++ b/cdist/conf/type/__yum_repo/man.rst @@ -1,6 +1,9 @@ cdist-type__yum_repo(7) ======================= -Manage yum repositories + +NAME +---- +cdist-type__yum_repo - Manage yum repositories Steven Armstrong diff --git a/cdist/conf/type/__zypper_repo/man.rst b/cdist/conf/type/__zypper_repo/man.rst index e3bc1d4f..d1b87a5b 100644 --- a/cdist/conf/type/__zypper_repo/man.rst +++ b/cdist/conf/type/__zypper_repo/man.rst @@ -1,6 +1,9 @@ cdist-type__zypper_repo(7) ========================== -Repository management with zypper + +NAME +---- +cdist-type__zypper_repo - Repository management with zypper Daniel Heule diff --git a/cdist/conf/type/__zypper_service/man.rst b/cdist/conf/type/__zypper_service/man.rst index 377d30e1..9d538208 100644 --- a/cdist/conf/type/__zypper_service/man.rst +++ b/cdist/conf/type/__zypper_service/man.rst @@ -1,6 +1,9 @@ cdist-type__zypper_service(7) ============================= -Service management with zypper + +NAME +---- +cdist-type__zypper_service - Service management with zypper Daniel Heule diff --git a/cdist/sphinxext/__init__.py b/cdist/sphinxext/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cdist/sphinxext/manpage.py b/cdist/sphinxext/manpage.py new file mode 100644 index 00000000..433f6a1b --- /dev/null +++ b/cdist/sphinxext/manpage.py @@ -0,0 +1,80 @@ +import sphinx.builders.manpage +import sphinx.writers.manpage +from docutils.frontend import OptionParser +from sphinx.util.console import bold, darkgreen +from six import string_types +from docutils.io import FileOutput +from os import path +from sphinx.util.nodes import inline_all_toctrees +from sphinx import addnodes + +""" + Extension based on sphinx builtin manpage. + It does not write its own .SH NAME based on config, + but leaves everything to actual reStructuredText file content. +""" + +class ManualPageTranslator(sphinx.writers.manpage.ManualPageTranslator): + + def header(self): + tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\"" + " \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n") + return tmpl % self._docinfo + + +class ManualPageWriter(sphinx.writers.manpage.ManualPageWriter): + + def __init__(self, builder): + super().__init__(builder) + self.translator_class = ( + self.builder.translator_class or ManualPageTranslator) + + +class ManualPageBuilder(sphinx.builders.manpage.ManualPageBuilder): + + name = 'cman' + + def write(self, *ignored): + docwriter = ManualPageWriter(self) + docsettings = OptionParser( + defaults=self.env.settings, + components=(docwriter,), + read_config_files=True).get_default_values() + + self.info(bold('writing... '), nonl=True) + + for info in self.config.man_pages: + docname, name, description, authors, section = info + if isinstance(authors, string_types): + if authors: + authors = [authors] + else: + authors = [] + + targetname = '%s.%s' % (name, section) + self.info(darkgreen(targetname) + ' { ', nonl=True) + destination = FileOutput( + destination_path=path.join(self.outdir, targetname), + encoding='utf-8') + + tree = self.env.get_doctree(docname) + docnames = set() + largetree = inline_all_toctrees(self, docnames, docname, tree, + darkgreen, [docname]) + self.info('} ', nonl=True) + self.env.resolve_references(largetree, docname, self) + # remove pending_xref nodes + for pendingnode in largetree.traverse(addnodes.pending_xref): + pendingnode.replace_self(pendingnode.children) + + largetree.settings = docsettings + largetree.settings.title = name + largetree.settings.subtitle = description + largetree.settings.authors = authors + largetree.settings.section = section + + docwriter.write(largetree, destination) + self.info() + +def setup(app): + app.add_builder(ManualPageBuilder) diff --git a/docs/man/Makefile b/docs/man/Makefile index c2e398c5..6d3ec6dc 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -161,7 +161,7 @@ text: .PHONY: man man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + $(SPHINXBUILD) -b cman $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." diff --git a/docs/man/cdist-reference.rst.sh b/docs/man/cdist-reference.rst.sh index 0dd7c634..687394d2 100755 --- a/docs/man/cdist-reference.rst.sh +++ b/docs/man/cdist-reference.rst.sh @@ -37,7 +37,10 @@ exec > "$dest" cat << eof cdist-reference(7) ================== -Variable, path and type reference for cdist + +NAME +---- +cdist-reference - Variable, path and type reference for cdist Nico Schottelius diff --git a/docs/man/conf.py b/docs/man/conf.py index 7df4ed25..d8843011 100644 --- a/docs/man/conf.py +++ b/docs/man/conf.py @@ -29,7 +29,9 @@ import os # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = [ + 'cdist.sphinxext.manpage', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -257,15 +259,18 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -mandir = os.path.dirname(os.path.realpath(__file__)) -man_pages = [] +root_mandir = os.path.dirname(os.path.realpath(__file__)) +mandirs = [] for mansubdir in ('man1', 'man7'): - for root, dirs, files in os.walk(os.path.join(mandir, mansubdir)): + 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(mansubdir, froot), froot, '', - [], mansubdir[-1]) + man_page = (os.path.join('man' + str(section), froot), + froot, '', [], section) man_pages.append(man_page) #man_pages = [ diff --git a/docs/man/man1/cdist.rst b/docs/man/man1/cdist.rst index 21edee11..f2b4c5d4 100644 --- a/docs/man/man1/cdist.rst +++ b/docs/man/man1/cdist.rst @@ -1,6 +1,9 @@ cdist(1) ======== -Usable Configuration Management + +NAME +---- +cdist - Usable Configuration Management Nico Schottelius diff --git a/docs/man/man7/cdist-best-practice.rst b/docs/man/man7/cdist-best-practice.rst index 13d65cce..7c19c038 100644 --- a/docs/man/man7/cdist-best-practice.rst +++ b/docs/man/man7/cdist-best-practice.rst @@ -1,6 +1,9 @@ cdist-best-practice(7) ====================== -Practices used in real environments + +NAME +---- +cdist-best-practice - Practices used in real environments Nico Schottelius diff --git a/docs/man/man7/cdist-bootstrap.rst b/docs/man/man7/cdist-bootstrap.rst index df55e2af..6a070afa 100644 --- a/docs/man/man7/cdist-bootstrap.rst +++ b/docs/man/man7/cdist-bootstrap.rst @@ -1,6 +1,9 @@ cdist-bootstrap(7) ================== -Setup cdist environment + +NAME +---- +cdist-bootstrap - Setup cdist environment Nico Schottelius diff --git a/docs/man/man7/cdist-explorer.rst b/docs/man/man7/cdist-explorer.rst index 1bbd7e75..66c20d67 100644 --- a/docs/man/man7/cdist-explorer.rst +++ b/docs/man/man7/cdist-explorer.rst @@ -1,6 +1,9 @@ cdist-explorer(7) ================= -Explore the target systems + +NAME +---- +cdist-explorer - Explore the target systems Nico Schottelius diff --git a/docs/man/man7/cdist-hacker.rst b/docs/man/man7/cdist-hacker.rst index 1d0e7f2e..4e3a21b6 100644 --- a/docs/man/man7/cdist-hacker.rst +++ b/docs/man/man7/cdist-hacker.rst @@ -1,6 +1,9 @@ cdist-hacker(7) =============== -How to get (stuff) into cdist + +NAME +---- +cdist-hacker - How to get (stuff) into cdist Nico Schottelius diff --git a/docs/man/man7/cdist-manifest.rst b/docs/man/man7/cdist-manifest.rst index c8984acf..04609b73 100644 --- a/docs/man/man7/cdist-manifest.rst +++ b/docs/man/man7/cdist-manifest.rst @@ -1,6 +1,9 @@ cdist-manifest(7) ================= -(Re-)Use types + +NAME +---- +cdist-manifest - (Re-)Use types Nico Schottelius diff --git a/docs/man/man7/cdist-messaging.rst b/docs/man/man7/cdist-messaging.rst index 6f29a363..b0d5e3b4 100644 --- a/docs/man/man7/cdist-messaging.rst +++ b/docs/man/man7/cdist-messaging.rst @@ -1,6 +1,9 @@ cdist-messaging(7) ================== -How the initial manifest and types can communication + +NAME +---- +cdist-messaging - How the initial manifest and types can communication Nico Schottelius diff --git a/docs/man/man7/cdist-quickstart.rst b/docs/man/man7/cdist-quickstart.rst index d1186ffe..fd7d2cde 100644 --- a/docs/man/man7/cdist-quickstart.rst +++ b/docs/man/man7/cdist-quickstart.rst @@ -1,6 +1,9 @@ cdist-quickstart(7) =================== -Jump in and enjoy cdist + +NAME +---- +cdist-quickstart - Jump in and enjoy cdist Nico Schottelius diff --git a/docs/man/man7/cdist-remote-exec-copy.rst b/docs/man/man7/cdist-remote-exec-copy.rst index 27b78d42..b8d54f8f 100644 --- a/docs/man/man7/cdist-remote-exec-copy.rst +++ b/docs/man/man7/cdist-remote-exec-copy.rst @@ -1,6 +1,9 @@ cdist-remote-exec-copy(7) ========================= -How to use remote exec and copy + +NAME +---- +cdist-remote-exec-copy - How to use remote exec and copy Nico Schottelius diff --git a/docs/man/man7/cdist-stages.rst b/docs/man/man7/cdist-stages.rst index 4b29585d..b58bb368 100644 --- a/docs/man/man7/cdist-stages.rst +++ b/docs/man/man7/cdist-stages.rst @@ -1,6 +1,9 @@ cdist-stages(7) =============== -Stages used during configuration deployment + +NAME +---- +cdist-stages - Stages used during configuration deployment Nico Schottelius diff --git a/docs/man/man7/cdist-troubleshooting.rst b/docs/man/man7/cdist-troubleshooting.rst index 075c3480..edfadc34 100644 --- a/docs/man/man7/cdist-troubleshooting.rst +++ b/docs/man/man7/cdist-troubleshooting.rst @@ -1,6 +1,9 @@ cdist-troubleshooting(7) ======================== -Common problems and their solutions + +NAME +---- +cdist-troubleshooting - Common problems and their solutions Nico Schottelius diff --git a/docs/man/man7/cdist-tutorial.rst b/docs/man/man7/cdist-tutorial.rst index 4899dcb0..fece6f36 100644 --- a/docs/man/man7/cdist-tutorial.rst +++ b/docs/man/man7/cdist-tutorial.rst @@ -1,6 +1,9 @@ cdist-tutorial(7) ================= -A guided introduction into cdist + +NAME +---- +cdist-tutorial - A guided introduction into cdist Nico Schottelius diff --git a/docs/man/man7/cdist-type.rst b/docs/man/man7/cdist-type.rst index cfd331e1..5500d9b3 100644 --- a/docs/man/man7/cdist-type.rst +++ b/docs/man/man7/cdist-type.rst @@ -1,6 +1,9 @@ cdist-type(7) ============= -Functionality bundled + +NAME +---- +cdist-type - Functionality bundled Nico Schottelius From f6ea90c3a50f757871504675084c8da70ca76097 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 24 Jun 2016 11:18:24 +0200 Subject: [PATCH 24/42] Update remote.py according to new exec_util api. --- cdist/exec/remote.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py index c78f02cb..0331f402 100644 --- a/cdist/exec/remote.py +++ b/cdist/exec/remote.py @@ -168,14 +168,13 @@ class Remote(object): self.log.debug("Remote run: %s", command) try: - output = exec_util.call_get_output(command, env=os_environ) - self.log.debug("Remote output: {}".format(output)) + output, errout = exec_util.call_get_output(command, env=os_environ) + self.log.debug("Remote stdout: {}".format(output)) + self.log.debug("Remote stderr: {}".format(errout)) if return_output: return output.decode() except subprocess.CalledProcessError as e: - raise cdist.Error("Command failed: " + " ".join(command) - + " with returncode: {} and output: {}".format( - e.returncode, e.output)) + exec_util.handle_called_process_error(e, command) except OSError as error: raise cdist.Error(" ".join(command) + ": " + error.args[1]) except UnicodeDecodeError: From 7a9a04592bce29196e8d4df8ba05fea191fad4b8 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sat, 25 Jun 2016 19:30:22 +0200 Subject: [PATCH 25/42] Fix Makefile for dotman target. --- Makefile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d00739bb..faa8e9d5 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,8 @@ MAN7DSTDIR=$(MANDIR)/man7 # Manpages #1: Types # Use shell / ls to get complete list - $(TYPEDIR)/*/man.rst does not work -MANTYPESRC=$(shell ls $(TYPEDIR)/*/man.rst) +# 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)) @@ -92,13 +93,9 @@ man-latest-link: web-pub DOT_CDIST_PATH=${HOME}/.cdist DOTMAN7DSTDIR=$(MAN7DSTDIR) DOTTYPEDIR=$(DOT_CDIST_PATH)/type -$(info $(DOTTYPEDIR)) -DOTMANTYPESRC=$(shell ls $(DOTTYPEDIR)/*/man.rst) -$(info $(DOTMANTYPESRC)) +DOTMANTYPESRC=$(wildcard $(DOTTYPEDIR)/*/man.rst) DOTMANTYPEPREFIX=$(subst $(DOTTYPEDIR)/,$(DOTMAN7DSTDIR)/cdist-type,$(DOTMANTYPESRC)) -$(info $(DOTMANTYPEPREFIX)) DOTMANTYPES=$(subst /man.rst,.rst,$(DOTMANTYPEPREFIX)) -$(info $(DOTMANTYPES)) # Link manpage: do not create man.html but correct named file $(DOTMAN7DSTDIR)/cdist-type%.rst: $(DOTTYPEDIR)/%/man.rst From a220d4805a57027a728ad6c8d126d39ec9abc65d Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Sun, 26 Jun 2016 16:28:10 +0200 Subject: [PATCH 26/42] Add cdist dir to sys.path for sphinx ext and cdist modules. --- docs/man/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/man/conf.py b/docs/man/conf.py index d8843011..ed43d6d4 100644 --- a/docs/man/conf.py +++ b/docs/man/conf.py @@ -20,6 +20,7 @@ import os # 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__)), "../../"))) # -- General configuration ------------------------------------------------ From 51c94e9e8252443d9b9787fcafe51c07da1737e5 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 17 Jun 2016 21:28:16 +0200 Subject: [PATCH 27/42] Restructure and fix and improve docs and manpages. --- .gitignore | 2 +- Makefile | 4 +- bin/build-helper.freebsd | 336 ++++++++++++++++++ cdist/conf/type/__apt_key/man.rst | 10 +- cdist/conf/type/__apt_key_uri/man.rst | 10 +- cdist/conf/type/__apt_norecommends/man.rst | 10 +- cdist/conf/type/__apt_ppa/man.rst | 10 +- cdist/conf/type/__apt_source/man.rst | 10 +- cdist/conf/type/__apt_update_index/man.rst | 10 +- cdist/conf/type/__block/man.rst | 10 +- cdist/conf/type/__ccollect_source/man.rst | 16 +- cdist/conf/type/__cdist/man.rst | 10 +- cdist/conf/type/__cdistmarker/man.rst | 10 +- cdist/conf/type/__config_file/man.rst | 13 +- cdist/conf/type/__consul/man.rst | 10 +- cdist/conf/type/__consul_agent/man.rst | 13 +- cdist/conf/type/__consul_check/man.rst | 13 +- cdist/conf/type/__consul_reload/man.rst | 10 +- cdist/conf/type/__consul_service/man.rst | 13 +- cdist/conf/type/__consul_template/man.rst | 13 +- .../type/__consul_template_template/man.rst | 15 +- cdist/conf/type/__consul_watch_checks/man.rst | 16 +- cdist/conf/type/__consul_watch_event/man.rst | 16 +- cdist/conf/type/__consul_watch_key/man.rst | 16 +- .../type/__consul_watch_keyprefix/man.rst | 15 +- cdist/conf/type/__consul_watch_nodes/man.rst | 16 +- .../conf/type/__consul_watch_service/man.rst | 15 +- .../conf/type/__consul_watch_services/man.rst | 16 +- cdist/conf/type/__cron/man.rst | 13 +- .../type/__debconf_set_selections/man.rst | 15 +- cdist/conf/type/__directory/man.rst | 10 +- cdist/conf/type/__dog_vdi/man.rst | 14 +- cdist/conf/type/__file/man.rst | 10 +- cdist/conf/type/__firewalld_rule/man.rst | 15 +- cdist/conf/type/__git/man.rst | 10 +- cdist/conf/type/__group/man.rst | 10 +- cdist/conf/type/__hostname/man.rst | 10 +- cdist/conf/type/__iptables_apply/man.rst | 15 +- cdist/conf/type/__iptables_rule/man.rst | 15 +- cdist/conf/type/__issue/man.rst | 10 +- cdist/conf/type/__jail/man.rst | 10 +- cdist/conf/type/__jail_freebsd10/man.rst | 10 +- cdist/conf/type/__jail_freebsd9/man.rst | 10 +- cdist/conf/type/__key_value/man.rst | 10 +- cdist/conf/type/__line/man.rst | 13 +- cdist/conf/type/__link/man.rst | 10 +- cdist/conf/type/__locale/man.rst | 14 +- cdist/conf/type/__motd/man.rst | 10 +- cdist/conf/type/__mount/man.rst | 10 +- cdist/conf/type/__mysql_database/man.rst | 10 +- cdist/conf/type/__package/man.rst | 10 +- cdist/conf/type/__package_apt/man.rst | 13 +- cdist/conf/type/__package_emerge/man.rst | 15 +- .../__package_emerge_dependencies/man.rst | 15 +- cdist/conf/type/__package_luarocks/man.rst | 13 +- cdist/conf/type/__package_opkg/man.rst | 13 +- cdist/conf/type/__package_pacman/man.rst | 13 +- cdist/conf/type/__package_pip/man.rst | 13 +- cdist/conf/type/__package_pkg_freebsd/man.rst | 13 +- cdist/conf/type/__package_pkg_openbsd/man.rst | 13 +- .../conf/type/__package_pkgng_freebsd/man.rst | 13 +- cdist/conf/type/__package_rubygem/man.rst | 13 +- .../conf/type/__package_update_index/man.rst | 10 +- cdist/conf/type/__package_upgrade_all/man.rst | 10 +- cdist/conf/type/__package_yum/man.rst | 13 +- cdist/conf/type/__package_zypper/man.rst | 13 +- cdist/conf/type/__pacman_conf/man.rst | 13 +- .../conf/type/__pacman_conf_integrate/man.rst | 13 +- cdist/conf/type/__pf_apply/man.rst | 15 +- cdist/conf/type/__pf_ruleset/man.rst | 13 +- cdist/conf/type/__postfix/man.rst | 10 +- cdist/conf/type/__postfix_master/man.rst | 13 +- cdist/conf/type/__postfix_postconf/man.rst | 13 +- cdist/conf/type/__postfix_postmap/man.rst | 10 +- cdist/conf/type/__postfix_reload/man.rst | 10 +- cdist/conf/type/__postgres_database/man.rst | 13 +- cdist/conf/type/__postgres_role/man.rst | 16 +- cdist/conf/type/__process/man.rst | 13 +- cdist/conf/type/__pyvenv/man.rst | 10 +- cdist/conf/type/__qemu_img/man.rst | 13 +- cdist/conf/type/__rbenv/man.rst | 10 +- cdist/conf/type/__rsync/man.rst | 13 +- cdist/conf/type/__rvm/man.rst | 17 +- cdist/conf/type/__rvm_gem/man.rst | 17 +- cdist/conf/type/__rvm_gemset/man.rst | 17 +- cdist/conf/type/__rvm_ruby/man.rst | 17 +- cdist/conf/type/__ssh_authorized_key/man.rst | 15 +- cdist/conf/type/__ssh_authorized_keys/man.rst | 13 +- cdist/conf/type/__ssh_dot_ssh/man.rst | 13 +- cdist/conf/type/__staged_file/man.rst | 13 +- cdist/conf/type/__start_on_boot/man.rst | 13 +- cdist/conf/type/__timezone/man.rst | 10 +- cdist/conf/type/__update_alternatives/man.rst | 15 +- cdist/conf/type/__user/man.rst | 13 +- cdist/conf/type/__user_groups/man.rst | 10 +- cdist/conf/type/__yum_repo/man.rst | 10 +- cdist/conf/type/__zypper_repo/man.rst | 10 +- cdist/conf/type/__zypper_service/man.rst | 10 +- docs/changelog | 1 + docs/man/Makefile | 2 +- docs/man/{man7 => }/cdist-best-practice.rst | 44 +-- docs/man/{man7 => }/cdist-bootstrap.rst | 40 +-- docs/man/{man7 => }/cdist-explorer.rst | 28 +- docs/man/cdist-features.rst | 48 +++ docs/man/{man7 => }/cdist-hacker.rst | 47 +-- docs/man/cdist-install.rst | 105 ++++++ docs/man/cdist-intro.rst | 15 + docs/man/cdist-logo.png | Bin 0 -> 1542 bytes docs/man/{man7 => }/cdist-manifest.rst | 45 +-- docs/man/{man7 => }/cdist-messaging.rst | 32 +- docs/man/cdist-os.rst | 16 + docs/man/{man7 => }/cdist-quickstart.rst | 37 +- docs/man/cdist-reference.rst.sh | 63 ++-- .../man/{man7 => }/cdist-remote-exec-copy.rst | 29 +- docs/man/{man7 => }/cdist-stages.rst | 40 +-- docs/man/cdist-support.rst | 28 ++ docs/man/{man7 => }/cdist-troubleshooting.rst | 25 +- docs/man/{man7 => }/cdist-type.rst | 78 ++-- docs/man/cdist-types.rst | 8 + docs/man/cdist-update.rst | 188 ++++++++++ docs/man/cdist-why.rst | 72 ++++ docs/man/conf.py | 7 + docs/man/index.rst | 25 +- docs/man/man1/cdist.rst | 8 +- docs/man/man7/cdist-tutorial.rst | 58 --- 125 files changed, 1799 insertions(+), 816 deletions(-) create mode 100755 bin/build-helper.freebsd mode change 100755 => 100644 cdist/conf/type/__pyvenv/man.rst rename docs/man/{man7 => }/cdist-best-practice.rst (90%) rename docs/man/{man7 => }/cdist-bootstrap.rst (86%) rename docs/man/{man7 => }/cdist-explorer.rst (75%) create mode 100644 docs/man/cdist-features.rst rename docs/man/{man7 => }/cdist-hacker.rst (86%) create mode 100644 docs/man/cdist-install.rst create mode 100644 docs/man/cdist-intro.rst create mode 100644 docs/man/cdist-logo.png rename docs/man/{man7 => }/cdist-manifest.rst (92%) rename docs/man/{man7 => }/cdist-messaging.rst (79%) create mode 100644 docs/man/cdist-os.rst rename docs/man/{man7 => }/cdist-quickstart.rst (82%) rename docs/man/{man7 => }/cdist-remote-exec-copy.rst (61%) rename docs/man/{man7 => }/cdist-stages.rst (77%) create mode 100644 docs/man/cdist-support.rst rename docs/man/{man7 => }/cdist-troubleshooting.rst (73%) rename docs/man/{man7 => }/cdist-type.rst (88%) create mode 100644 docs/man/cdist-types.rst create mode 100644 docs/man/cdist-update.rst create mode 100644 docs/man/cdist-why.rst delete mode 100644 docs/man/man7/cdist-tutorial.rst diff --git a/.gitignore b/.gitignore index 2a193c2a..6152451b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ docs/man/man*/*.html docs/man/man*/*.xml docs/man/man*/docbook-xsl.css docs/man/man7/cdist-type__*.rst -docs/man/man7/cdist-reference.rst +docs/man/cdist-reference.rst # Ignore cdist cache for version control /cache/ diff --git a/Makefile b/Makefile index faa8e9d5..9f3535fd 100644 --- a/Makefile +++ b/Makefile @@ -63,10 +63,10 @@ $(MANREF): $(MANREFSH) $(MANREFSH) # Manpages #3: generic part -mansphinxman: $(MANTYPES) $(MANREF) +mansphinxman: $(MANTYPES) $(MANREF) $(PYTHON_VERSION) $(SPHINXM) -mansphinxhtml: $(MANTYPES) $(MANREF) +mansphinxhtml: $(MANTYPES) $(MANREF) $(PYTHON_VERSION) $(SPHINXH) man: mansphinxman mansphinxhtml diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd new file mode 100755 index 00000000..01d86a10 --- /dev/null +++ b/bin/build-helper.freebsd @@ -0,0 +1,336 @@ +#!/bin/sh +# +# 2011-2013 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 . +# +# +# This file contains the heavy lifting found usually in the Makefile +# + +# vars for make +helper=$0 + +basedir=${0%/*}/../ +# run_as is used to check how the script is called (by $0 value) +# currently supported sufixes for $0 are: +# .freebsd - run as freebsd +basename=${0##*/} +run_as=${basename#*.} +case "$run_as" in + freebsd) + to_a=cdist-configuration-management + to_d=googlegroups.com + from_a=darko.poljak + from_d=gmail.com + ml_name="Darko Poljak" + ml_sig_name="Darko" + + # vars for make + WEBDIR=../vcs/www.nico.schottelius.org + ;; + *) + to_a=cdist + to_d=l.schottelius.org + from_a=nico-cdist + from_d=schottelius.org + ml_name="Nico -telmich- Schottelius" + ml_sig_name="Nico" + + # vars for make + WEBDIR=$$HOME/vcs/www.nico.schottelius.org + ;; +esac + +# Change to checkout directory +cd "$basedir" + +version=$(git describe) + +option=$1; shift + +case "$option" in + print-make-vars) + printf "helper: ${helper}\n" + printf "WEBDIR: ${WEBDIR}\n" + ;; + print-runas) + printf "run_as: $run_as\n" + ;; + changelog-changes) + if [ "$#" -eq 1 ]; then + start=$1 + else + start="[[:digit:]]" + fi + + end="[[:digit:]]" + + awk -F: "BEGIN { start=0 } + { + if(start == 0) { + if (\$0 ~ /^$start/) { + start = 1 + } + } else { + if (\$0 ~ /^$end/) { + exit + } else { + print \$0 + } + } + }" "$basedir/docs/changelog" + ;; + + changelog-version) + # get version from changelog + grep '^[[:digit:]]' "$basedir/docs/changelog" | head -n1 | sed 's/:.*//' + ;; + + check-date) + # verify date in changelog is today + date_today="$(date +%Y-%m-%d)" + date_changelog=$(grep '^[[:digit:]]' "$basedir/docs/changelog" | head -n1 | sed 's/.*: //') + + if [ "$date_today" != "$date_changelog" ]; then + echo "Date in changelog is not today" + echo "Changelog: $date_changelog" + exit 1 + fi + ;; + + check-unittest) + "$0" test + ;; + + blog) + version=$1; shift + blogfile=$1; shift + dir=${blogfile%/*} + file=${blogfile##*/} + + + cat << eof > "$blogfile" +[[!meta title="Cdist $version released"]] + +Here's a short overview about the changes found in version ${version}: + +eof + + $0 changelog-changes "$version" >> "$blogfile" + + cat << eof >> "$blogfile" +For more information visit the [[cdist homepage|software/cdist]]. + +[[!tag cdist config unix]] +eof + cd "$dir" + git add "$file" + # Allow git commit to fail if there are no changes + git commit -m "cdist blog update: $version" "$blogfile" || true + ;; + + ml-release) + if [ $# -ne 1 ]; then + echo "$0 ml-release version" >&2 + exit 1 + fi + + version=$1; shift + + to=${to_a}@${to_d} + from=${from_a}@${from_d} + + ( + cat << eof +From: ${ml_name} <$from> +To: cdist mailing list <$to> +Subject: cdist $version released + +Hello .*, + +cdist $version has been released with the following changes: + +eof + + "$0" changelog-changes "$version" + cat << eof + +Cheers, + +${ml_sig_name} + +-- +Automatisation at its best level. With cdist. +eof + ) | /usr/sbin/sendmail -f "$from" "$to" + ;; + + release-git-tag) + target_version=$($0 changelog-version) + if git rev-parse --verify refs/tags/$target_version 2>/dev/null; then + echo "Tag for $target_version exists, aborting" + exit 1 + fi + printf "Enter tag description for ${target_version}: " + read tagmessage + git tag "$target_version" -m "$$tagmessage" + ;; + + release) + set -e + target_version=$($0 changelog-version) + target_branch=$($0 version-branch) + + echo "Beginning release process for $target_version" + + # First check everything is sane + "$0" check-date + "$0" check-unittest + + # Generate version file to be included in packaging + "$0" version + + # Ensure the git status is clean, else abort + if ! git diff-index --name-only --exit-code HEAD ; then + echo "Unclean tree, see files above, aborting" + exit 1 + fi + + # Ensure we are on the master branch + masterbranch=yes + if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then + echo "Releases are happening from the master branch, aborting" + + echo "Enter the magic word to release anyway" + read magicword + + if [ "$magicword" = "iknowwhatido" ]; then + masterbranch=no + else + exit 1 + fi + fi + + if [ "$masterbranch" = yes ]; then + # Ensure version branch exists + if ! git rev-parse --verify refs/heads/$target_branch 2>/dev/null; then + git branch "$target_branch" + fi + + # Merge master branch into version branch + git checkout "$target_branch" + git merge master + fi + + # Verify that after the merge everything works + "$0" check-date + "$0" check-unittest + + # Generate man pages (indirect check if they build) + make helper=${helper} WEBDIR=${WEBDIR} man + + # Generate speeches (indirect check if they build) + make helper=${helper} WEBDIR=${WEBDIR} speeches + + ############################################################# + # Everything green, let's do the release + + # Tag the current commit + "$0" release-git-tag + + # Also merge back the version branch + if [ "$masterbranch" = yes ]; then + git checkout master + git merge "$target_branch" + fi + + # Publish git changes + make helper=${helper} WEBDIR=${WEBDIR} pub + + # publish man, speeches, website + if [ "$masterbranch" = yes ]; then + make helper=${helper} WEBDIR=${WEBDIR} web-release-all + else + make helper=${helper} WEBDIR=${WEBDIR} web-release-all-no-latest + fi + + # Ensure that pypi release has the right version + "$0" version + + # Create and publish package for pypi + make helper=${helper} WEBDIR=${WEBDIR} pypi-release + + case "$run_as" in + freebsd) + ;; + *) + # Archlinux release is based on pypi + make archlinux-release + ;; + esac + + # Announce change on ML + make helper=${helper} WEBDIR=${WEBDIR} ml-release + + cat << eof +Manual steps post release: + + - linkedin + - hackernews + - reddit + - twitter + +eof + + case "$run_as" in + freebsd) + cat < cdist/version.py + ;; + + *) + echo "Unknown helper target $@ - aborting" + exit 1 + ;; + +esac diff --git a/cdist/conf/type/__apt_key/man.rst b/cdist/conf/type/__apt_key/man.rst index cb4c4108..01d4eea4 100644 --- a/cdist/conf/type/__apt_key/man.rst +++ b/cdist/conf/type/__apt_key/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__apt_key - Manage the list of keys used by apt -Steven Armstrong - DESCRIPTION ----------- @@ -52,7 +50,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__apt_key_uri/man.rst b/cdist/conf/type/__apt_key_uri/man.rst index ee8d1601..9c0042bb 100644 --- a/cdist/conf/type/__apt_key_uri/man.rst +++ b/cdist/conf/type/__apt_key_uri/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__apt_key_uri - Add apt key from uri -Steven Armstrong - DESCRIPTION ----------- @@ -42,7 +40,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__apt_norecommends/man.rst b/cdist/conf/type/__apt_norecommends/man.rst index 09ea9d16..0198d7bd 100644 --- a/cdist/conf/type/__apt_norecommends/man.rst +++ b/cdist/conf/type/__apt_norecommends/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__apt_norecommends - Configure apt to not install recommended packages -Steven Armstrong - DESCRIPTION ----------- @@ -33,7 +31,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__apt_ppa/man.rst b/cdist/conf/type/__apt_ppa/man.rst index 922b18d5..e91e82fe 100644 --- a/cdist/conf/type/__apt_ppa/man.rst +++ b/cdist/conf/type/__apt_ppa/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__apt_ppa - Manage ppa repositories -Steven Armstrong - DESCRIPTION ----------- @@ -41,7 +39,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__apt_source/man.rst b/cdist/conf/type/__apt_source/man.rst index 2e09aee5..e4916515 100644 --- a/cdist/conf/type/__apt_source/man.rst +++ b/cdist/conf/type/__apt_source/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__apt_source - Manage apt sources -Steven Armstrong - DESCRIPTION ----------- @@ -60,7 +58,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__apt_update_index/man.rst b/cdist/conf/type/__apt_update_index/man.rst index ce8610f3..e0672620 100644 --- a/cdist/conf/type/__apt_update_index/man.rst +++ b/cdist/conf/type/__apt_update_index/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__apt_update_index - Update apt's package index -Steven Armstrong - DESCRIPTION ----------- @@ -32,7 +30,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__block/man.rst b/cdist/conf/type/__block/man.rst index bd5304d8..3b7c3439 100644 --- a/cdist/conf/type/__block/man.rst +++ b/cdist/conf/type/__block/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__block - Manage blocks of text in files -Steven Armstrong - DESCRIPTION ----------- @@ -73,7 +71,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__ccollect_source/man.rst b/cdist/conf/type/__ccollect_source/man.rst index 29baa5c4..5d980bda 100644 --- a/cdist/conf/type/__ccollect_source/man.rst +++ b/cdist/conf/type/__ccollect_source/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__ccollect_source - Manage ccollect sources -Nico Schottelius - DESCRIPTION ----------- @@ -55,9 +53,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- ccollect(1) -- http://www.nico.schottelius.org/software/ccollect/ +ccollect(1) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +ccollect documentation at: +. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__cdist/man.rst b/cdist/conf/type/__cdist/man.rst index c0e8365e..ad544c5c 100644 --- a/cdist/conf/type/__cdist/man.rst +++ b/cdist/conf/type/__cdist/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__cdist - Manage cdist installations -Nico Schottelius - DESCRIPTION ----------- @@ -54,7 +52,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__cdistmarker/man.rst b/cdist/conf/type/__cdistmarker/man.rst index efd696ef..156aed62 100644 --- a/cdist/conf/type/__cdistmarker/man.rst +++ b/cdist/conf/type/__cdistmarker/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__cdistmarker - Add a timestamped cdist marker. -Daniel Maher - DESCRIPTION ----------- @@ -46,7 +44,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Daniel Maher COPYING diff --git a/cdist/conf/type/__config_file/man.rst b/cdist/conf/type/__config_file/man.rst index 8eec81b0..acb3c848 100644 --- a/cdist/conf/type/__config_file/man.rst +++ b/cdist/conf/type/__config_file/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__config_file - _Manages config files -Steven Armstrong - DESCRIPTION ----------- @@ -50,8 +48,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__file(7) `_ +`cdist-type__file(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul/man.rst b/cdist/conf/type/__consul/man.rst index e6a9d2d7..4096a233 100644 --- a/cdist/conf/type/__consul/man.rst +++ b/cdist/conf/type/__consul/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul - Install consul -Steven Armstrong - DESCRIPTION ----------- @@ -45,7 +43,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_agent/man.rst b/cdist/conf/type/__consul_agent/man.rst index 25ad4d5b..7a15a058 100644 --- a/cdist/conf/type/__consul_agent/man.rst +++ b/cdist/conf/type/__consul_agent/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_agent - Manage the consul agent -Steven Armstrong - DESCRIPTION ----------- @@ -167,8 +165,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- http://www.consul.io/docs/agent/options.html +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consul documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_check/man.rst b/cdist/conf/type/__consul_check/man.rst index f04645fd..87e2d7a9 100644 --- a/cdist/conf/type/__consul_check/man.rst +++ b/cdist/conf/type/__consul_check/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_check - Manages consul checks -Steven Armstrong - DESCRIPTION ----------- @@ -64,8 +62,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_reload/man.rst b/cdist/conf/type/__consul_reload/man.rst index 38618aba..62b08c7f 100644 --- a/cdist/conf/type/__consul_reload/man.rst +++ b/cdist/conf/type/__consul_reload/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_reload - Reload consul -Steven Armstrong - DESCRIPTION ----------- @@ -33,7 +31,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_service/man.rst b/cdist/conf/type/__consul_service/man.rst index f7d34f4a..560266a4 100644 --- a/cdist/conf/type/__consul_service/man.rst +++ b/cdist/conf/type/__consul_service/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_service - Manages consul services -Steven Armstrong - DESCRIPTION ----------- @@ -68,8 +66,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_template/man.rst b/cdist/conf/type/__consul_template/man.rst index 8e01ee04..d2d484e5 100644 --- a/cdist/conf/type/__consul_template/man.rst +++ b/cdist/conf/type/__consul_template/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_template - Manage the consul-template service -Steven Armstrong - DESCRIPTION ----------- @@ -127,8 +125,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- https://github.com/hashicorp/consul-template +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consul documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_template_template/man.rst b/cdist/conf/type/__consul_template_template/man.rst index 30832bc8..9932346b 100644 --- a/cdist/conf/type/__consul_template_template/man.rst +++ b/cdist/conf/type/__consul_template_template/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_template_template - Manage consul-template templates -Steven Armstrong - DESCRIPTION ----------- @@ -61,9 +59,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_template(7) `_ -- `cdist-type__consul_template_config(7) `_ +`cdist-type__consul_template(7) `_, +`cdist-type__consul_template_config(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_watch_checks/man.rst b/cdist/conf/type/__consul_watch_checks/man.rst index cfb451d6..dc3c9669 100644 --- a/cdist/conf/type/__consul_watch_checks/man.rst +++ b/cdist/conf/type/__consul_watch_checks/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_watch_checks - Manages consul checks watches -Steven Armstrong - DESCRIPTION ----------- @@ -57,9 +55,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ -- http://www.consul.io/docs/agent/watches.html +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consul documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_watch_event/man.rst b/cdist/conf/type/__consul_watch_event/man.rst index 871c0704..73b16754 100644 --- a/cdist/conf/type/__consul_watch_event/man.rst +++ b/cdist/conf/type/__consul_watch_event/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_watch_event - Manages consul event watches -Steven Armstrong - DESCRIPTION ----------- @@ -50,9 +48,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ -- http://www.consul.io/docs/agent/watches.html +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consul documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_watch_key/man.rst b/cdist/conf/type/__consul_watch_key/man.rst index d7554df2..c258119c 100644 --- a/cdist/conf/type/__consul_watch_key/man.rst +++ b/cdist/conf/type/__consul_watch_key/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_watch_key - Manages consul key watches -Steven Armstrong - DESCRIPTION ----------- @@ -47,9 +45,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ -- http://www.consul.io/docs/agent/watches.html +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consul documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_watch_keyprefix/man.rst b/cdist/conf/type/__consul_watch_keyprefix/man.rst index 42f675a4..950c0a26 100644 --- a/cdist/conf/type/__consul_watch_keyprefix/man.rst +++ b/cdist/conf/type/__consul_watch_keyprefix/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_watch_keyprefix - Manages consul keyprefix watches -Steven Armstrong - DESCRIPTION ----------- @@ -47,9 +45,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ -- http://www.consul.io/docs/agent/watches.html +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consule documentation at: . + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_watch_nodes/man.rst b/cdist/conf/type/__consul_watch_nodes/man.rst index c92a8d01..a44dada4 100644 --- a/cdist/conf/type/__consul_watch_nodes/man.rst +++ b/cdist/conf/type/__consul_watch_nodes/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_watch_nodes - Manages consul nodes watches -Steven Armstrong - DESCRIPTION ----------- @@ -43,9 +41,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ -- http://www.consul.io/docs/agent/watches.html +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consul documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_watch_service/man.rst b/cdist/conf/type/__consul_watch_service/man.rst index f37a0dea..fa6450fe 100644 --- a/cdist/conf/type/__consul_watch_service/man.rst +++ b/cdist/conf/type/__consul_watch_service/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_watch_service - Manages consul service watches -Steven Armstrong - DESCRIPTION ----------- @@ -67,9 +65,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ -- http://www.consul.io/docs/agent/watches.html +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consule documentation at: . + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__consul_watch_services/man.rst b/cdist/conf/type/__consul_watch_services/man.rst index 3d39da00..db561593 100644 --- a/cdist/conf/type/__consul_watch_services/man.rst +++ b/cdist/conf/type/__consul_watch_services/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__consul_watch_services - Manages consul services watches -Steven Armstrong - DESCRIPTION ----------- @@ -43,9 +41,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__consul_agent(7) `_ -- http://www.consul.io/docs/agent/watches.html +`cdist-type__consul_agent(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +consul documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__cron/man.rst b/cdist/conf/type/__cron/man.rst index 33f2b185..e8f32c52 100644 --- a/cdist/conf/type/__cron/man.rst +++ b/cdist/conf/type/__cron/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__cron - Installs and manages cron jobs -Steven Armstrong - DESCRIPTION ----------- @@ -70,8 +68,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- crontab(5) +crontab(5) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__debconf_set_selections/man.rst b/cdist/conf/type/__debconf_set_selections/man.rst index 60cdd5f0..27e037e7 100644 --- a/cdist/conf/type/__debconf_set_selections/man.rst +++ b/cdist/conf/type/__debconf_set_selections/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__debconf_set_selections - Setup debconf selections -Nico Schottelius - DESCRIPTION ----------- @@ -39,9 +37,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__update_alternatives(7) `_ -- debconf-set-selections(1) +debconf-set-selections(1), +`cdist-type__update_alternatives(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__directory/man.rst b/cdist/conf/type/__directory/man.rst index 8ca292ff..abb07eff 100644 --- a/cdist/conf/type/__directory/man.rst +++ b/cdist/conf/type/__directory/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__directory - Manage a directory -Nico Schottelius - DESCRIPTION ----------- @@ -92,7 +90,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__dog_vdi/man.rst b/cdist/conf/type/__dog_vdi/man.rst index 3e0c27c9..b0f700c6 100644 --- a/cdist/conf/type/__dog_vdi/man.rst +++ b/cdist/conf/type/__dog_vdi/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__dog_vdi - Manage Sheepdog VM images -Nico Schottelius - DESCRIPTION ----------- @@ -45,9 +43,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- dog(8) -- qemu(1) +qemu(1), dog(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__file/man.rst b/cdist/conf/type/__file/man.rst index 89efebdb..fa71e5ce 100644 --- a/cdist/conf/type/__file/man.rst +++ b/cdist/conf/type/__file/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__file - Manage files. -Nico Schottelius - DESCRIPTION ----------- @@ -103,7 +101,13 @@ EXAMPLES SEE ALSO -------- -* `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__firewalld_rule/man.rst b/cdist/conf/type/__firewalld_rule/man.rst index 4533e193..2d1f5589 100644 --- a/cdist/conf/type/__firewalld_rule/man.rst +++ b/cdist/conf/type/__firewalld_rule/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__firewalld_rule - Configure firewalld rules -Nico Schottelius - DESCRIPTION ----------- @@ -67,9 +65,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__iptables_rule(7) `_ -- firewalld(8) +`cdist-type__iptables_rule(7) `_, +firewalld(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__git/man.rst b/cdist/conf/type/__git/man.rst index 3ccc1e91..2f344a69 100644 --- a/cdist/conf/type/__git/man.rst +++ b/cdist/conf/type/__git/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__git - Get and or keep git repositories up-to-date -Nico Schottelius - DESCRIPTION ----------- @@ -51,7 +49,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__group/man.rst b/cdist/conf/type/__group/man.rst index 6a7d5a55..c6c9d226 100644 --- a/cdist/conf/type/__group/man.rst +++ b/cdist/conf/type/__group/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__group - Manage groups -Steven Armstrong - DESCRIPTION ----------- @@ -71,7 +69,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__hostname/man.rst b/cdist/conf/type/__hostname/man.rst index bd5d5a21..bfb9d457 100644 --- a/cdist/conf/type/__hostname/man.rst +++ b/cdist/conf/type/__hostname/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__hostname - Set the hostname -Steven Armstrong - DESCRIPTION ----------- @@ -43,7 +41,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__iptables_apply/man.rst b/cdist/conf/type/__iptables_apply/man.rst index 6a94b0af..5f4f4dc8 100644 --- a/cdist/conf/type/__iptables_apply/man.rst +++ b/cdist/conf/type/__iptables_apply/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__iptables_apply - Apply the rules -Nico Schottelius - DESCRIPTION ----------- @@ -31,9 +29,16 @@ None (__iptables_apply is used by __iptables_rule) SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__iptables_rule(7) `_ -- iptables(8) +`cdist-type__iptables_rule(7) `_, +iptables(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__iptables_rule/man.rst b/cdist/conf/type/__iptables_rule/man.rst index b6ff6a32..4d02e1d7 100644 --- a/cdist/conf/type/__iptables_rule/man.rst +++ b/cdist/conf/type/__iptables_rule/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__iptables_rule - Deploy iptable rulesets -Nico Schottelius - DESCRIPTION ----------- @@ -52,9 +50,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__iptables_apply(7) `_ -- iptables(8) +`cdist-type__iptables_apply(7) `_, +iptables(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__issue/man.rst b/cdist/conf/type/__issue/man.rst index 59fa6694..77f28da2 100644 --- a/cdist/conf/type/__issue/man.rst +++ b/cdist/conf/type/__issue/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__issue - Manage issue -Nico Schottelius - DESCRIPTION ----------- @@ -38,7 +36,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__jail/man.rst b/cdist/conf/type/__jail/man.rst index 6bbfbf47..ba175aa4 100644 --- a/cdist/conf/type/__jail/man.rst +++ b/cdist/conf/type/__jail/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__jail - Manage FreeBSD jails -Jake Guffey - DESCRIPTION ----------- @@ -110,7 +108,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Jake Guffey COPYING diff --git a/cdist/conf/type/__jail_freebsd10/man.rst b/cdist/conf/type/__jail_freebsd10/man.rst index 1a3515f0..9916afcb 100644 --- a/cdist/conf/type/__jail_freebsd10/man.rst +++ b/cdist/conf/type/__jail_freebsd10/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__jail_freeebsd10 - Manage FreeBSD jails -Jake Guffey - DESCRIPTION ----------- @@ -109,7 +107,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Jake Guffey COPYING diff --git a/cdist/conf/type/__jail_freebsd9/man.rst b/cdist/conf/type/__jail_freebsd9/man.rst index 1e442ac0..21266dd8 100644 --- a/cdist/conf/type/__jail_freebsd9/man.rst +++ b/cdist/conf/type/__jail_freebsd9/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__jail_freebsd9 - Manage FreeBSD jails -Jake Guffey - DESCRIPTION ----------- @@ -110,7 +108,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Jake Guffey COPYING diff --git a/cdist/conf/type/__key_value/man.rst b/cdist/conf/type/__key_value/man.rst index 467be78b..78e29276 100644 --- a/cdist/conf/type/__key_value/man.rst +++ b/cdist/conf/type/__key_value/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__key_value - Change property values in files -Steven Armstrong - DESCRIPTION ----------- @@ -85,7 +83,13 @@ So you need to exactly specify the key and delimiter. Delimiter can be of any le SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__line/man.rst b/cdist/conf/type/__line/man.rst index 81f57039..3a773f6a 100644 --- a/cdist/conf/type/__line/man.rst +++ b/cdist/conf/type/__line/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__line - Manage lines in files -Nico Schottelius - DESCRIPTION ----------- @@ -63,8 +61,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- grep(1) +grep(1) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__link/man.rst b/cdist/conf/type/__link/man.rst index 750874c1..0d0f2fad 100644 --- a/cdist/conf/type/__link/man.rst +++ b/cdist/conf/type/__link/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__link - Manage links (hard and symbolic) -Nico Schottelius - DESCRIPTION ----------- @@ -51,7 +49,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__locale/man.rst b/cdist/conf/type/__locale/man.rst index 2d947da8..c555bd00 100644 --- a/cdist/conf/type/__locale/man.rst +++ b/cdist/conf/type/__locale/man.rst @@ -5,8 +5,6 @@ NAME ---- cdit-type__locale - Configure locales -Nico Schottelius - DESCRIPTION ----------- @@ -36,9 +34,15 @@ EXAMPLES SEE ALSO -------- -- locale(1) -- localedef(1) -- `cdist-type(7) `_ +locale(1), localedef(1) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__motd/man.rst b/cdist/conf/type/__motd/man.rst index 1de8b258..e1530495 100644 --- a/cdist/conf/type/__motd/man.rst +++ b/cdist/conf/type/__motd/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__motd - Manage message of the day -Nico Schottelius - DESCRIPTION ----------- @@ -39,7 +37,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__mount/man.rst b/cdist/conf/type/__mount/man.rst index eab304db..c53457ac 100644 --- a/cdist/conf/type/__mount/man.rst +++ b/cdist/conf/type/__mount/man.rst @@ -5,8 +5,6 @@ NAME ---- cdit-type__mount - Manage filesystem mounts -Steven Armstrong - DESCRIPTION ----------- @@ -75,7 +73,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__mysql_database/man.rst b/cdist/conf/type/__mysql_database/man.rst index d8d2626d..921df7f3 100644 --- a/cdist/conf/type/__mysql_database/man.rst +++ b/cdist/conf/type/__mysql_database/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__mysql_database - Manage a MySQL database -Benedikt Koeppel - DESCRIPTION ----------- @@ -40,7 +38,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Benedikt Koeppel COPYING diff --git a/cdist/conf/type/__package/man.rst b/cdist/conf/type/__package/man.rst index b412af69..fe806a53 100644 --- a/cdist/conf/type/__package/man.rst +++ b/cdist/conf/type/__package/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package - Manage packages -Steven Armstrong - DESCRIPTION ----------- @@ -55,7 +53,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__package_apt/man.rst b/cdist/conf/type/__package_apt/man.rst index 65ebf6fa..39eb550b 100644 --- a/cdist/conf/type/__package_apt/man.rst +++ b/cdist/conf/type/__package_apt/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_apt - Manage packages with apt-get -Nico Schottelius - DESCRIPTION ----------- @@ -48,8 +46,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__package_emerge/man.rst b/cdist/conf/type/__package_emerge/man.rst index c9ac59b9..24f3546d 100644 --- a/cdist/conf/type/__package_emerge/man.rst +++ b/cdist/conf/type/__package_emerge/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_emerge - Manage packages with portage -Thomas Oettli - DESCRIPTION ----------- @@ -49,9 +47,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ -- `cdist-type__package_emerge_dependencies(7) `_ +`cdist-type__package(7) `_, +`cdist-type__package_emerge_dependencies(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Thomas Oettli COPYING diff --git a/cdist/conf/type/__package_emerge_dependencies/man.rst b/cdist/conf/type/__package_emerge_dependencies/man.rst index 1c4d291b..b07d2284 100644 --- a/cdist/conf/type/__package_emerge_dependencies/man.rst +++ b/cdist/conf/type/__package_emerge_dependencies/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_emerge_dependencies - Install dependencies for __package_emerge -Thomas Oettli - DESCRIPTION ----------- @@ -38,9 +36,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ -- `cdist-type__package_emerge(7) `_ +`cdist-type__package(7) `_, +`cdist-type__package_emerge(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Thomas Oettli COPYING diff --git a/cdist/conf/type/__package_luarocks/man.rst b/cdist/conf/type/__package_luarocks/man.rst index e097b4d6..e5279513 100644 --- a/cdist/conf/type/__package_luarocks/man.rst +++ b/cdist/conf/type/__package_luarocks/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_luarocks - Manage luarocks packages -Christian G. Warden - DESCRIPTION ----------- @@ -41,8 +39,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Christian G. Warden COPYING diff --git a/cdist/conf/type/__package_opkg/man.rst b/cdist/conf/type/__package_opkg/man.rst index 0104bbf2..9ad4d99f 100644 --- a/cdist/conf/type/__package_opkg/man.rst +++ b/cdist/conf/type/__package_opkg/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_opkg - Manage packages with opkg -Giel van Schijndel - DESCRIPTION ----------- @@ -41,8 +39,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Giel van Schijndel COPYING diff --git a/cdist/conf/type/__package_pacman/man.rst b/cdist/conf/type/__package_pacman/man.rst index 6f3fc5b3..b144422b 100644 --- a/cdist/conf/type/__package_pacman/man.rst +++ b/cdist/conf/type/__package_pacman/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_pacman - Manage packages with pacman -Nico Schottelius - DESCRIPTION ----------- @@ -44,8 +42,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__package_pip/man.rst b/cdist/conf/type/__package_pip/man.rst index 0630274a..026562c1 100644 --- a/cdist/conf/type/__package_pip/man.rst +++ b/cdist/conf/type/__package_pip/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_pip - Manage packages with pip -Nico Schottelius - DESCRIPTION ----------- @@ -51,8 +49,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__package_pkg_freebsd/man.rst b/cdist/conf/type/__package_pkg_freebsd/man.rst index 9246d09c..8249c8f5 100644 --- a/cdist/conf/type/__package_pkg_freebsd/man.rst +++ b/cdist/conf/type/__package_pkg_freebsd/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_pkg_freebsd - Manage FreeBSD packages -Jake Guffey - DESCRIPTION ----------- @@ -56,8 +54,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Jake Guffey COPYING diff --git a/cdist/conf/type/__package_pkg_openbsd/man.rst b/cdist/conf/type/__package_pkg_openbsd/man.rst index f584864b..9d253dce 100644 --- a/cdist/conf/type/__package_pkg_openbsd/man.rst +++ b/cdist/conf/type/__package_pkg_openbsd/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_pkg - Manage OpenBSD packages -Andi Brönnimann - DESCRIPTION ----------- @@ -56,8 +54,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Andi Brönnimann COPYING diff --git a/cdist/conf/type/__package_pkgng_freebsd/man.rst b/cdist/conf/type/__package_pkgng_freebsd/man.rst index b81ef75c..83fbf7bf 100644 --- a/cdist/conf/type/__package_pkgng_freebsd/man.rst +++ b/cdist/conf/type/__package_pkgng_freebsd/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_pkgng_freebsd - Manage FreeBSD packages with pkg-ng -Jake Guffey - DESCRIPTION ----------- @@ -87,8 +85,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Jake Guffey COPYING diff --git a/cdist/conf/type/__package_rubygem/man.rst b/cdist/conf/type/__package_rubygem/man.rst index d74149b0..0822bcf2 100644 --- a/cdist/conf/type/__package_rubygem/man.rst +++ b/cdist/conf/type/__package_rubygem/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_rubygem - Manage rubygem packages -Chase Allen James - DESCRIPTION ----------- @@ -41,8 +39,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Chase Allen James COPYING diff --git a/cdist/conf/type/__package_update_index/man.rst b/cdist/conf/type/__package_update_index/man.rst index ae05b3c5..a8f16d21 100644 --- a/cdist/conf/type/__package_update_index/man.rst +++ b/cdist/conf/type/__package_update_index/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__update_index - Update the package index -Ricardo Catalinas Jiménez - DESCRIPTION ----------- @@ -44,7 +42,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Ricardo Catalinas Jiménez COPYING diff --git a/cdist/conf/type/__package_upgrade_all/man.rst b/cdist/conf/type/__package_upgrade_all/man.rst index af6a2373..f6b216b4 100644 --- a/cdist/conf/type/__package_upgrade_all/man.rst +++ b/cdist/conf/type/__package_upgrade_all/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_upgrade_all - Upgrade all the installed packages -Ricardo Catalinas Jiménez - DESCRIPTION ----------- @@ -44,7 +42,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Ricardo Catalinas Jiménez COPYING diff --git a/cdist/conf/type/__package_yum/man.rst b/cdist/conf/type/__package_yum/man.rst index 440d0723..487150b9 100644 --- a/cdist/conf/type/__package_yum/man.rst +++ b/cdist/conf/type/__package_yum/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_yum - Manage packages with yum -Nico Schottelius - DESCRIPTION ----------- @@ -51,8 +49,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__package_zypper/man.rst b/cdist/conf/type/__package_zypper/man.rst index 74648c9e..754b5ddd 100644 --- a/cdist/conf/type/__package_zypper/man.rst +++ b/cdist/conf/type/__package_zypper/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__package_zypper - Manage packages with zypper -Daniel Heule - DESCRIPTION ----------- @@ -58,8 +56,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__package(7) `_ +`cdist-type__package(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Daniel Heule COPYING diff --git a/cdist/conf/type/__pacman_conf/man.rst b/cdist/conf/type/__pacman_conf/man.rst index 0a8eb62a..c0040664 100644 --- a/cdist/conf/type/__pacman_conf/man.rst +++ b/cdist/conf/type/__pacman_conf/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__pacman_conf - Manage pacman configuration -Dominique Roux - DESCRIPTION ----------- @@ -61,8 +59,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- grep(1) +grep(1) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Dominique Roux COPYING diff --git a/cdist/conf/type/__pacman_conf_integrate/man.rst b/cdist/conf/type/__pacman_conf_integrate/man.rst index 30ef6cd9..10ff0c8a 100644 --- a/cdist/conf/type/__pacman_conf_integrate/man.rst +++ b/cdist/conf/type/__pacman_conf_integrate/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__pacman_conf_integrate - Integrate default pacman.conf to cdist conform and vice versa -Dominique Roux - DESCRIPTION ----------- @@ -37,8 +35,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- grep(1) +grep(1) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Dominique Roux COPYING diff --git a/cdist/conf/type/__pf_apply/man.rst b/cdist/conf/type/__pf_apply/man.rst index acebcb96..20374699 100644 --- a/cdist/conf/type/__pf_apply/man.rst +++ b/cdist/conf/type/__pf_apply/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__pf_apply - Apply pf(4) ruleset on \*BSD -Jake Guffey - DESCRIPTION ----------- @@ -41,9 +39,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__pf_ruleset(7) `_ -- pf(4) +pf(4), +`cdist-type__pf_ruleset(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Jake Guffey COPYING diff --git a/cdist/conf/type/__pf_ruleset/man.rst b/cdist/conf/type/__pf_ruleset/man.rst index 7edc0f91..15d50408 100644 --- a/cdist/conf/type/__pf_ruleset/man.rst +++ b/cdist/conf/type/__pf_ruleset/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__pf_ruleset - Copy a pf(4) ruleset to $__target_host -Jake Guffey - DESCRIPTION ----------- @@ -41,8 +39,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- pf(4) +pf(4) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Jake Guffey COPYING diff --git a/cdist/conf/type/__postfix/man.rst b/cdist/conf/type/__postfix/man.rst index 73347e38..628356b2 100644 --- a/cdist/conf/type/__postfix/man.rst +++ b/cdist/conf/type/__postfix/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__postfix - Install postfix -Steven Armstrong - DESCRIPTION ----------- @@ -33,7 +31,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__postfix_master/man.rst b/cdist/conf/type/__postfix_master/man.rst index 86fa5f8c..7f100485 100644 --- a/cdist/conf/type/__postfix_master/man.rst +++ b/cdist/conf/type/__postfix_master/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__postfix_master - Configure postfix master.cf -Steven Armstrong - DESCRIPTION ----------- @@ -70,8 +68,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- master(5) +master(5) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__postfix_postconf/man.rst b/cdist/conf/type/__postfix_postconf/man.rst index ab0192b8..f1a4b0a6 100644 --- a/cdist/conf/type/__postfix_postconf/man.rst +++ b/cdist/conf/type/__postfix_postconf/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__postfix_postconf - Configure postfix main.cf -Steven Armstrong - DESCRIPTION ----------- @@ -40,8 +38,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- postconf(5) +postconf(5) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__postfix_postmap/man.rst b/cdist/conf/type/__postfix_postmap/man.rst index 5e9d3c2d..20aeb2df 100644 --- a/cdist/conf/type/__postfix_postmap/man.rst +++ b/cdist/conf/type/__postfix_postmap/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__postfix_postmap - Run postmap on the given file -Steven Armstrong - DESCRIPTION ----------- @@ -33,7 +31,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__postfix_reload/man.rst b/cdist/conf/type/__postfix_reload/man.rst index 330ed51c..ec9529e9 100644 --- a/cdist/conf/type/__postfix_reload/man.rst +++ b/cdist/conf/type/__postfix_reload/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__postfix_reload - Tell postfix to reload its configuration -Steven Armstrong - DESCRIPTION ----------- @@ -33,7 +31,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__postgres_database/man.rst b/cdist/conf/type/__postgres_database/man.rst index 34cd2f03..2a0ad8d0 100644 --- a/cdist/conf/type/__postgres_database/man.rst +++ b/cdist/conf/type/__postgres_database/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__postgres_database - Create/drop postgres databases -Steven Armstrong - DESCRIPTION ----------- @@ -32,8 +30,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__postgres_role(7) `_ +`cdist-type__postgres_role(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__postgres_role/man.rst b/cdist/conf/type/__postgres_role/man.rst index 4b8d291f..9d0b68ab 100644 --- a/cdist/conf/type/__postgres_role/man.rst +++ b/cdist/conf/type/__postgres_role/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__postgres_role - Manage postgres roles -Steven Armstrong - DESCRIPTION ----------- @@ -50,9 +48,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__postgres_database(7) `_ -- http://www.postgresql.org/docs/current/static/sql-createrole.html +`cdist-type__postgres_database(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. +postgresql documentation at: +. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__process/man.rst b/cdist/conf/type/__process/man.rst index 3f17076d..076377e1 100644 --- a/cdist/conf/type/__process/man.rst +++ b/cdist/conf/type/__process/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__process - Start or stop process -Nico Schottelius - DESCRIPTION ----------- @@ -60,8 +58,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__start_on_boot(7) `_ +`cdist-type__start_on_boot(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__pyvenv/man.rst b/cdist/conf/type/__pyvenv/man.rst old mode 100755 new mode 100644 index ff7a922b..f43454a7 --- a/cdist/conf/type/__pyvenv/man.rst +++ b/cdist/conf/type/__pyvenv/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__pyvenv - Create or remove python virtual environment -Darko Poljak - DESCRIPTION ----------- @@ -71,7 +69,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Darko Poljak COPYING diff --git a/cdist/conf/type/__qemu_img/man.rst b/cdist/conf/type/__qemu_img/man.rst index 4492c260..3a137f4b 100644 --- a/cdist/conf/type/__qemu_img/man.rst +++ b/cdist/conf/type/__qemu_img/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__qemu_img - Manage VM disk images -Nico Schottelius - DESCRIPTION ----------- @@ -39,8 +37,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- qemu-img(1) +qemu-img(1) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__rbenv/man.rst b/cdist/conf/type/__rbenv/man.rst index d13f407c..fe965796 100644 --- a/cdist/conf/type/__rbenv/man.rst +++ b/cdist/conf/type/__rbenv/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__rbenv - Manage rbenv installation -Nico Schottelius - DESCRIPTION ----------- @@ -40,7 +38,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__rsync/man.rst b/cdist/conf/type/__rsync/man.rst index afca11d5..bac144c2 100644 --- a/cdist/conf/type/__rsync/man.rst +++ b/cdist/conf/type/__rsync/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__rsync - Mirror directories using rsync -Nico Schottelius - DESCRIPTION ----------- @@ -100,8 +98,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- rsync(1) +rsync(1) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__rvm/man.rst b/cdist/conf/type/__rvm/man.rst index 5aa264e0..bf84328c 100644 --- a/cdist/conf/type/__rvm/man.rst +++ b/cdist/conf/type/__rvm/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__rvm - Install rvm for a given user -Evax Software - DESCRIPTION ----------- @@ -33,10 +31,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__rvm_ruby(7) `_ -- `cdist-type__rvm_gemset(7) `_ -- `cdist-type__rvm_gem(7) `_ +`cdist-type__rvm_gem(7) `_, +`cdist-type__rvm_gemset(7) `_, +`cdist-type__rvm_ruby(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Evax Software COPYING diff --git a/cdist/conf/type/__rvm_gem/man.rst b/cdist/conf/type/__rvm_gem/man.rst index c6011f45..5e65a712 100644 --- a/cdist/conf/type/__rvm_gem/man.rst +++ b/cdist/conf/type/__rvm_gem/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__rvm_gemset - Manage Ruby gems through rvm -Evax Software - DESCRIPTION ----------- @@ -45,10 +43,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__rvm(7) `_ -- `cdist-type__rvm_ruby(7) `_ -- `cdist-type__rvm_gemset(7) `_ +`cdist-type__rvm(7) `_, +`cdist-type__rvm_gemset(7) `_, +`cdist-type__rvm_ruby(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Evax Software COPYING diff --git a/cdist/conf/type/__rvm_gemset/man.rst b/cdist/conf/type/__rvm_gemset/man.rst index 6792b14e..0d04ed94 100644 --- a/cdist/conf/type/__rvm_gemset/man.rst +++ b/cdist/conf/type/__rvm_gemset/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__rvm_gemset - Manage gemsets through rvm -Evax Software - DESCRIPTION ----------- @@ -43,10 +41,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__rvm(7) `_ -- `cdist-type__rvm_ruby(7) `_ -- `cdist-type__rvm_gem(7) `_ +`cdist-type__rvm(7) `_, +`cdist-type__rvm_gem(7) `_, +`cdist-type__rvm_ruby(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Evax Software COPYING diff --git a/cdist/conf/type/__rvm_ruby/man.rst b/cdist/conf/type/__rvm_ruby/man.rst index 235731cd..d2bd4d08 100644 --- a/cdist/conf/type/__rvm_ruby/man.rst +++ b/cdist/conf/type/__rvm_ruby/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__rvm_ruby - Manage ruby installations through rvm -Evax Software - DESCRIPTION ----------- @@ -44,10 +42,17 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__rvm(7) `_ -- `cdist-type__rvm_gemset(7) `_ -- `cdist-type__rvm_gem(7) `_ +`cdist-type__rvm(7) `_, +`cdist-type__rvm_gem(7) `_, +`cdist-type__rvm_gemset(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Evax Software COPYING diff --git a/cdist/conf/type/__ssh_authorized_key/man.rst b/cdist/conf/type/__ssh_authorized_key/man.rst index 767fb1d2..a2f90574 100644 --- a/cdist/conf/type/__ssh_authorized_key/man.rst +++ b/cdist/conf/type/__ssh_authorized_key/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__ssh_authorized_key - Manage a single ssh authorized key entry -Steven Armstrong - DESCRIPTION ----------- @@ -57,9 +55,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist__ssh_authorized_keys(7) `_ -- sshd(8) +`cdist__ssh_authorized_keys(7) `_, +sshd(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + +AUTHORS +------- +Steven Armstrong + COPYING ------- diff --git a/cdist/conf/type/__ssh_authorized_keys/man.rst b/cdist/conf/type/__ssh_authorized_keys/man.rst index 54e294b3..cab844cc 100644 --- a/cdist/conf/type/__ssh_authorized_keys/man.rst +++ b/cdist/conf/type/__ssh_authorized_keys/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__ssh_authorized_keys - Manage ssh authorized_keys files -Steven Armstrong - DESCRIPTION ----------- @@ -107,8 +105,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- sshd(8) +sshd(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__ssh_dot_ssh/man.rst b/cdist/conf/type/__ssh_dot_ssh/man.rst index 12b4c2e7..6d449a4c 100644 --- a/cdist/conf/type/__ssh_dot_ssh/man.rst +++ b/cdist/conf/type/__ssh_dot_ssh/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__ssh_dot_ssh - Manage .ssh directory -Nico Schottelius - DESCRIPTION ----------- @@ -35,8 +33,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__ssh_authorized_keys(7) `_ +`cdist-type__ssh_authorized_keys(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__staged_file/man.rst b/cdist/conf/type/__staged_file/man.rst index aec11707..69ea3678 100644 --- a/cdist/conf/type/__staged_file/man.rst +++ b/cdist/conf/type/__staged_file/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__staged_file - Manage staged files -Steven Armstrong - DESCRIPTION ----------- @@ -101,8 +99,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__file(7) `_ +`cdist-type__file(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__start_on_boot/man.rst b/cdist/conf/type/__start_on_boot/man.rst index 2f07362b..7d009bf0 100644 --- a/cdist/conf/type/__start_on_boot/man.rst +++ b/cdist/conf/type/__start_on_boot/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__start_on_boot - Manage stuff to be started at boot -Nico Schottelius - DESCRIPTION ----------- @@ -47,8 +45,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__process(7) `_ +`cdist-type__process(7) `_ + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__timezone/man.rst b/cdist/conf/type/__timezone/man.rst index 838f4c46..6e18c759 100644 --- a/cdist/conf/type/__timezone/man.rst +++ b/cdist/conf/type/__timezone/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__timezone - Allows one to configure the desired localtime timezone. -Ramon Salvadó - DESCRIPTION ----------- @@ -38,7 +36,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Ramon Salvadó COPYING diff --git a/cdist/conf/type/__update_alternatives/man.rst b/cdist/conf/type/__update_alternatives/man.rst index f321b02f..bcedc1bf 100644 --- a/cdist/conf/type/__update_alternatives/man.rst +++ b/cdist/conf/type/__update_alternatives/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__update_alternatives - Configure alternatives -Nico Schottelius - DESCRIPTION ----------- @@ -32,9 +30,16 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- `cdist-type__debconf_set_selections(7) `_ -- update-alternatives(8) +`cdist-type__debconf_set_selections(7) `_, +update-alternatives(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Nico Schottelius COPYING diff --git a/cdist/conf/type/__user/man.rst b/cdist/conf/type/__user/man.rst index 6a055a4e..0dd91ddd 100644 --- a/cdist/conf/type/__user/man.rst +++ b/cdist/conf/type/__user/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__user - Manage users -Steven Armstrong - DESCRIPTION ----------- @@ -86,8 +84,15 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ -- usermod(8) or pw(8) +pw(8), usermod(8) + +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__user_groups/man.rst b/cdist/conf/type/__user_groups/man.rst index 8857feb1..216a31c8 100644 --- a/cdist/conf/type/__user_groups/man.rst +++ b/cdist/conf/type/__user_groups/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__user_groups - Manage user groups -Steven Armstrong - DESCRIPTION ----------- @@ -43,7 +41,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__yum_repo/man.rst b/cdist/conf/type/__yum_repo/man.rst index 3df9f1b9..b3866739 100644 --- a/cdist/conf/type/__yum_repo/man.rst +++ b/cdist/conf/type/__yum_repo/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__yum_repo - Manage yum repositories -Steven Armstrong - DESCRIPTION ----------- @@ -115,7 +113,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Steven Armstrong COPYING diff --git a/cdist/conf/type/__zypper_repo/man.rst b/cdist/conf/type/__zypper_repo/man.rst index d1b87a5b..bcf376de 100644 --- a/cdist/conf/type/__zypper_repo/man.rst +++ b/cdist/conf/type/__zypper_repo/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__zypper_repo - Repository management with zypper -Daniel Heule - DESCRIPTION ----------- @@ -64,7 +62,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Daniel Heule COPYING diff --git a/cdist/conf/type/__zypper_service/man.rst b/cdist/conf/type/__zypper_service/man.rst index 9d538208..f586742a 100644 --- a/cdist/conf/type/__zypper_service/man.rst +++ b/cdist/conf/type/__zypper_service/man.rst @@ -5,8 +5,6 @@ NAME ---- cdist-type__zypper_service - Service management with zypper -Daniel Heule - DESCRIPTION ----------- @@ -57,7 +55,13 @@ EXAMPLES SEE ALSO -------- -- `cdist-type(7) `_ +Full documentation at: <:cdist_docs:`index`>, +especially cdist type chapter: <:cdist_docs:`cdist-type`>. + + +AUTHORS +------- +Daniel Heule COPYING diff --git a/docs/changelog b/docs/changelog index 33fe54b6..2ffe7a66 100644 --- a/docs/changelog +++ b/docs/changelog @@ -2,6 +2,7 @@ Changelog --------- next: + * Documentation: Restructure and fix and improve docs and manpages (Darko Poljak) * Core: Add files directory for static files (Darko Poljak) * Core: Fix conflicting requirements (Darko Poljak) * Custom: Add bash and zsh completions (Darko Poljak) diff --git a/docs/man/Makefile b/docs/man/Makefile index 6d3ec6dc..2bab13ce 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -9,7 +9,7 @@ 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/) + $(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. diff --git a/docs/man/man7/cdist-best-practice.rst b/docs/man/cdist-best-practice.rst similarity index 90% rename from docs/man/man7/cdist-best-practice.rst rename to docs/man/cdist-best-practice.rst index 7c19c038..57ce5cc1 100644 --- a/docs/man/man7/cdist-best-practice.rst +++ b/docs/man/cdist-best-practice.rst @@ -1,14 +1,8 @@ -cdist-best-practice(7) -====================== +Best practice +============= +Practices used in real environments -NAME ----- -cdist-best-practice - Practices used in real environments - -Nico Schottelius - - -PASSWORDLESS CONNECTIONS +Passwordless connections ------------------------ It is recommended to run cdist with public key authentication. This requires a private/public key pair and the entry @@ -16,7 +10,7 @@ This requires a private/public key pair and the entry See sshd_config(5) and ssh-keygen(1). -SPEEDING UP SSH CONNECTIONS +Speeding up ssh connections --------------------------- When connecting to a new host, the initial delay with ssh connections is pretty big. You can work around this by @@ -30,7 +24,7 @@ inclusion into your ~/.ssh/config:: ControlPersist 10 -SPEEDING UP SHELL EXECUTION +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:: @@ -38,7 +32,7 @@ script execution. Instead, you could use dash after installing it:: ln -sf /bin/dash /bin/sh -MULTI MASTER OR ENVIRONMENT SETUPS +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 @@ -64,7 +58,7 @@ you can clone it multiple times:: machine-b % git clone git://your-git-server/cdist -SEPERATING WORK BY GROUPS +Seperating 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 @@ -77,7 +71,7 @@ their manifests. You can use the following snippet in sh -e "$__manifest/cbrg" -MAINTAINING MULTIPLE CONFIGURATIONS +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. @@ -138,7 +132,7 @@ The following **.git/config** is taken from a a real world scenario:: Have a look at git-remote(1) to adjust the remote configuration, which allows -MULTIPLE DEVELOPERS WITH DIFFERENT TRUST +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 @@ -155,7 +149,7 @@ implement this scenario with a gateway host and sudo: For more details consult sudoers(5) -TEMPLATING +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 @@ -193,7 +187,7 @@ TEMPLATING --source "$__object/files/basic.conf" -TESTING A NEW TYPE +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 @@ -214,7 +208,7 @@ of cdist: cdist --initial-manifest - cdist-dev-01.ungleich.ch -OTHER CONTENT IN CDIST REPOSITORY +Other content in cdist repository --------------------------------- Usually the cdist repository contains all configuration items. Sometimes you may have additional resources that @@ -227,15 +221,3 @@ in the repository for such content: It allows you to easily distinguish what is used by cdist and what not and also to store all important files in one repository. - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-tutorial(7) `_ - - -COPYING -------- -Copyright \(C) 2011-2013 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/man7/cdist-bootstrap.rst b/docs/man/cdist-bootstrap.rst similarity index 86% rename from docs/man/man7/cdist-bootstrap.rst rename to docs/man/cdist-bootstrap.rst index 6a070afa..c9972a99 100644 --- a/docs/man/man7/cdist-bootstrap.rst +++ b/docs/man/cdist-bootstrap.rst @@ -1,21 +1,11 @@ -cdist-bootstrap(7) -================== - -NAME ----- -cdist-bootstrap - Setup cdist environment - -Nico Schottelius - - -INTRODUCTION ------------- +Bootstrap +========= This document describes the usual steps recommended for a new cdist setup. It is recommended that you have read and understood -cdist-quickstart(7) before digging into this. +`cdist quickstart `_ before digging into this. -LOCATION +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 @@ -29,13 +19,13 @@ relies on is recommended, for use as backup as well as to allow easy collaborati with others. For more sophisticated setups developing cdist configurations with multiple -people, have a look at cdist-best-practice(7). +people, have a look at `cdist best practice `_. -SETUP WORKING DIRECTORY AND BRANCH +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(7) if you don't). +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. @@ -85,7 +75,7 @@ In this tutorial I use the branch **mycompany**:: From now on, you can use git as usual to commit your changes in your own branch. -PUBLISHING THE CONFIGURATION +Publishing the configuration ---------------------------- Usually a development machine like a notebook should be considered temporary only. For this reason and to enable shareability, the configuration @@ -114,7 +104,7 @@ 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 +Updating from origin -------------------- Whenever you want to update your cdist installation, you can use git to do so:: @@ -126,15 +116,3 @@ Whenever you want to update your cdist installation, you can use git to do so:: # Alternative: Update current branch with 2.0 branch from origin cdist% git merge origin/2.0 - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-tutorial(7) `_ - - -COPYING -------- -Copyright \(C) 2012 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/man7/cdist-explorer.rst b/docs/man/cdist-explorer.rst similarity index 75% rename from docs/man/man7/cdist-explorer.rst rename to docs/man/cdist-explorer.rst index 66c20d67..4bb61d7a 100644 --- a/docs/man/man7/cdist-explorer.rst +++ b/docs/man/cdist-explorer.rst @@ -1,14 +1,7 @@ -cdist-explorer(7) -================= +Explorer +======== -NAME ----- -cdist-explorer - Explore the target systems - -Nico Schottelius - - -DESCRIPTION +Description ----------- Explorer are small shell scripts, which will be executed on the target host. The aim of the explorer is to give hints to types on how to act on the @@ -39,7 +32,7 @@ error message on stderr, which will cause cdist to abort. You can also use stderr for debugging purposes while developing a new explorer. -EXAMPLES +Examples -------- A very simple explorer may look like this:: @@ -59,16 +52,3 @@ A type explorer, which could check for the status of a package may look like thi # Expect dpkg failing, if package is not known / installed dpkg -s "$name" 2>/dev/null || exit 0 - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-reference(7) `_ -- `cdist-stages(7) `_ - - -COPYING -------- -Copyright \(C) 2010-2014 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/cdist-features.rst b/docs/man/cdist-features.rst new file mode 100644 index 00000000..8a147741 --- /dev/null +++ b/docs/man/cdist-features.rst @@ -0,0 +1,48 @@ +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 seperated + + Sticks completly to the KISS (keep it simple and stupid) paradigma + + 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, familar environment, documentation + Is available as manpages and HTML + +UNIX, simplicity, familar environment + cdist is configured in POSIX shell + diff --git a/docs/man/man7/cdist-hacker.rst b/docs/man/cdist-hacker.rst similarity index 86% rename from docs/man/man7/cdist-hacker.rst rename to docs/man/cdist-hacker.rst index 4e3a21b6..326d83ba 100644 --- a/docs/man/man7/cdist-hacker.rst +++ b/docs/man/cdist-hacker.rst @@ -1,14 +1,7 @@ -cdist-hacker(7) -=============== +Hacking +======= -NAME ----- -cdist-hacker - How to get (stuff) into cdist - -Nico Schottelius - - -WELCOME +Welcome ------- Welcome dear hacker! I invite you to a tour of pointers to get into the usable configuration mangament system, cdist. @@ -19,14 +12,14 @@ twice before merging or implementing a feature: Less features with good usability are far better than the opposite. -REPORTING BUGS +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 github. -CODING CONVENTIONS (EVERYWHERE) +Coding conventions (everywhere) ------------------------------- If something should be better done or needs to fixed, add the word FIXME nearby, so grepping for FIXME gives all positions that need to be fixed. @@ -34,7 +27,7 @@ nearby, so grepping for FIXME gives all positions that need to be fixed. Indention is 4 spaces (welcome to the python world). -HOW TO SUBMIT STUFF FOR INCLUSION INTO UPSTREAM CDIST +How to submit stuff for inclusion into upstream cdist ----------------------------------------------------- If you did some cool changes to cdist, which you value as a benefit for everybody using cdist, you're welcome to propose inclusion into upstream. @@ -61,9 +54,9 @@ for inclusion to the mailinglist **cdist at cdist -- at -- l.schottelius.org** or open a pull request at http://github.com/telmich/cdist. -HOW TO SUBMIT A NEW TYPE +How to submit a new type ------------------------ -For detailled information about types, see cdist-type(7). +For detailled information about types, see `cdist type `_. Submitting a type works as described above, with the additional requirement that a corresponding manpage named man.text in asciidoc format with @@ -77,9 +70,11 @@ code and thus such a type introduces redundant functionality that is given by core cdist already. -EXAMPLE GIT WORKFLOW +Example git workflow --------------------- -The following workflow works fine for most developers:: +The following workflow works fine for most developers + +.. code-block:: sh # get latest upstream master branch git clone https://github.com/telmich/cdist.git @@ -125,6 +120,8 @@ The following workflow works fine for most developers:: 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 @@ -136,6 +133,8 @@ use **git stash** to stash your changes away:: Similar 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 @@ -145,17 +144,3 @@ to the master branch and create another branch based on it:: (you can repeat the code above for as many features as you want to develop in parallel) - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- git(1) -- git-checkout(1) -- git-stash(1) - - -COPYING -------- -Copyright \(C) 2011-2013 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/cdist-install.rst b/docs/man/cdist-install.rst new file mode 100644 index 00000000..7e8bba7a --- /dev/null +++ b/docs/man/cdist-install.rst @@ -0,0 +1,105 @@ +How to install cdist +==================== + +Requirements +------------- + +Source Host +~~~~~~~~~~~ + +This is the machine you use to configure the 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 manpages) + +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://github.com/ungleich/cdist.git + cd cdist + export PATH=$PATH:$(pwd -P)/bin + +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 + +Git mirrors +^^^^^^^^^^^ + +If the main site is down, you can acquire cdist from one of the following sites: + + * git://github.com/telmich/cdist.git `github `_ + * git://git.code.sf.net/p/cdist/code `sourceforge `_ + +Building and using manpages +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you want to build and use the manpages, run: + +.. code-block:: sh + + make man + export MANPATH=$MANPATH:$(pwd -P)/docs/man/_build/man + +Or you can move manpages from docs/man/_build/man directory to some +other directory and add it to MANPATH. + +You can also build manpages for types in your ~/.cdist directory: + +.. code-block:: sh + + make dotman + +Built manpages are now in docs/man/_build/man directory. If you have +some other custom .cdist directory, e.g. /custom/.cdist then use: + +.. code-block:: sh + + DOT_CDIST_PATH=/custom/.cdist make dotman + +Python package +~~~~~~~~~~~~~~ + +Cdist is available as a python package at +`PyPi `_. You can install it using + +.. code-block:: sh + + pip install cdist diff --git a/docs/man/cdist-intro.rst b/docs/man/cdist-intro.rst new file mode 100644 index 00000000..fad40fe5 --- /dev/null +++ b/docs/man/cdist-intro.rst @@ -0,0 +1,15 @@ +cdist - usable configuration management +======================================= + +.. image:: cdist-logo.png + :alt: cdist-logo + +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 + +* `bcfg2 `_ +* `chef `_ +* `cfengine `_ +* `puppet `_. diff --git a/docs/man/cdist-logo.png b/docs/man/cdist-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..13c2792728d20511f18ae60df8524d68b8a35cbf GIT binary patch literal 1542 zcmV+h2Ko7kP)Px#22e~?MF0Q*|NsA`*`M72000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipS@ z0U8oZ%R(#w00o9gL_t(o!|j;OOC(1Wz^mIa(<@6fGKU5*AnRX5Vhb0Zp zl-0j^^}hPms}|z_>pi<{At%Dr`U@U4gF4RoGSKpzdV%|9@IftRZLXV9@rE>N@N!C~ zGe!OUp&qdMyVA_e*UFQ*nQ6FwG6UDY#;;ZQdr1m53*5jARMf$*1#sLK#5utjPU&db zU785>|Q;`jcYt&fW8y13Dv?GjzEFS5zgd^L_8Dcpp*UC7%Q|3g| zeW!0Xc2ln5Rr4S=Vw`9rom{QR%eaLoD99VfwGKs%e!wYXuc>Ro!YNg8JEj$j^K%vMI*!X+fZJ61zup&| z_&2@o@#j2c4Ow58Hv--l{9E;X!t)PThohc&SqQ&#?tli zeQ~q`w_7_Q4-|PvJ%@O73;v3uexPskGwxuUxYYml(wYAUI%ek9r9qEY?};s1j`9Ns zws+2%V_kFL`}_%&3B=6YnssgO7v^UEE^rn<`DuRG-WhWykyiNA+NRs7e#(n=#)dSo zC4b`2WX@hcQKUGP1Q;~i_~10#_Lg>}wnLWcfIX@<+++6!>FOsE(lNYg;o!>kuYLrZ zgn0Pmn(d&{8hK&l4S+j!SA~?-kZ(d{hS{KtRyo7mHqy$s_JuIA?hdVknB7 zLmcRLeo>TXD!t|!#KppS^(U1G?uTqIrW6TN&L%q)1U|fh!8$5_6|fyo5;wJD>?Nn8 z7@(SuyO_)`(2ft;4l8l7-_6;9W~(mlmj~#Vqtq{l($Q`rzu?yO%mX=fdC=B&2+U{e4Ydo2tmeVMoEvfXx48|#$#HqW zTvw#rm^=`@-JY`kV#Va)&A7P1?!T;r((*!4!$HtGcXKPzc`S^6g>{Se%ENDB0rpaV z5LWU)8vnI-KXJt}pCil*k@~kQ_nrqXYSH9EMl)|%efJ-1(-zZu5F_WnM!-h{74^xT z;0|clXTjlN%3T{{fFAO-|Ift!@>@-G2m|qxhyoK=0!BZA|iCn43h9NNJLMXkOv16dzyd&)Y5*|k+R=&8w!jnSNv6LK39 saY9X~U}r+kn~+ - - -DESCRIPTION +Description ----------- Manifests are used to define which objects to create. Objects are instances of **types**, like in object oriented programming languages. @@ -44,15 +37,15 @@ In general, manifests are used to define which types are used depending on given conditions. -INITIAL AND TYPE MANIFESTS +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(7). +from types. More about manifests in types can be found in `cdist type `_. -DEFINE STATE IN THE INITIAL MANIFEST +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. @@ -82,12 +75,12 @@ utilises cdist types. Every available type can be executed like a normal command. -SPLITTING UP THE INITIAL MANIFEST +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(7)). +the directory containing the initial manifest (see `cdist reference `_). The following example would include every file with a **.sh** suffix:: @@ -98,7 +91,7 @@ The following example would include every file with a **.sh** suffix:: done -DEPENDENCIES +Dependencies ------------ If you want to describe that something requires something else, just setup the variable "require" to contain the requirements. Multiple @@ -157,10 +150,10 @@ from the type that is calling them. This is called "autorequirement" in cdist jargon. You can find an more in depth description of the flow execution of manifests -in cdist-stages(7) and of how types work in cdist-type(7). +in `cdist execution stages `_ and of how types work in `cdist type `_. -CREATE DEPENDENCIES FROM EXECUTION ORDER +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. @@ -171,7 +164,7 @@ 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). -OVERRIDES +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. @@ -187,7 +180,7 @@ CDIST_ORDER_DEPENDENCY will be ignored, because adding a dependency in case of overrides would result in circular dependencies, which is an error. -EXAMPLES +Examples -------- The initial manifest may for instance contain the following code: @@ -260,15 +253,3 @@ Dependencies defined by execution order work as following: require="__some_type_somewhere/id __sample_type/1" __sample_type 2 require="__sample_type/2" __example_type 23 __not_in_order_type 42 - - -SEE ALSO --------- -- `cdist-tutorial(7) `_ -- `cdist-type(7) `_ - - -COPYING -------- -Copyright \(C) 2010-2014 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/man7/cdist-messaging.rst b/docs/man/cdist-messaging.rst similarity index 79% rename from docs/man/man7/cdist-messaging.rst rename to docs/man/cdist-messaging.rst index b0d5e3b4..ea35c404 100644 --- a/docs/man/man7/cdist-messaging.rst +++ b/docs/man/cdist-messaging.rst @@ -1,13 +1,7 @@ -cdist-messaging(7) -================== +Messaging +========= -NAME ----- -cdist-messaging - How the initial manifest and types can communication - -Nico Schottelius - -DESCRIPTION +Description ----------- cdist has a simple but powerful way of allowing communication between the initial manifest and types as well as types and types. @@ -27,11 +21,11 @@ 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(7)) and thus you +between the different objects (see `cdist manifest `_) and thus you can only react reliably on messages by objects that you depend on. -AVAILABILITY +Availability ------------ Messaging is possible between all **local** scripts: @@ -41,7 +35,7 @@ Messaging is possible between all **local** scripts: - type/gencode-remote -EXAMPLES +Examples -------- When you want to emit a message use: @@ -98,17 +92,3 @@ Restart sshd on changes if grep -q "^__key_value/PermitRootLogin" "$__messages_in"; then echo $restart fi - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-manifest(7) `_ -- `cdist-reference(7) `_ -- `cdist-type(7) `_ - - -COPYING -------- -Copyright \(C) 2013 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/cdist-os.rst b/docs/man/cdist-os.rst new file mode 100644 index 00000000..4f6b4820 --- /dev/null +++ b/docs/man/cdist-os.rst @@ -0,0 +1,16 @@ +Supported Operating Systems +=========================== + +cdist was tested or is know to run on at least + +* `Archlinux `_ +* `Debian `_ +* `CentOS `_ +* `Fedora `_ +* `FreeBSD `_ +* `Gentoo `_ +* `Mac OS X `_ +* `OpenBSD `_ +* `Redhat `_ +* `Ubuntu `_ +* `XenServer `_ diff --git a/docs/man/man7/cdist-quickstart.rst b/docs/man/cdist-quickstart.rst similarity index 82% rename from docs/man/man7/cdist-quickstart.rst rename to docs/man/cdist-quickstart.rst index fd7d2cde..20c33cb8 100644 --- a/docs/man/man7/cdist-quickstart.rst +++ b/docs/man/cdist-quickstart.rst @@ -1,31 +1,18 @@ -cdist-quickstart(7) -=================== +Quickstart +========== -NAME ----- -cdist-quickstart - Jump in and enjoy cdist - -Nico Schottelius - - -INTRODUCTION ------------- 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. -This tutorial assumes you are configuring **localhost**, because -it is always available. Just replace **localhost** with your target -host for real life usage. - - - -QUICK START - GET YOUR HANDS DIRTY NOW --------------------------------------- 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** @@ -84,15 +71,3 @@ code into your shell to get started and configure localhost:: 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. - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-tutorial(7) `_ - - -COPYING -------- -Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/cdist-reference.rst.sh b/docs/man/cdist-reference.rst.sh index 687394d2..42eced05 100755 --- a/docs/man/cdist-reference.rst.sh +++ b/docs/man/cdist-reference.rst.sh @@ -29,23 +29,17 @@ __cdist_myname=${0##*/}; __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" filename="${__cdist_myname%.sh}" -dest="$__cdist_abs_mydir/man7/$filename" +dest="$__cdist_abs_mydir/$filename" cd "$__cdist_abs_mydir" exec > "$dest" cat << eof -cdist-reference(7) -================== +Reference +========= +Variable, path and type reference for cdist -NAME ----- -cdist-reference - Variable, path and type reference for cdist - -Nico Schottelius - - -EXPLORERS +Explorers --------- The following global explorers are available: @@ -59,7 +53,7 @@ eof cat << eof -PATHS +Paths ----- \$HOME/.cdist The standard cdist configuration directory relative to your home directory @@ -76,10 +70,6 @@ confdir 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 @@ -94,11 +84,11 @@ confdir/manifest/* maintain different groups of hosts. confdir/explorer/ - Contains explorers to be run on the target hosts, see cdist-explorer(7). + 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(7). + some kind of functionality. See \`cdist type \`_. confdir/type// Home of the type . @@ -133,7 +123,7 @@ confdir/type//parameter/boolean confdir/type//explorer Location of the type specific explorers. This directory is referenced by the variable __type_explorer (see below). - See cdist-explorer(7). + See \`cdist explorer \`_. confdir/type//files This directory is reserved for user data and will not be used @@ -158,27 +148,28 @@ out/object/ out/object//explorers Output of type specific explorers, per object. -TYPES +Types ----- The following types are available: eof -for type in $(ls man7/cdist-type__*.rst | LC_ALL=C sort); do +# 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}"; - name_no_underline="$(echo $name | sed 's/^__/\\__/g')" manref="${no_dir%.rst}" man="${manref}(7)" - echo "- $name_no_underline" "(\`${man} <${manref}.html>\`_)" + echo "- $name" "(\`${man} \`_)" done cat << eof -OBJECTS +Objects ------- For object to object communication and tests, the following paths are usable within a object directory: @@ -195,17 +186,13 @@ stdin when the type was called. -ENVIRONMENT VARIABLES (FOR READING) +Environment variables (for reading) ----------------------------------- The following environment variables are exported by cdist: __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 @@ -240,12 +227,12 @@ __type_explorer Directory that contains the type explorers. Available for: type explorer -ENVIRONMENT VARIABLES (FOR WRITING) +Environment variables (for writing) ----------------------------------- The following environment variables influence the behaviour of cdist: require - Setup dependencies between objects (see cdist-manifest(7)) + Setup dependencies between objects (see \`cdist manifest \`_) CDIST_LOCAL_SHELL Use this shell locally instead of /bin/sh to execute scripts @@ -254,24 +241,14 @@ CDIST_REMOTE_SHELL Use this shell remotely instead of /bin/sh to execute scripts CDIST_OVERRIDE - Allow overwriting type parameters (see cdist-manifest(7)) + Allow overwriting type parameters (see \`cdist manifest \`_) CDIST_ORDER_DEPENDENCY - Create dependencies based on the execution order (see cdist-manifest(7)) + Create dependencies based on the execution order (see \`cdist manifest \`_) 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) - -SEE ALSO --------- -- \`cdist(1) <../man1/cdist.html>\`_ - - -COPYING -------- -Copyright \(C) 2011-2014 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). eof diff --git a/docs/man/man7/cdist-remote-exec-copy.rst b/docs/man/cdist-remote-exec-copy.rst similarity index 61% rename from docs/man/man7/cdist-remote-exec-copy.rst rename to docs/man/cdist-remote-exec-copy.rst index b8d54f8f..10a370c7 100644 --- a/docs/man/man7/cdist-remote-exec-copy.rst +++ b/docs/man/cdist-remote-exec-copy.rst @@ -1,15 +1,6 @@ -cdist-remote-exec-copy(7) -========================= +Remote exec and copy commands +============================= -NAME ----- -cdist-remote-exec-copy - How to use remote exec and copy - -Nico Schottelius - - -INTRO ------ Cdist interacts with the target host in two ways: - it executes code (__remote_exec) @@ -30,19 +21,3 @@ For __remote_copy, it must behave like scp. 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. - - -EXAMPLES --------- -See cdist/other/examples/remote/ for some example implementations. - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ - - -COPYING -------- -Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/man7/cdist-stages.rst b/docs/man/cdist-stages.rst similarity index 77% rename from docs/man/man7/cdist-stages.rst rename to docs/man/cdist-stages.rst index b58bb368..fd19ce0d 100644 --- a/docs/man/man7/cdist-stages.rst +++ b/docs/man/cdist-stages.rst @@ -1,19 +1,13 @@ -cdist-stages(7) -=============== +Execution stages +================ -NAME ----- -cdist-stages - Stages used during configuration deployment - -Nico Schottelius - -DESCRIPTION +Description ----------- Starting the execution of deployment with cdist, cdist passes through different stages. -STAGE 1: TARGET INFORMATION RETRIEVAL +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 @@ -21,7 +15,7 @@ explorers are copied back into the local cache. The results can be used by manifests and types. -STAGE 2: RUN THE INITIAL MANIFEST +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 @@ -30,7 +24,7 @@ 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 +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 @@ -38,7 +32,7 @@ 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 +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, @@ -52,7 +46,7 @@ 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 +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 @@ -60,30 +54,18 @@ target on stdout. If the gencode executables fail, they must print diagnostic messages on stderr and exit non-zero. -STAGE 6: CODE EXECUTION +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 +Stage 7: cache -------------- The cache stores the information from the current run for later use. -SUMMARY +Summary ------- If, and only if, all the stages complete without an errors, the configuration will be applied to the target. - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-reference(7) `_ - - -COPYING -------- -Copyright \(C) 2010-2012 Nico Schottelius, Steven Armstrong. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/cdist-support.rst b/docs/man/cdist-support.rst new file mode 100644 index 00000000..2343500e --- /dev/null +++ b/docs/man/cdist-support.rst @@ -0,0 +1,28 @@ +Support +------- + +IRC +~~~ + +You can join the development ***IRC channel*** +`#cstar on irc.freenode.net `_. + +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 +`my company `_. diff --git a/docs/man/man7/cdist-troubleshooting.rst b/docs/man/cdist-troubleshooting.rst similarity index 73% rename from docs/man/man7/cdist-troubleshooting.rst rename to docs/man/cdist-troubleshooting.rst index edfadc34..b016e845 100644 --- a/docs/man/man7/cdist-troubleshooting.rst +++ b/docs/man/cdist-troubleshooting.rst @@ -1,14 +1,7 @@ -cdist-troubleshooting(7) -======================== +Troubleshooting +=============== -NAME ----- -cdist-troubleshooting - Common problems and their solutions - -Nico Schottelius - - -ERROR IN MANIFEST IS NOT CONSIDERED AN ERROR BY CDIST +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. @@ -50,15 +43,3 @@ you write to use the -e flag: % cat ~/.cdist/manifest/special #!/bin/sh -e ... - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-tutorial(7) `_ - - -COPYING -------- -Copyright \(C) 2013 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/man7/cdist-type.rst b/docs/man/cdist-type.rst similarity index 88% rename from docs/man/man7/cdist-type.rst rename to docs/man/cdist-type.rst index 5500d9b3..c75d0a52 100644 --- a/docs/man/man7/cdist-type.rst +++ b/docs/man/cdist-type.rst @@ -1,31 +1,24 @@ -cdist-type(7) -============= +cdist type +========== -NAME ----- -cdist-type - Functionality bundled - -Nico Schottelius - - -SYNOPSIS --------- - -:: - - __TYPE ID --parameter value [--parameter value ...] - __TYPE --parameter value [--parameter value ...] (for singletons) - - -DESCRIPTION +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 +-------- -HOW TO USE A TYPE +.. 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: @@ -37,10 +30,10 @@ normal shell command: # Ensure tree is installed __package tree --state installed -A list of supported types can be found in the cdist-reference(7) manpage. +A list of supported types can be found in the `cdist reference `_ manpage. -SINGLETON TYPES +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 @@ -58,7 +51,7 @@ Example: __myfancysingleton --colour green -HOW TO WRITE A NEW TYPE +How to write a new type ----------------------- A type consists of @@ -74,7 +67,7 @@ two underscores (__) to prevent collisions with other executables in $PATH. To implement a new type, create the directory **cdist/conf/type/__NAME**. -DEFINING PARAMETERS +Defining parameters ------------------- Every type consists of required, optional and boolean parameters, which must each be declared in a newline separated file in **parameter/required**, @@ -102,7 +95,7 @@ Example: echo use_ssl >> cdist/conf/type/__nginx_vhost/parameter/boolean -USING PARAMETERS +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 @@ -138,7 +131,7 @@ Example: (e.g. in cdist/conf/type/__nginx_vhost/manifest) fi -INPUT FROM STDIN +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. @@ -168,7 +161,7 @@ In the __file type, stdin is used as source for the file, if - is used for sourc .... -WRITING THE MANIFEST +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 @@ -190,13 +183,13 @@ a shortened version looks like this: __package_$type "$@" As you can see, the type can reference different environment variables, -which are documented in cdist-reference(7). +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(7). +to execute it. For more information about manifests see `cdist manifest `_. -SINGLETON - ONE INSTANCE ONLY +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 @@ -216,7 +209,7 @@ As you can see, the object ID is omitted, because it does not make any sense, if your type can be used only once. -THE TYPE EXPLORERS +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. @@ -238,7 +231,7 @@ client, like this (shortened version from the type __file): fi -WRITING THE GENCODE SCRIPT +Writing the gencode script -------------------------- There are two gencode scripts: **gencode-local** and **gencode-remote**. The output of gencode-local is executed locally, whereas @@ -259,7 +252,7 @@ script, you can write to stderr: echo "touch /etc/cdist-configured" -VARIABLE ACCESS FROM THE GENERATED SCRIPTS +Variable access from the generated scripts ------------------------------------------ In the generated scripts, you have access to the following cdist variables @@ -280,7 +273,7 @@ So when you generate a script with the following content, it will work: fi -HINTS FOR TYPEWRITERS +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 @@ -297,21 +290,8 @@ 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 +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-hacker(7) on +current master branch of cdist and have a look at `cdist hacking `_ on how to submit it. - -SEE ALSO --------- -- `cdist-explorer(7) `_ -- `cdist-hacker(7) `_ -- `cdist-stages(7) `_ -- `cdist-tutorial(7) `_ - - -COPYING -------- -Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/docs/man/cdist-types.rst b/docs/man/cdist-types.rst new file mode 100644 index 00000000..d5104667 --- /dev/null +++ b/docs/man/cdist-types.rst @@ -0,0 +1,8 @@ +cdist types +=========== + +.. toctree:: + :titlesonly: + :glob: + + man7/* diff --git a/docs/man/cdist-update.rst b/docs/man/cdist-update.rst new file mode 100644 index 00000000..0b445ba4 --- /dev/null +++ b/docs/man/cdist-update.rst @@ -0,0 +1,188 @@ +How to update 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 incompatiblities. + +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 incompatiblities. + +Updating from 1.2 to 1.3 +~~~~~~~~~~~~~~~~~~~~~~~~ + +Rename **gencode** of every type to **gencode-remote**. + +Updating from 1.1 to 1.2 +~~~~~~~~~~~~~~~~~~~~~~~~ + +No incompatiblities. + +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 diff --git a/docs/man/cdist-why.rst b/docs/man/cdist-why.rst new file mode 100644 index 00000000..e6aefefd --- /dev/null +++ b/docs/man/cdist-why.rst @@ -0,0 +1,72 @@ +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 litte on a target system. Even better, +in almost all cases all dependencies are usually fulfilled. +Cdist does not require an agent or a 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 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. diff --git a/docs/man/conf.py b/docs/man/conf.py index ed43d6d4..24a040b2 100644 --- a/docs/man/conf.py +++ b/docs/man/conf.py @@ -32,6 +32,7 @@ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.realpath # ones. extensions = [ 'cdist.sphinxext.manpage', + 'sphinx.ext.extlinks', ] # Add any paths that contain templates here, relative to this directory. @@ -309,3 +310,9 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False + +extlinks = { + 'cdist_docs': + ('http://www.nico.schottelius.org/software/cdist/man/{}/%s.html'.format( + release), None), +} diff --git a/docs/man/index.rst b/docs/man/index.rst index f0638779..a34231f8 100644 --- a/docs/man/index.rst +++ b/docs/man/index.rst @@ -4,9 +4,28 @@ Welcome to cdist documentation Contents: .. toctree:: - :titlesonly: + :maxdepth: 2 :glob: :numbered: - man1/* - man7/* + cdist-intro + cdist-why + cdist-os + cdist-install + cdist-update + cdist-support + cdist-features + cdist-quickstart + man1/cdist + cdist-bootstrap + cdist-manifest + cdist-type + cdist-types + cdist-explorer + cdist-messaging + cdist-reference + cdist-best-practice + cdist-stages + cdist-remote-exec-copy + cdist-hacker + cdist-troubleshooting diff --git a/docs/man/man1/cdist.rst b/docs/man/man1/cdist.rst index f2b4c5d4..2a056482 100644 --- a/docs/man/man1/cdist.rst +++ b/docs/man/man1/cdist.rst @@ -5,8 +5,6 @@ NAME ---- cdist - Usable Configuration Management -Nico Schottelius - SYNOPSIS -------- @@ -179,9 +177,11 @@ The following exit values shall be returned: SEE ALSO -------- -- `cdist-type(7) <../man7/cdist-type.html>`_ -- `cdist-reference(7) <../man7/cdist-reference.html>`_ +Full documentation at: <:cdist_docs:`index`>. +AUTHORS +------- +Nico Schottelius COPYING ------- diff --git a/docs/man/man7/cdist-tutorial.rst b/docs/man/man7/cdist-tutorial.rst deleted file mode 100644 index fece6f36..00000000 --- a/docs/man/man7/cdist-tutorial.rst +++ /dev/null @@ -1,58 +0,0 @@ -cdist-tutorial(7) -================= - -NAME ----- -cdist-tutorial - A guided introduction into cdist - -Nico Schottelius - - -INTRODUCTION ------------- -This document gives you a pointer on what to read in -which order and is thus a "guide to the right locations". -So in case you are just starting, just "begin at the beginning" -(Brave New World). You can see the target audience in [] brackets -after the description. - -cdist-quickstart - New to cdist? Want to get your hands dirty? Read this. [beginner] - -cdist-bootstrap - The comprehensive guide to your first cdist installation [beginner] - -cdist-manifest - Learn how to define which hosts get which configurations [beginner] - -cdist-type - Understand how types are working and created [intermediate] - -cdist-best-practice - Hints from real life experience to help you to organise cdist [intermediate] - -cdist-reference - The type, explorers and environment variables reference [intermediate] - -cdist-explorer - Interested in getting more information about the target system? [intermediate] - -cdist-stages - Understand the internal workflow of cdist. [advanced] - -cdist-hacker - README, if you want to extend or modify cdist. [hacker] - - -SEE ALSO --------- -- `cdist(1) <../man1/cdist.html>`_ -- `cdist-type(7) `_ -- `cdist-best-practice(7) `_ -- `cdist-stages(7) `_ -- Brave New World by Aldous Huxley - -COPYING -------- -Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). From f2ccb00f3ba22a9c39beca9d12159a0072d70e8f Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 29 Jun 2016 09:12:40 +0200 Subject: [PATCH 28/42] Fix sphinx warning about html_static_path. --- docs/man/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/man/conf.py b/docs/man/conf.py index 24a040b2..916b06a4 100644 --- a/docs/man/conf.py +++ b/docs/man/conf.py @@ -144,7 +144,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # 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 From b4c77a6ef660511d4d2def5b946a9b218869e596 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 29 Jun 2016 09:13:33 +0200 Subject: [PATCH 29/42] Fix empty man7 dir - Makefile fails. --- docs/man/man7/.gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/man/man7/.gitignore diff --git a/docs/man/man7/.gitignore b/docs/man/man7/.gitignore new file mode 100644 index 00000000..e69de29b From 7f5f09830a017c85fbcedaca849c834523c125cf Mon Sep 17 00:00:00 2001 From: Stephan Leemburg Date: Wed, 29 Jun 2016 13:31:23 +0200 Subject: [PATCH 30/42] added changes to next: --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index 33fe54b6..3be460b4 100644 --- a/docs/changelog +++ b/docs/changelog @@ -9,6 +9,9 @@ next: * 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 4.1.0: 2016-05-27 * Documentation: Migrate to reStructuredText format and sphinx (Darko Poljak) From f98208f250085e7b683d0c7a82ea4ac2e3fbc11b Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 30 Jun 2016 12:09:07 +0200 Subject: [PATCH 31/42] Make man pages SEE ALSO by convention. Improve docs building. --- .gitignore | 3 ++- cdist/conf/type/__apt_key/man.rst | 6 ------ cdist/conf/type/__apt_key_uri/man.rst | 6 ------ cdist/conf/type/__apt_norecommends/man.rst | 6 ------ cdist/conf/type/__apt_ppa/man.rst | 6 ------ cdist/conf/type/__apt_source/man.rst | 6 ------ cdist/conf/type/__apt_update_index/man.rst | 6 ------ cdist/conf/type/__block/man.rst | 6 ------ cdist/conf/type/__ccollect_source/man.rst | 7 +------ cdist/conf/type/__cdist/man.rst | 6 ------ cdist/conf/type/__cdistmarker/man.rst | 6 ------ cdist/conf/type/__config_file/man.rst | 5 +---- cdist/conf/type/__consul/man.rst | 6 ------ cdist/conf/type/__consul_agent/man.rst | 5 +---- cdist/conf/type/__consul_check/man.rst | 5 +---- cdist/conf/type/__consul_reload/man.rst | 6 ------ cdist/conf/type/__consul_service/man.rst | 5 +---- cdist/conf/type/__consul_template/man.rst | 5 +---- .../type/__consul_template_template/man.rst | 6 +----- cdist/conf/type/__consul_watch_checks/man.rst | 7 ++----- cdist/conf/type/__consul_watch_event/man.rst | 7 ++----- cdist/conf/type/__consul_watch_key/man.rst | 7 ++----- .../type/__consul_watch_keyprefix/man.rst | 6 ++---- cdist/conf/type/__consul_watch_nodes/man.rst | 7 ++----- .../conf/type/__consul_watch_service/man.rst | 6 ++---- .../conf/type/__consul_watch_services/man.rst | 7 ++----- cdist/conf/type/__cron/man.rst | 5 +---- .../type/__debconf_set_selections/man.rst | 6 +----- cdist/conf/type/__directory/man.rst | 6 ------ cdist/conf/type/__dog_vdi/man.rst | 5 +---- cdist/conf/type/__file/man.rst | 6 ------ cdist/conf/type/__firewalld_rule/man.rst | 6 +----- cdist/conf/type/__git/man.rst | 6 ------ cdist/conf/type/__group/man.rst | 6 ------ cdist/conf/type/__hostname/man.rst | 6 ------ cdist/conf/type/__iptables_apply/man.rst | 6 +----- cdist/conf/type/__iptables_rule/man.rst | 6 +----- cdist/conf/type/__issue/man.rst | 6 ------ cdist/conf/type/__jail/man.rst | 3 +-- cdist/conf/type/__jail_freebsd10/man.rst | 3 +-- cdist/conf/type/__jail_freebsd9/man.rst | 3 +-- cdist/conf/type/__key_value/man.rst | 6 ------ cdist/conf/type/__line/man.rst | 5 +---- cdist/conf/type/__link/man.rst | 6 ------ cdist/conf/type/__locale/man.rst | 5 +---- cdist/conf/type/__motd/man.rst | 6 ------ cdist/conf/type/__mount/man.rst | 6 ------ cdist/conf/type/__mysql_database/man.rst | 6 ------ cdist/conf/type/__package/man.rst | 6 ------ cdist/conf/type/__package_apt/man.rst | 5 +---- cdist/conf/type/__package_emerge/man.rst | 6 +----- .../__package_emerge_dependencies/man.rst | 6 +----- cdist/conf/type/__package_luarocks/man.rst | 5 +---- cdist/conf/type/__package_opkg/man.rst | 5 +---- cdist/conf/type/__package_pacman/man.rst | 5 +---- cdist/conf/type/__package_pip/man.rst | 5 +---- cdist/conf/type/__package_pkg_freebsd/man.rst | 5 +---- cdist/conf/type/__package_pkg_openbsd/man.rst | 5 +---- .../conf/type/__package_pkgng_freebsd/man.rst | 5 +---- cdist/conf/type/__package_rubygem/man.rst | 5 +---- .../conf/type/__package_update_index/man.rst | 6 ------ cdist/conf/type/__package_upgrade_all/man.rst | 6 ------ cdist/conf/type/__package_yum/man.rst | 5 +---- cdist/conf/type/__package_zypper/man.rst | 5 +---- cdist/conf/type/__pacman_conf/man.rst | 5 +---- .../conf/type/__pacman_conf_integrate/man.rst | 5 +---- cdist/conf/type/__pf_apply/man.rst | 6 +----- cdist/conf/type/__pf_ruleset/man.rst | 5 +---- cdist/conf/type/__postfix/man.rst | 6 ------ cdist/conf/type/__postfix_master/man.rst | 5 +---- cdist/conf/type/__postfix_postconf/man.rst | 5 +---- cdist/conf/type/__postfix_postmap/man.rst | 6 ------ cdist/conf/type/__postfix_reload/man.rst | 6 ------ cdist/conf/type/__postgres_database/man.rst | 5 +---- cdist/conf/type/__postgres_role/man.rst | 4 +--- cdist/conf/type/__process/man.rst | 5 +---- cdist/conf/type/__pyvenv/man.rst | 6 ------ cdist/conf/type/__qemu_img/man.rst | 5 +---- cdist/conf/type/__rbenv/man.rst | 6 ------ cdist/conf/type/__rsync/man.rst | 5 +---- cdist/conf/type/__rvm/man.rst | 8 ++----- cdist/conf/type/__rvm_gem/man.rst | 8 ++----- cdist/conf/type/__rvm_gemset/man.rst | 8 ++----- cdist/conf/type/__rvm_ruby/man.rst | 8 ++----- cdist/conf/type/__ssh_authorized_key/man.rst | 5 +---- cdist/conf/type/__ssh_authorized_keys/man.rst | 5 +---- cdist/conf/type/__ssh_dot_ssh/man.rst | 5 +---- cdist/conf/type/__staged_file/man.rst | 5 +---- cdist/conf/type/__start_on_boot/man.rst | 5 +---- cdist/conf/type/__timezone/man.rst | 6 ------ cdist/conf/type/__update_alternatives/man.rst | 6 +----- cdist/conf/type/__user/man.rst | 5 +---- cdist/conf/type/__user_groups/man.rst | 6 ------ cdist/conf/type/__yum_repo/man.rst | 6 ------ cdist/conf/type/__zypper_repo/man.rst | 6 ------ cdist/conf/type/__zypper_service/man.rst | 6 ------ docs/man/Makefile | 7 +++++-- docs/man/cdist-install.rst | 21 ++++++++++++++----- docs/man/conf.py | 6 ------ docs/man/man1/cdist.rst | 4 ---- 100 files changed, 94 insertions(+), 485 deletions(-) diff --git a/.gitignore b/.gitignore index 6152451b..3bbc4e99 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,9 @@ MANIFEST dist/ cdist/version.py -#sphinx build dir +# sphinx build dirs, cache _build/ +docs/dist # Packaging: Archlinux /PKGBUILD diff --git a/cdist/conf/type/__apt_key/man.rst b/cdist/conf/type/__apt_key/man.rst index 01d4eea4..488a1a06 100644 --- a/cdist/conf/type/__apt_key/man.rst +++ b/cdist/conf/type/__apt_key/man.rst @@ -48,12 +48,6 @@ EXAMPLES __apt_key UbuntuArchiveKey --keyid 437D05B5 --keyserver keyserver.ubuntu.com -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__apt_key_uri/man.rst b/cdist/conf/type/__apt_key_uri/man.rst index 9c0042bb..e8741dff 100644 --- a/cdist/conf/type/__apt_key_uri/man.rst +++ b/cdist/conf/type/__apt_key_uri/man.rst @@ -38,12 +38,6 @@ EXAMPLES --state present -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__apt_norecommends/man.rst b/cdist/conf/type/__apt_norecommends/man.rst index 0198d7bd..7ef496c3 100644 --- a/cdist/conf/type/__apt_norecommends/man.rst +++ b/cdist/conf/type/__apt_norecommends/man.rst @@ -29,12 +29,6 @@ EXAMPLES __apt_norecommends -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__apt_ppa/man.rst b/cdist/conf/type/__apt_ppa/man.rst index e91e82fe..978e1252 100644 --- a/cdist/conf/type/__apt_ppa/man.rst +++ b/cdist/conf/type/__apt_ppa/man.rst @@ -37,12 +37,6 @@ EXAMPLES __apt_ppa ppa:sans-intern/missing-bits --state absent -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__apt_source/man.rst b/cdist/conf/type/__apt_source/man.rst index e4916515..31f2e9e6 100644 --- a/cdist/conf/type/__apt_source/man.rst +++ b/cdist/conf/type/__apt_source/man.rst @@ -56,12 +56,6 @@ EXAMPLES --component partner --state present -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__apt_update_index/man.rst b/cdist/conf/type/__apt_update_index/man.rst index e0672620..326d4c2f 100644 --- a/cdist/conf/type/__apt_update_index/man.rst +++ b/cdist/conf/type/__apt_update_index/man.rst @@ -28,12 +28,6 @@ EXAMPLES __apt_update_index -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__block/man.rst b/cdist/conf/type/__block/man.rst index 3b7c3439..6d7b8ba1 100644 --- a/cdist/conf/type/__block/man.rst +++ b/cdist/conf/type/__block/man.rst @@ -69,12 +69,6 @@ EXAMPLES DONE -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__ccollect_source/man.rst b/cdist/conf/type/__ccollect_source/man.rst index 5d980bda..cdacd31c 100644 --- a/cdist/conf/type/__ccollect_source/man.rst +++ b/cdist/conf/type/__ccollect_source/man.rst @@ -53,12 +53,7 @@ EXAMPLES SEE ALSO -------- -ccollect(1) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -ccollect documentation at: -. +:manpage:`ccollect`\ (1) AUTHORS diff --git a/cdist/conf/type/__cdist/man.rst b/cdist/conf/type/__cdist/man.rst index ad544c5c..1bfb35c5 100644 --- a/cdist/conf/type/__cdist/man.rst +++ b/cdist/conf/type/__cdist/man.rst @@ -50,12 +50,6 @@ EXAMPLES __cdist --source "git://git.schottelius.org/cdist" /home/cdist/cdist -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__cdistmarker/man.rst b/cdist/conf/type/__cdistmarker/man.rst index 156aed62..cb4dace8 100644 --- a/cdist/conf/type/__cdistmarker/man.rst +++ b/cdist/conf/type/__cdistmarker/man.rst @@ -42,12 +42,6 @@ EXAMPLES __cdistmarker --destination /tmp/cdist_marker --format '+%s' -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Daniel Maher diff --git a/cdist/conf/type/__config_file/man.rst b/cdist/conf/type/__config_file/man.rst index acb3c848..b9d58979 100644 --- a/cdist/conf/type/__config_file/man.rst +++ b/cdist/conf/type/__config_file/man.rst @@ -48,10 +48,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__file(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__file`\ (7) AUTHORS diff --git a/cdist/conf/type/__consul/man.rst b/cdist/conf/type/__consul/man.rst index 4096a233..c15ded45 100644 --- a/cdist/conf/type/__consul/man.rst +++ b/cdist/conf/type/__consul/man.rst @@ -41,12 +41,6 @@ EXAMPLES --version 0.4.1 -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__consul_agent/man.rst b/cdist/conf/type/__consul_agent/man.rst index 7a15a058..5a35a2cc 100644 --- a/cdist/conf/type/__consul_agent/man.rst +++ b/cdist/conf/type/__consul_agent/man.rst @@ -165,10 +165,7 @@ EXAMPLES SEE ALSO -------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consul documentation at: -. +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_check/man.rst b/cdist/conf/type/__consul_check/man.rst index 87e2d7a9..c0d0b459 100644 --- a/cdist/conf/type/__consul_check/man.rst +++ b/cdist/conf/type/__consul_check/man.rst @@ -62,10 +62,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__consul_agent`\ (7) AUTHORS diff --git a/cdist/conf/type/__consul_reload/man.rst b/cdist/conf/type/__consul_reload/man.rst index 62b08c7f..410bd5e6 100644 --- a/cdist/conf/type/__consul_reload/man.rst +++ b/cdist/conf/type/__consul_reload/man.rst @@ -29,12 +29,6 @@ EXAMPLES __consul_reload -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__consul_service/man.rst b/cdist/conf/type/__consul_service/man.rst index 560266a4..75b06aa0 100644 --- a/cdist/conf/type/__consul_service/man.rst +++ b/cdist/conf/type/__consul_service/man.rst @@ -66,10 +66,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__consul_agent`\ (7) AUTHORS diff --git a/cdist/conf/type/__consul_template/man.rst b/cdist/conf/type/__consul_template/man.rst index d2d484e5..a6228cad 100644 --- a/cdist/conf/type/__consul_template/man.rst +++ b/cdist/conf/type/__consul_template/man.rst @@ -125,10 +125,7 @@ EXAMPLES SEE ALSO -------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consul documentation at: -. +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_template_template/man.rst b/cdist/conf/type/__consul_template_template/man.rst index 9932346b..b54f759e 100644 --- a/cdist/conf/type/__consul_template_template/man.rst +++ b/cdist/conf/type/__consul_template_template/man.rst @@ -59,11 +59,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_template(7) `_, -`cdist-type__consul_template_config(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__consul_template`\ (7), :manpage:`cdist-type__consul_template_config`\ (7) AUTHORS diff --git a/cdist/conf/type/__consul_watch_checks/man.rst b/cdist/conf/type/__consul_watch_checks/man.rst index dc3c9669..ec04b0b3 100644 --- a/cdist/conf/type/__consul_watch_checks/man.rst +++ b/cdist/conf/type/__consul_watch_checks/man.rst @@ -55,12 +55,9 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ +:manpage:`cdist-type__consul_agent`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consul documentation at: -. +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_watch_event/man.rst b/cdist/conf/type/__consul_watch_event/man.rst index 73b16754..664a19a2 100644 --- a/cdist/conf/type/__consul_watch_event/man.rst +++ b/cdist/conf/type/__consul_watch_event/man.rst @@ -48,12 +48,9 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ +:manpage:`cdist-type__consul_agent`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consul documentation at: -. +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_watch_key/man.rst b/cdist/conf/type/__consul_watch_key/man.rst index c258119c..0f90245c 100644 --- a/cdist/conf/type/__consul_watch_key/man.rst +++ b/cdist/conf/type/__consul_watch_key/man.rst @@ -45,12 +45,9 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ +:manpage:`cdist-type__consul_agent`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consul documentation at: -. +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_watch_keyprefix/man.rst b/cdist/conf/type/__consul_watch_keyprefix/man.rst index 950c0a26..65fa16af 100644 --- a/cdist/conf/type/__consul_watch_keyprefix/man.rst +++ b/cdist/conf/type/__consul_watch_keyprefix/man.rst @@ -45,11 +45,9 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ +:manpage:`cdist-type__consul_agent`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consule documentation at: . +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_watch_nodes/man.rst b/cdist/conf/type/__consul_watch_nodes/man.rst index a44dada4..5a5bdbd2 100644 --- a/cdist/conf/type/__consul_watch_nodes/man.rst +++ b/cdist/conf/type/__consul_watch_nodes/man.rst @@ -41,12 +41,9 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ +:manpage:`cdist-type__consul_agent`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consul documentation at: -. +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_watch_service/man.rst b/cdist/conf/type/__consul_watch_service/man.rst index fa6450fe..38ee501a 100644 --- a/cdist/conf/type/__consul_watch_service/man.rst +++ b/cdist/conf/type/__consul_watch_service/man.rst @@ -65,11 +65,9 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ +:manpage:`cdist-type__consul_agent`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consule documentation at: . +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__consul_watch_services/man.rst b/cdist/conf/type/__consul_watch_services/man.rst index db561593..41b115ae 100644 --- a/cdist/conf/type/__consul_watch_services/man.rst +++ b/cdist/conf/type/__consul_watch_services/man.rst @@ -41,12 +41,9 @@ EXAMPLES SEE ALSO -------- -`cdist-type__consul_agent(7) `_ +:manpage:`cdist-type__consul_agent`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. -consul documentation at: -. +consul documentation at: . AUTHORS diff --git a/cdist/conf/type/__cron/man.rst b/cdist/conf/type/__cron/man.rst index e8f32c52..4b9cb83d 100644 --- a/cdist/conf/type/__cron/man.rst +++ b/cdist/conf/type/__cron/man.rst @@ -68,10 +68,7 @@ EXAMPLES SEE ALSO -------- -crontab(5) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`crontab`\ (5) AUTHORS diff --git a/cdist/conf/type/__debconf_set_selections/man.rst b/cdist/conf/type/__debconf_set_selections/man.rst index 27e037e7..b7e5f901 100644 --- a/cdist/conf/type/__debconf_set_selections/man.rst +++ b/cdist/conf/type/__debconf_set_selections/man.rst @@ -37,11 +37,7 @@ EXAMPLES SEE ALSO -------- -debconf-set-selections(1), -`cdist-type__update_alternatives(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`debconf-set-selections`\ (1), :manpage:`cdist-type__update_alternatives`\ (7) AUTHORS diff --git a/cdist/conf/type/__directory/man.rst b/cdist/conf/type/__directory/man.rst index abb07eff..e756b1d6 100644 --- a/cdist/conf/type/__directory/man.rst +++ b/cdist/conf/type/__directory/man.rst @@ -88,12 +88,6 @@ EXAMPLES --owner root --group root --mode 0755 --state present -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__dog_vdi/man.rst b/cdist/conf/type/__dog_vdi/man.rst index b0f700c6..65bea479 100644 --- a/cdist/conf/type/__dog_vdi/man.rst +++ b/cdist/conf/type/__dog_vdi/man.rst @@ -43,10 +43,7 @@ EXAMPLES SEE ALSO -------- -qemu(1), dog(8) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`qemu`\ (1), :manpage:`dog`\ (8) AUTHORS diff --git a/cdist/conf/type/__file/man.rst b/cdist/conf/type/__file/man.rst index fa71e5ce..e21390c7 100644 --- a/cdist/conf/type/__file/man.rst +++ b/cdist/conf/type/__file/man.rst @@ -99,12 +99,6 @@ EXAMPLES DONE -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__firewalld_rule/man.rst b/cdist/conf/type/__firewalld_rule/man.rst index 2d1f5589..414eb7e9 100644 --- a/cdist/conf/type/__firewalld_rule/man.rst +++ b/cdist/conf/type/__firewalld_rule/man.rst @@ -65,11 +65,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__iptables_rule(7) `_, -firewalld(8) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__iptables_rule`\ (7), :manpage:`firewalld`\ (8) AUTHORS diff --git a/cdist/conf/type/__git/man.rst b/cdist/conf/type/__git/man.rst index 2f344a69..c1341ec0 100644 --- a/cdist/conf/type/__git/man.rst +++ b/cdist/conf/type/__git/man.rst @@ -47,12 +47,6 @@ EXAMPLES __git /home/nico/cdist --source git://github.com/telmich/cdist.git --branch 2.1 -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__group/man.rst b/cdist/conf/type/__group/man.rst index c6c9d226..daea0909 100644 --- a/cdist/conf/type/__group/man.rst +++ b/cdist/conf/type/__group/man.rst @@ -67,12 +67,6 @@ EXAMPLES __group foobar --gid 1234 --password 'crypted-password-string' -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__hostname/man.rst b/cdist/conf/type/__hostname/man.rst index bfb9d457..ea1186bc 100644 --- a/cdist/conf/type/__hostname/man.rst +++ b/cdist/conf/type/__hostname/man.rst @@ -39,12 +39,6 @@ EXAMPLES __hostname --name some-static-hostname -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__iptables_apply/man.rst b/cdist/conf/type/__iptables_apply/man.rst index 5f4f4dc8..48697f9c 100644 --- a/cdist/conf/type/__iptables_apply/man.rst +++ b/cdist/conf/type/__iptables_apply/man.rst @@ -29,11 +29,7 @@ None (__iptables_apply is used by __iptables_rule) SEE ALSO -------- -`cdist-type__iptables_rule(7) `_, -iptables(8) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__iptables_rule`\ (7), :manpage:`iptables`\ (8) AUTHORS diff --git a/cdist/conf/type/__iptables_rule/man.rst b/cdist/conf/type/__iptables_rule/man.rst index 4d02e1d7..fab6c47a 100644 --- a/cdist/conf/type/__iptables_rule/man.rst +++ b/cdist/conf/type/__iptables_rule/man.rst @@ -50,11 +50,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__iptables_apply(7) `_, -iptables(8) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__iptables_apply`\ (7), :manpage:`iptables`\ (8) AUTHORS diff --git a/cdist/conf/type/__issue/man.rst b/cdist/conf/type/__issue/man.rst index 77f28da2..eacd8378 100644 --- a/cdist/conf/type/__issue/man.rst +++ b/cdist/conf/type/__issue/man.rst @@ -34,12 +34,6 @@ EXAMPLES __issue --source "$__type/files/myfancyissue" -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__jail/man.rst b/cdist/conf/type/__jail/man.rst index ba175aa4..756e7660 100644 --- a/cdist/conf/type/__jail/man.rst +++ b/cdist/conf/type/__jail/man.rst @@ -108,8 +108,7 @@ EXAMPLES SEE ALSO -------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`jail`\ (8) AUTHORS diff --git a/cdist/conf/type/__jail_freebsd10/man.rst b/cdist/conf/type/__jail_freebsd10/man.rst index 9916afcb..34dc2198 100644 --- a/cdist/conf/type/__jail_freebsd10/man.rst +++ b/cdist/conf/type/__jail_freebsd10/man.rst @@ -107,8 +107,7 @@ EXAMPLES SEE ALSO -------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`jail`\ (8) AUTHORS diff --git a/cdist/conf/type/__jail_freebsd9/man.rst b/cdist/conf/type/__jail_freebsd9/man.rst index 21266dd8..ca526cd0 100644 --- a/cdist/conf/type/__jail_freebsd9/man.rst +++ b/cdist/conf/type/__jail_freebsd9/man.rst @@ -108,8 +108,7 @@ EXAMPLES SEE ALSO -------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`jail`\ (8) AUTHORS diff --git a/cdist/conf/type/__key_value/man.rst b/cdist/conf/type/__key_value/man.rst index 78e29276..80d6aa89 100644 --- a/cdist/conf/type/__key_value/man.rst +++ b/cdist/conf/type/__key_value/man.rst @@ -81,12 +81,6 @@ This type try to handle as many values as possible, so it doesn't use regexes. So you need to exactly specify the key and delimiter. Delimiter can be of any lenght. -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__line/man.rst b/cdist/conf/type/__line/man.rst index 3a773f6a..1f38a974 100644 --- a/cdist/conf/type/__line/man.rst +++ b/cdist/conf/type/__line/man.rst @@ -61,10 +61,7 @@ EXAMPLES SEE ALSO -------- -grep(1) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`grep`\ (1) AUTHORS diff --git a/cdist/conf/type/__link/man.rst b/cdist/conf/type/__link/man.rst index 0d0f2fad..4560b1af 100644 --- a/cdist/conf/type/__link/man.rst +++ b/cdist/conf/type/__link/man.rst @@ -47,12 +47,6 @@ EXAMPLES __link /opt/plone --state absent -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__locale/man.rst b/cdist/conf/type/__locale/man.rst index c555bd00..51ed38df 100644 --- a/cdist/conf/type/__locale/man.rst +++ b/cdist/conf/type/__locale/man.rst @@ -34,10 +34,7 @@ EXAMPLES SEE ALSO -------- -locale(1), localedef(1) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`locale`\ (1), :manpage:`localedef`\ (1) AUTHORS diff --git a/cdist/conf/type/__motd/man.rst b/cdist/conf/type/__motd/man.rst index e1530495..b568985f 100644 --- a/cdist/conf/type/__motd/man.rst +++ b/cdist/conf/type/__motd/man.rst @@ -35,12 +35,6 @@ EXAMPLES __motd --source "$__type/files/my-motd" -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__mount/man.rst b/cdist/conf/type/__mount/man.rst index c53457ac..799288af 100644 --- a/cdist/conf/type/__mount/man.rst +++ b/cdist/conf/type/__mount/man.rst @@ -71,12 +71,6 @@ EXAMPLES --options "mfsmaster=mfsmaster.domain.tld,mfssubfolder=/one,nonempty,_netdev" -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__mysql_database/man.rst b/cdist/conf/type/__mysql_database/man.rst index 921df7f3..0e21a8a1 100644 --- a/cdist/conf/type/__mysql_database/man.rst +++ b/cdist/conf/type/__mysql_database/man.rst @@ -36,12 +36,6 @@ EXAMPLES __mysql_database "cdist" --name "cdist" --user "myuser" --password "mypwd" -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Benedikt Koeppel diff --git a/cdist/conf/type/__package/man.rst b/cdist/conf/type/__package/man.rst index fe806a53..91319e18 100644 --- a/cdist/conf/type/__package/man.rst +++ b/cdist/conf/type/__package/man.rst @@ -51,12 +51,6 @@ EXAMPLES __package vim --state present --type __package_apt -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__package_apt/man.rst b/cdist/conf/type/__package_apt/man.rst index 39eb550b..a841fc5b 100644 --- a/cdist/conf/type/__package_apt/man.rst +++ b/cdist/conf/type/__package_apt/man.rst @@ -46,10 +46,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_emerge/man.rst b/cdist/conf/type/__package_emerge/man.rst index 24f3546d..ceb0f169 100644 --- a/cdist/conf/type/__package_emerge/man.rst +++ b/cdist/conf/type/__package_emerge/man.rst @@ -47,11 +47,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_, -`cdist-type__package_emerge_dependencies(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7), :manpage:`cdist-type__package_emerge_dependencies`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_emerge_dependencies/man.rst b/cdist/conf/type/__package_emerge_dependencies/man.rst index b07d2284..1a227853 100644 --- a/cdist/conf/type/__package_emerge_dependencies/man.rst +++ b/cdist/conf/type/__package_emerge_dependencies/man.rst @@ -36,11 +36,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_, -`cdist-type__package_emerge(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7), :manpage:`cdist-type__package_emerge`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_luarocks/man.rst b/cdist/conf/type/__package_luarocks/man.rst index e5279513..399b07af 100644 --- a/cdist/conf/type/__package_luarocks/man.rst +++ b/cdist/conf/type/__package_luarocks/man.rst @@ -39,10 +39,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_opkg/man.rst b/cdist/conf/type/__package_opkg/man.rst index 9ad4d99f..203b8a36 100644 --- a/cdist/conf/type/__package_opkg/man.rst +++ b/cdist/conf/type/__package_opkg/man.rst @@ -39,10 +39,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_pacman/man.rst b/cdist/conf/type/__package_pacman/man.rst index b144422b..44f36255 100644 --- a/cdist/conf/type/__package_pacman/man.rst +++ b/cdist/conf/type/__package_pacman/man.rst @@ -42,10 +42,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_pip/man.rst b/cdist/conf/type/__package_pip/man.rst index 026562c1..f1ba98d9 100644 --- a/cdist/conf/type/__package_pip/man.rst +++ b/cdist/conf/type/__package_pip/man.rst @@ -49,10 +49,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_pkg_freebsd/man.rst b/cdist/conf/type/__package_pkg_freebsd/man.rst index 8249c8f5..a2633bcb 100644 --- a/cdist/conf/type/__package_pkg_freebsd/man.rst +++ b/cdist/conf/type/__package_pkg_freebsd/man.rst @@ -54,10 +54,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_pkg_openbsd/man.rst b/cdist/conf/type/__package_pkg_openbsd/man.rst index 9d253dce..e776956c 100644 --- a/cdist/conf/type/__package_pkg_openbsd/man.rst +++ b/cdist/conf/type/__package_pkg_openbsd/man.rst @@ -54,10 +54,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_pkgng_freebsd/man.rst b/cdist/conf/type/__package_pkgng_freebsd/man.rst index 83fbf7bf..9fdd7c76 100644 --- a/cdist/conf/type/__package_pkgng_freebsd/man.rst +++ b/cdist/conf/type/__package_pkgng_freebsd/man.rst @@ -85,10 +85,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_rubygem/man.rst b/cdist/conf/type/__package_rubygem/man.rst index 0822bcf2..eb76a036 100644 --- a/cdist/conf/type/__package_rubygem/man.rst +++ b/cdist/conf/type/__package_rubygem/man.rst @@ -39,10 +39,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_update_index/man.rst b/cdist/conf/type/__package_update_index/man.rst index a8f16d21..e64fddae 100644 --- a/cdist/conf/type/__package_update_index/man.rst +++ b/cdist/conf/type/__package_update_index/man.rst @@ -40,12 +40,6 @@ EXAMPLES __package_update_index --type apt -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Ricardo Catalinas Jiménez diff --git a/cdist/conf/type/__package_upgrade_all/man.rst b/cdist/conf/type/__package_upgrade_all/man.rst index f6b216b4..fd4dba44 100644 --- a/cdist/conf/type/__package_upgrade_all/man.rst +++ b/cdist/conf/type/__package_upgrade_all/man.rst @@ -40,12 +40,6 @@ EXAMPLES __package_upgrade_all --type apt -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Ricardo Catalinas Jiménez diff --git a/cdist/conf/type/__package_yum/man.rst b/cdist/conf/type/__package_yum/man.rst index 487150b9..544afbf2 100644 --- a/cdist/conf/type/__package_yum/man.rst +++ b/cdist/conf/type/__package_yum/man.rst @@ -49,10 +49,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__package_zypper/man.rst b/cdist/conf/type/__package_zypper/man.rst index 754b5ddd..da8d1d81 100644 --- a/cdist/conf/type/__package_zypper/man.rst +++ b/cdist/conf/type/__package_zypper/man.rst @@ -56,10 +56,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__package(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__package`\ (7) AUTHORS diff --git a/cdist/conf/type/__pacman_conf/man.rst b/cdist/conf/type/__pacman_conf/man.rst index c0040664..a61f2498 100644 --- a/cdist/conf/type/__pacman_conf/man.rst +++ b/cdist/conf/type/__pacman_conf/man.rst @@ -59,10 +59,7 @@ EXAMPLES SEE ALSO -------- -grep(1) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`grep`\ (1) AUTHORS diff --git a/cdist/conf/type/__pacman_conf_integrate/man.rst b/cdist/conf/type/__pacman_conf_integrate/man.rst index 10ff0c8a..77d5c1c3 100644 --- a/cdist/conf/type/__pacman_conf_integrate/man.rst +++ b/cdist/conf/type/__pacman_conf_integrate/man.rst @@ -35,10 +35,7 @@ EXAMPLES SEE ALSO -------- -grep(1) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`grep`\ (1) AUTHORS diff --git a/cdist/conf/type/__pf_apply/man.rst b/cdist/conf/type/__pf_apply/man.rst index 20374699..2c7fd4fb 100644 --- a/cdist/conf/type/__pf_apply/man.rst +++ b/cdist/conf/type/__pf_apply/man.rst @@ -39,11 +39,7 @@ EXAMPLES SEE ALSO -------- -pf(4), -`cdist-type__pf_ruleset(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`pf`\ (4), :manpage:`cdist-type__pf_ruleset`\ (7) AUTHORS diff --git a/cdist/conf/type/__pf_ruleset/man.rst b/cdist/conf/type/__pf_ruleset/man.rst index 15d50408..eb97e086 100644 --- a/cdist/conf/type/__pf_ruleset/man.rst +++ b/cdist/conf/type/__pf_ruleset/man.rst @@ -39,10 +39,7 @@ EXAMPLES SEE ALSO -------- -pf(4) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`pf`\ (4) AUTHORS diff --git a/cdist/conf/type/__postfix/man.rst b/cdist/conf/type/__postfix/man.rst index 628356b2..dff85fec 100644 --- a/cdist/conf/type/__postfix/man.rst +++ b/cdist/conf/type/__postfix/man.rst @@ -29,12 +29,6 @@ EXAMPLES __postfix -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__postfix_master/man.rst b/cdist/conf/type/__postfix_master/man.rst index 7f100485..27078070 100644 --- a/cdist/conf/type/__postfix_master/man.rst +++ b/cdist/conf/type/__postfix_master/man.rst @@ -68,10 +68,7 @@ EXAMPLES SEE ALSO -------- -master(5) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`master`\ (5) AUTHORS diff --git a/cdist/conf/type/__postfix_postconf/man.rst b/cdist/conf/type/__postfix_postconf/man.rst index f1a4b0a6..5773fcaf 100644 --- a/cdist/conf/type/__postfix_postconf/man.rst +++ b/cdist/conf/type/__postfix_postconf/man.rst @@ -38,10 +38,7 @@ EXAMPLES SEE ALSO -------- -postconf(5) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`postconf`\ (5) AUTHORS diff --git a/cdist/conf/type/__postfix_postmap/man.rst b/cdist/conf/type/__postfix_postmap/man.rst index 20aeb2df..2f455346 100644 --- a/cdist/conf/type/__postfix_postmap/man.rst +++ b/cdist/conf/type/__postfix_postmap/man.rst @@ -29,12 +29,6 @@ EXAMPLES __postfix_postmap /etc/postfix/generic -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__postfix_reload/man.rst b/cdist/conf/type/__postfix_reload/man.rst index ec9529e9..36a66d45 100644 --- a/cdist/conf/type/__postfix_reload/man.rst +++ b/cdist/conf/type/__postfix_reload/man.rst @@ -29,12 +29,6 @@ EXAMPLES __postfix_reload -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__postgres_database/man.rst b/cdist/conf/type/__postgres_database/man.rst index 2a0ad8d0..69e1a67f 100644 --- a/cdist/conf/type/__postgres_database/man.rst +++ b/cdist/conf/type/__postgres_database/man.rst @@ -30,10 +30,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__postgres_role(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__postgres_role`\ (7) AUTHORS diff --git a/cdist/conf/type/__postgres_role/man.rst b/cdist/conf/type/__postgres_role/man.rst index 9d0b68ab..f9293be5 100644 --- a/cdist/conf/type/__postgres_role/man.rst +++ b/cdist/conf/type/__postgres_role/man.rst @@ -48,10 +48,8 @@ EXAMPLES SEE ALSO -------- -`cdist-type__postgres_database(7) `_ +:manpage:`cdist-type__postgres_database`\ (7) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. postgresql documentation at: . diff --git a/cdist/conf/type/__process/man.rst b/cdist/conf/type/__process/man.rst index 076377e1..19f68ddc 100644 --- a/cdist/conf/type/__process/man.rst +++ b/cdist/conf/type/__process/man.rst @@ -58,10 +58,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__start_on_boot(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__start_on_boot`\ (7) AUTHORS diff --git a/cdist/conf/type/__pyvenv/man.rst b/cdist/conf/type/__pyvenv/man.rst index f43454a7..977501e6 100644 --- a/cdist/conf/type/__pyvenv/man.rst +++ b/cdist/conf/type/__pyvenv/man.rst @@ -67,12 +67,6 @@ EXAMPLES __pyvenv /home/services/djangoenv --venvparams "--copies --system-site-packages" -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Darko Poljak diff --git a/cdist/conf/type/__qemu_img/man.rst b/cdist/conf/type/__qemu_img/man.rst index 3a137f4b..7cb4a758 100644 --- a/cdist/conf/type/__qemu_img/man.rst +++ b/cdist/conf/type/__qemu_img/man.rst @@ -37,10 +37,7 @@ EXAMPLES SEE ALSO -------- -qemu-img(1) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`qemu-img`\ (1) AUTHORS diff --git a/cdist/conf/type/__rbenv/man.rst b/cdist/conf/type/__rbenv/man.rst index fe965796..6341908a 100644 --- a/cdist/conf/type/__rbenv/man.rst +++ b/cdist/conf/type/__rbenv/man.rst @@ -36,12 +36,6 @@ EXAMPLES __rbenv /home/bastian --state absent -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Nico Schottelius diff --git a/cdist/conf/type/__rsync/man.rst b/cdist/conf/type/__rsync/man.rst index bac144c2..28e85ab2 100644 --- a/cdist/conf/type/__rsync/man.rst +++ b/cdist/conf/type/__rsync/man.rst @@ -98,10 +98,7 @@ EXAMPLES SEE ALSO -------- -rsync(1) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`rsync`\ (1) AUTHORS diff --git a/cdist/conf/type/__rvm/man.rst b/cdist/conf/type/__rvm/man.rst index bf84328c..412b651d 100644 --- a/cdist/conf/type/__rvm/man.rst +++ b/cdist/conf/type/__rvm/man.rst @@ -31,12 +31,8 @@ EXAMPLES SEE ALSO -------- -`cdist-type__rvm_gem(7) `_, -`cdist-type__rvm_gemset(7) `_, -`cdist-type__rvm_ruby(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__rvm_gem`\ (7), :manpage:`cdist-type__rvm_gemset`\ (7), +:manpage:`cdist-type__rvm_ruby`\ (7) AUTHORS diff --git a/cdist/conf/type/__rvm_gem/man.rst b/cdist/conf/type/__rvm_gem/man.rst index 5e65a712..a60fe843 100644 --- a/cdist/conf/type/__rvm_gem/man.rst +++ b/cdist/conf/type/__rvm_gem/man.rst @@ -43,12 +43,8 @@ EXAMPLES SEE ALSO -------- -`cdist-type__rvm(7) `_, -`cdist-type__rvm_gemset(7) `_, -`cdist-type__rvm_ruby(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__rvm`\ (7), :manpage:`cdist-type__rvm_gemset`\ (7), +:manpage:`cdist-type__rvm_ruby`\ (7) AUTHORS diff --git a/cdist/conf/type/__rvm_gemset/man.rst b/cdist/conf/type/__rvm_gemset/man.rst index 0d04ed94..4259ec92 100644 --- a/cdist/conf/type/__rvm_gemset/man.rst +++ b/cdist/conf/type/__rvm_gemset/man.rst @@ -41,12 +41,8 @@ EXAMPLES SEE ALSO -------- -`cdist-type__rvm(7) `_, -`cdist-type__rvm_gem(7) `_, -`cdist-type__rvm_ruby(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__rvm`\ (7), :manpage:`cdist-type__rvm_gem`\ (7), +:manpage:`cdist-type__rvm_ruby`\ (7) AUTHORS diff --git a/cdist/conf/type/__rvm_ruby/man.rst b/cdist/conf/type/__rvm_ruby/man.rst index d2bd4d08..18b6044b 100644 --- a/cdist/conf/type/__rvm_ruby/man.rst +++ b/cdist/conf/type/__rvm_ruby/man.rst @@ -42,12 +42,8 @@ EXAMPLES SEE ALSO -------- -`cdist-type__rvm(7) `_, -`cdist-type__rvm_gem(7) `_, -`cdist-type__rvm_gemset(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__rvm`\ (7), :manpage:`cdist-type__rvm_gem`\ (7), +:manpage:`cdist-type__rvm_gemset`\ (7) AUTHORS diff --git a/cdist/conf/type/__ssh_authorized_key/man.rst b/cdist/conf/type/__ssh_authorized_key/man.rst index a2f90574..3585717f 100644 --- a/cdist/conf/type/__ssh_authorized_key/man.rst +++ b/cdist/conf/type/__ssh_authorized_key/man.rst @@ -55,11 +55,8 @@ EXAMPLES SEE ALSO -------- -`cdist__ssh_authorized_keys(7) `_, -sshd(8) +:manpage:`cdist__ssh_authorized_keys`\ (7), :manpage:`sshd`\ (8) -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. AUTHORS ------- diff --git a/cdist/conf/type/__ssh_authorized_keys/man.rst b/cdist/conf/type/__ssh_authorized_keys/man.rst index cab844cc..6729660e 100644 --- a/cdist/conf/type/__ssh_authorized_keys/man.rst +++ b/cdist/conf/type/__ssh_authorized_keys/man.rst @@ -105,10 +105,7 @@ EXAMPLES SEE ALSO -------- -sshd(8) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`sshd`\ (8) AUTHORS diff --git a/cdist/conf/type/__ssh_dot_ssh/man.rst b/cdist/conf/type/__ssh_dot_ssh/man.rst index 6d449a4c..75adbde0 100644 --- a/cdist/conf/type/__ssh_dot_ssh/man.rst +++ b/cdist/conf/type/__ssh_dot_ssh/man.rst @@ -33,10 +33,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__ssh_authorized_keys(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__ssh_authorized_keys`\ (7) AUTHORS diff --git a/cdist/conf/type/__staged_file/man.rst b/cdist/conf/type/__staged_file/man.rst index 69ea3678..d11338af 100644 --- a/cdist/conf/type/__staged_file/man.rst +++ b/cdist/conf/type/__staged_file/man.rst @@ -99,10 +99,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__file(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__file`\ (7) AUTHORS diff --git a/cdist/conf/type/__start_on_boot/man.rst b/cdist/conf/type/__start_on_boot/man.rst index 7d009bf0..70c3e8d4 100644 --- a/cdist/conf/type/__start_on_boot/man.rst +++ b/cdist/conf/type/__start_on_boot/man.rst @@ -45,10 +45,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__process(7) `_ - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__process`\ (7) AUTHORS diff --git a/cdist/conf/type/__timezone/man.rst b/cdist/conf/type/__timezone/man.rst index 6e18c759..8a945c16 100644 --- a/cdist/conf/type/__timezone/man.rst +++ b/cdist/conf/type/__timezone/man.rst @@ -34,12 +34,6 @@ EXAMPLES __timezone US/Central -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Ramon Salvadó diff --git a/cdist/conf/type/__update_alternatives/man.rst b/cdist/conf/type/__update_alternatives/man.rst index bcedc1bf..c2b8bf6d 100644 --- a/cdist/conf/type/__update_alternatives/man.rst +++ b/cdist/conf/type/__update_alternatives/man.rst @@ -30,11 +30,7 @@ EXAMPLES SEE ALSO -------- -`cdist-type__debconf_set_selections(7) `_, -update-alternatives(8) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`cdist-type__debconf_set_selections`\ (7), :manpage:`update-alternatives`\ (8) AUTHORS diff --git a/cdist/conf/type/__user/man.rst b/cdist/conf/type/__user/man.rst index 0dd91ddd..1ad17b5b 100644 --- a/cdist/conf/type/__user/man.rst +++ b/cdist/conf/type/__user/man.rst @@ -84,10 +84,7 @@ EXAMPLES SEE ALSO -------- -pw(8), usermod(8) - -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. +:manpage:`pw`\ (8), :manpage:`usermod`\ (8) AUTHORS diff --git a/cdist/conf/type/__user_groups/man.rst b/cdist/conf/type/__user_groups/man.rst index 216a31c8..37fd25d7 100644 --- a/cdist/conf/type/__user_groups/man.rst +++ b/cdist/conf/type/__user_groups/man.rst @@ -39,12 +39,6 @@ EXAMPLES --group webuser2 --state absent -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__yum_repo/man.rst b/cdist/conf/type/__yum_repo/man.rst index b3866739..543a456d 100644 --- a/cdist/conf/type/__yum_repo/man.rst +++ b/cdist/conf/type/__yum_repo/man.rst @@ -111,12 +111,6 @@ EXAMPLES --gpgkey https://fedoraproject.org/static/0608B895.txt -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Steven Armstrong diff --git a/cdist/conf/type/__zypper_repo/man.rst b/cdist/conf/type/__zypper_repo/man.rst index bcf376de..9cc5e1c3 100644 --- a/cdist/conf/type/__zypper_repo/man.rst +++ b/cdist/conf/type/__zypper_repo/man.rst @@ -60,12 +60,6 @@ EXAMPLES __zypper_repo testrepo4 --state disabled --repo_id 4 -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Daniel Heule diff --git a/cdist/conf/type/__zypper_service/man.rst b/cdist/conf/type/__zypper_service/man.rst index f586742a..c596dea0 100644 --- a/cdist/conf/type/__zypper_service/man.rst +++ b/cdist/conf/type/__zypper_service/man.rst @@ -53,12 +53,6 @@ EXAMPLES __zypper_service INTERNAL_SLES11_SP3 --state absent --uri "http://path/to/your/ris/dir" -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>, -especially cdist type chapter: <:cdist_docs:`cdist-type`>. - - AUTHORS ------- Daniel Heule diff --git a/docs/man/Makefile b/docs/man/Makefile index 2bab13ce..bec5d97f 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -5,7 +5,9 @@ SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = -BUILDDIR = _build +BUILDDIR = ../dist +# for cache, etc. +_BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) @@ -15,7 +17,7 @@ endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +ALLSPHINXOPTS = -d $(_BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . @@ -52,6 +54,7 @@ help: .PHONY: clean clean: rm -rf $(BUILDDIR)/* + rm -rf $(_BUILDDIR)/* .PHONY: html html: diff --git a/docs/man/cdist-install.rst b/docs/man/cdist-install.rst index 7e8bba7a..f950a1ee 100644 --- a/docs/man/cdist-install.rst +++ b/docs/man/cdist-install.rst @@ -76,9 +76,9 @@ If you want to build and use the manpages, run: .. code-block:: sh make man - export MANPATH=$MANPATH:$(pwd -P)/docs/man/_build/man + export MANPATH=$MANPATH:$(pwd -P)/docs/dist/man -Or you can move manpages from docs/man/_build/man directory to some +Or you can move manpages from docs/dist/man directory to some other directory and add it to MANPATH. You can also build manpages for types in your ~/.cdist directory: @@ -87,12 +87,23 @@ You can also build manpages for types in your ~/.cdist directory: make dotman -Built manpages are now in docs/man/_build/man directory. If you have -some other custom .cdist directory, e.g. /custom/.cdist then use: +Built manpages are now in docs/dist/man directory. If you have +some other custom .cdist directory, e.g. /opt/cdist then use: .. code-block:: sh - DOT_CDIST_PATH=/custom/.cdist make dotman + DOT_CDIST_PATH=/opt/cdist make dotman + +Building and using HTML documentation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you want to build and use HTML documentation, run: + +.. code-block:: sh + + make html + +Now you can access docs/dist/html/index.html. Python package ~~~~~~~~~~~~~~ diff --git a/docs/man/conf.py b/docs/man/conf.py index 916b06a4..334cfd51 100644 --- a/docs/man/conf.py +++ b/docs/man/conf.py @@ -310,9 +310,3 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False - -extlinks = { - 'cdist_docs': - ('http://www.nico.schottelius.org/software/cdist/man/{}/%s.html'.format( - release), None), -} diff --git a/docs/man/man1/cdist.rst b/docs/man/man1/cdist.rst index 2a056482..efc1a201 100644 --- a/docs/man/man1/cdist.rst +++ b/docs/man/man1/cdist.rst @@ -175,10 +175,6 @@ The following exit values shall be returned: One or more host configurations failed -SEE ALSO --------- -Full documentation at: <:cdist_docs:`index`>. - AUTHORS ------- Nico Schottelius From 7d3c66859cd3fe8ac6d4e6a3ce4c5a110e22ea93 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 30 Jun 2016 12:18:42 +0200 Subject: [PATCH 32/42] Separate man pages by section number. --- docs/man/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/man/Makefile b/docs/man/Makefile index bec5d97f..800a80d8 100644 --- a/docs/man/Makefile +++ b/docs/man/Makefile @@ -165,6 +165,10 @@ 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." From b04ab0b630b9ed2ad9b8064242454cd89621210c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 30 Jun 2016 12:28:14 +0200 Subject: [PATCH 33/42] Fix Makefile for new sphinx build. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9f3535fd..9d494f23 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ man: mansphinxman mansphinxhtml # Manpages #5: release part MANWEBDIR=$(WEBBASE)/man/$(CHANGELOG_VERSION) -MANBUILDDIR=$(MANDIR)/_build/html +MANBUILDDIR=docs/dist/html man-dist: man rm -rf "${MANWEBDIR}" @@ -212,7 +212,7 @@ release: # clean: - rm -f $(MAN7DSTDIR)/cdist-reference.rst + rm -f $(MANDIR)/cdist-reference.rst find "$(MANDIR)" -mindepth 2 -type l \ | xargs rm -f From 72345f551620019f13f1b5710e82dd145f73263c Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 30 Jun 2016 20:31:01 +0200 Subject: [PATCH 34/42] Make union of existing and new requirements instead of conflict error. --- cdist/emulator.py | 60 +++++++++++++++++++++------------ cdist/test/emulator/__init__.py | 43 ++++++++++++++++++++--- 2 files changed, 77 insertions(+), 26 deletions(-) diff --git a/cdist/emulator.py b/cdist/emulator.py index f5a9f645..d526bf77 100644 --- a/cdist/emulator.py +++ b/cdist/emulator.py @@ -201,6 +201,34 @@ class Emulator(object): except EnvironmentError as e: raise cdist.Error('Failed to read from stdin: %s' % e) + + def record_requirement(self, requirement): + """record requirement and return recorded requirement""" + + # Raises an error, if object cannot be created + try: + cdist_object = self.cdist_object.object_from_name(requirement) + except core.cdist_type.NoSuchTypeError as e: + self.log.error(("%s requires object %s, but type %s does not" + " exist. Defined at %s" % (self.cdist_object.name, + requirement, e.name, self.object_source))) + raise + except core.cdist_object.MissingObjectIdError as e: + self.log.error(("%s requires object %s without object id." + " Defined at %s" % (self.cdist_object.name, requirement, + self.object_source))) + raise + + self.log.debug("Recording requirement: %s", requirement) + + # Save the sanitised version, not the user supplied one + # (__file//bar => __file/bar) + # This ensures pattern matching is done against sanitised list + self.cdist_object.requirements.append(cdist_object.name) + + return cdist_object.name + + def record_requirements(self): """record requirements""" @@ -228,24 +256,8 @@ class Emulator(object): for requirement in requirements.split(" "): # Ignore empty fields - probably the only field anyway if len(requirement) == 0: continue - - # Raises an error, if object cannot be created - try: - cdist_object = self.cdist_object.object_from_name(requirement) - except core.cdist_type.NoSuchTypeError as e: - self.log.error("%s requires object %s, but type %s does not exist. Defined at %s" % (self.cdist_object.name, requirement, e.name, self.object_source)) - raise - except core.cdist_object.MissingObjectIdError as e: - self.log.error("%s requires object %s without object id. Defined at %s" % (self.cdist_object.name, requirement, self.object_source)) - raise - - self.log.debug("Recording requirement: %s", requirement) - - # Save the sanitised version, not the user supplied one - # (__file//bar => __file/bar) - # This ensures pattern matching is done against sanitised list - self.cdist_object.requirements.append(cdist_object.name) - reqs.add(cdist_object.name) + req = self.record_requirement(requirement) + reqs.add(req) if self._existing_reqs is not None: # if object exists then compare existing and new requirements self.log.debug("OBJ: {} {}".format(self.cdist_type, self.object_id)) @@ -253,15 +265,19 @@ class Emulator(object): self.log.debug("REQS: {}".format(reqs)) if self._existing_reqs != reqs: - errmsg = ("Object {} already exists with conflicting " - "requirements:\n{}: {}\n{}: {}".format( + dbgmsg = ("Object {} already exists with different " + "requirements:\n{}: {}\n{}: {}. Merging sets.".format( self.cdist_object.name, " ".join(self.cdist_object.source), self._existing_reqs, self.object_source, reqs)) - self.log.error(errmsg) - raise cdist.Error(errmsg) + self.log.debug(dbgmsg) + all_reqs = reqs | self._existing_reqs + self.log.debug("All requirements: {}".format(all_reqs)) + for x in all_reqs: + if not x in self.cdist_object.requirements: + self.record_requirement(x) def record_auto_requirements(self): diff --git a/cdist/test/emulator/__init__.py b/cdist/test/emulator/__init__.py index b91c1e8f..ee6c3cea 100644 --- a/cdist/test/emulator/__init__.py +++ b/cdist/test/emulator/__init__.py @@ -155,7 +155,7 @@ class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): def tearDown(self): shutil.rmtree(self.temp_dir) - def test_object_conflicting_requirements_req_none(self): + def test_object_different_requirements_req_none(self): argv = ['__directory', 'spam'] emu = emulator.Emulator(argv, env=self.env) emu.run() @@ -167,9 +167,14 @@ class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): if 'require' in self.env: del self.env['require'] emu = emulator.Emulator(argv, env=self.env) - self.assertRaises(cdist.Error, emu.run) + emu.run() - def test_object_conflicting_requirements_none_req(self): + cdist_type = core.CdistType(self.local.type_path, '__file') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'eggs') + reqs = set(('__directory/spam',)) + self.assertEqual(reqs, set(cdist_object.requirements)) + + def test_object_different_requirements_none_req(self): argv = ['__directory', 'spam'] emu = emulator.Emulator(argv, env=self.env) emu.run() @@ -181,7 +186,37 @@ class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): argv = ['__file', 'eggs'] self.env['require'] = '__directory/spam' emu = emulator.Emulator(argv, env=self.env) - self.assertRaises(cdist.Error, emu.run) + emu.run() + + cdist_type = core.CdistType(self.local.type_path, '__file') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'eggs') + reqs = set(('__directory/spam',)) + self.assertEqual(reqs, set(cdist_object.requirements)) + + def test_object_different_requirements(self): + argv = ['__directory', 'spam'] + emu = emulator.Emulator(argv, env=self.env) + emu.run() + argv = ['__directory', 'spameggs'] + emu = emulator.Emulator(argv, env=self.env) + emu.run() + + argv = ['__file', 'eggs'] + if 'require' in self.env: + del self.env['require'] + self.env['require'] = '__directory/spam' + emu = emulator.Emulator(argv, env=self.env) + emu.run() + + argv = ['__file', 'eggs'] + self.env['require'] = '__directory/spameggs' + emu = emulator.Emulator(argv, env=self.env) + emu.run() + + cdist_type = core.CdistType(self.local.type_path, '__file') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'eggs') + reqs = set(('__directory/spam', '__directory/spameggs',)) + self.assertEqual(reqs, set(cdist_object.requirements)) class AutoRequireEmulatorTestCase(test.CdistTestCase): From 92d96c14b936502a3fdb2c53ece8a5250e076c21 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 4 Jul 2016 10:11:11 +0200 Subject: [PATCH 35/42] Undo reqs conflict detection, continue appending new reqs. --- cdist/emulator.py | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/cdist/emulator.py b/cdist/emulator.py index d526bf77..0e4a41c4 100644 --- a/cdist/emulator.py +++ b/cdist/emulator.py @@ -77,9 +77,6 @@ class Emulator(object): self.type_name = os.path.basename(argv[0]) self.cdist_type = core.CdistType(self.type_base_path, self.type_name) - # if set then object already exists and this var holds existing - # requirements - self._existing_reqs = None self.__init_log() @@ -155,7 +152,6 @@ class Emulator(object): if self.cdist_object.exists and not 'CDIST_OVERRIDE' in self.env: # make existing requirements a set, so we can compare it # later with new requirements - self._existing_reqs = set(self.cdist_object.requirements) if self.cdist_object.parameters != self.parameters: errmsg = ("Object %s already exists with conflicting " "parameters:\n%s: %s\n%s: %s" % (self.cdist_object.name, @@ -249,35 +245,13 @@ class Emulator(object): # if no second last line, we are on the first type, so do not set a requirement pass - reqs = set() if "require" in self.env: requirements = self.env['require'] self.log.debug("reqs = " + requirements) for requirement in requirements.split(" "): # Ignore empty fields - probably the only field anyway if len(requirement) == 0: continue - req = self.record_requirement(requirement) - reqs.add(req) - if self._existing_reqs is not None: - # if object exists then compare existing and new requirements - self.log.debug("OBJ: {} {}".format(self.cdist_type, self.object_id)) - self.log.debug("EXISTING REQS: {}".format(self._existing_reqs)) - self.log.debug("REQS: {}".format(reqs)) - - if self._existing_reqs != reqs: - dbgmsg = ("Object {} already exists with different " - "requirements:\n{}: {}\n{}: {}. Merging sets.".format( - self.cdist_object.name, - " ".join(self.cdist_object.source), - self._existing_reqs, - self.object_source, - reqs)) - self.log.debug(dbgmsg) - all_reqs = reqs | self._existing_reqs - self.log.debug("All requirements: {}".format(all_reqs)) - for x in all_reqs: - if not x in self.cdist_object.requirements: - self.record_requirement(x) + self.record_requirement(requirement) def record_auto_requirements(self): From 43ef5ec1ae664d5b51ec3ed61fb83564ace65b28 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 4 Jul 2016 10:14:19 +0200 Subject: [PATCH 36/42] Remove conflicting reqs changelog. --- docs/changelog | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 8e701bdd..f1aead98 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,7 +4,6 @@ Changelog next: * Documentation: Restructure and fix and improve docs and manpages (Darko Poljak) * Core: Add files directory for static files (Darko Poljak) - * Core: Fix conflicting requirements (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) From 64efa0459971f3270203b49d989c35abf1f4197a Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Tue, 5 Jul 2016 20:44:24 +0200 Subject: [PATCH 37/42] pep8 --- cdist/__init__.py | 11 ++- cdist/config.py | 119 ++++++++++++++++------------ cdist/core/__init__.py | 14 ++-- cdist/core/cdist_object.py | 82 ++++++++++++------- cdist/core/cdist_type.py | 38 ++++++--- cdist/core/code.py | 43 ++++++---- cdist/core/explorer.py | 55 ++++++++----- cdist/core/manifest.py | 34 +++++--- cdist/emulator.py | 119 +++++++++++++++++----------- cdist/exec/local.py | 46 +++++++---- cdist/exec/remote.py | 17 ++-- cdist/exec/util.py | 12 ++- cdist/log.py | 1 + cdist/message.py | 7 +- cdist/shell.py | 10 ++- cdist/sphinxext/manpage.py | 10 ++- cdist/test/__init__.py | 4 +- cdist/test/banner/__init__.py | 3 +- cdist/test/cdist_object/__init__.py | 114 +++++++++++++++++--------- cdist/test/cdist_type/__init__.py | 36 ++++++--- cdist/test/code/__init__.py | 46 +++++++---- cdist/test/config/__init__.py | 41 +++++----- cdist/test/emulator/__init__.py | 68 +++++++++++----- cdist/test/exec/local.py | 51 +++++++----- cdist/test/exec/remote.py | 49 ++++++++---- cdist/test/explorer/__init__.py | 51 ++++++++---- cdist/test/manifest/__init__.py | 20 +++-- cdist/test/message/__init__.py | 6 +- cdist/util/fsproperty.py | 15 ++-- 29 files changed, 714 insertions(+), 408 deletions(-) diff --git a/cdist/__init__.py b/cdist/__init__.py index e789499c..b7436b5a 100644 --- a/cdist/__init__.py +++ b/cdist/__init__.py @@ -44,25 +44,30 @@ BANNER = """ REMOTE_COPY = "scp -o User=root" REMOTE_EXEC = "ssh -o User=root" + class Error(Exception): """Base exception class for this project""" pass + class UnresolvableRequirementsError(cdist.Error): """Resolving requirements failed""" pass + class CdistObjectError(Error): """Something went wrong with an object""" - + def __init__(self, cdist_object, message): self.name = cdist_object.name self.source = " ".join(cdist_object.source) self.message = message - def __str__(self): - return '%s: %s (defined at %s)' % (self.name, self.message, self.source) + return '%s: %s (defined at %s)' % (self.name, + self.message, + self.source) + def file_to_list(filename): """Return list from \n seperated file""" diff --git a/cdist/config.py b/cdist/config.py index f5e62ce1..5ebeab14 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -35,19 +35,21 @@ import cdist.exec.remote from cdist import core + class Config(object): """Cdist main class to hold arbitrary data""" def __init__(self, local, remote, dry_run=False): - self.local = local - self.remote = remote - self.log = logging.getLogger(self.local.target_host) - self.dry_run = dry_run + self.local = local + self.remote = remote + self.log = logging.getLogger(self.local.target_host) + self.dry_run = dry_run - self.explorer = core.Explorer(self.local.target_host, self.local, self.remote) + self.explorer = core.Explorer(self.local.target_host, self.local, + self.remote) self.manifest = core.Manifest(self.local.target_host, self.local) - self.code = core.Code(self.local.target_host, self.local, self.remote) + self.code = core.Code(self.local.target_host, self.local, self.remote) def _init_files_dirs(self): """Prepare files and directories for the run""" @@ -65,7 +67,7 @@ class Config(object): try: for host in fileinput.input(files=(source)): # remove leading and trailing whitespace - yield host.strip() + yield host.strip() except (IOError, OSError) as e: raise cdist.Error("Error reading hosts from \'{}\'".format( source)) @@ -74,7 +76,6 @@ class Config(object): for host in source: yield host - @classmethod def commandline(cls, args): """Configure remote system""" @@ -84,27 +85,29 @@ class Config(object): log = logging.getLogger("cdist") if args.manifest == '-' and args.hostfile == '-': - raise cdist.Error(("Cannot read both, manifest and host file, " - "from stdin")) + raise cdist.Error(("Cannot read both, manifest and host file, " + "from stdin")) # if no host source is specified then read hosts from stdin if not (args.hostfile or args.host): args.hostfile = '-' - + initial_manifest_tempfile = None if args.manifest == '-': # read initial manifest from stdin import tempfile try: - handle, initial_manifest_temp_path = tempfile.mkstemp(prefix='cdist.stdin.') + handle, initial_manifest_temp_path = tempfile.mkstemp( + prefix='cdist.stdin.') with os.fdopen(handle, 'w') as fd: fd.write(sys.stdin.read()) except (IOError, OSError) as e: - raise cdist.Error("Creating tempfile for stdin data failed: %s" % e) - + raise cdist.Error(("Creating tempfile for stdin data " + "failed: %s" % e)) + args.manifest = initial_manifest_temp_path import atexit atexit.register(lambda: os.remove(initial_manifest_temp_path)) - + process = {} failed_hosts = [] time_start = time.time() @@ -115,37 +118,38 @@ class Config(object): hostcnt += 1 if args.parallel: log.debug("Creating child process for %s", host) - process[host] = multiprocessing.Process(target=cls.onehost, args=(host, args, True)) + process[host] = multiprocessing.Process( + target=cls.onehost, args=(host, args, True)) process[host].start() else: try: cls.onehost(host, args, parallel=False) except cdist.Error as e: failed_hosts.append(host) - + # Catch errors in parallel mode when joining if args.parallel: for host in process.keys(): log.debug("Joining process %s", host) process[host].join() - + if not process[host].exitcode == 0: failed_hosts.append(host) - + time_end = time.time() log.info("Total processing time for %s host(s): %s", hostcnt, - (time_end - time_start)) - + (time_end - time_start)) + if len(failed_hosts) > 0: - raise cdist.Error("Failed to configure the following hosts: " + - " ".join(failed_hosts)) - + raise cdist.Error("Failed to configure the following hosts: " + + " ".join(failed_hosts)) + @classmethod def onehost(cls, host, args, parallel): """Configure ONE system""" log = logging.getLogger(host) - + try: local = cdist.exec.local.Local( target_host=host, @@ -157,10 +161,10 @@ class Config(object): target_host=host, remote_exec=args.remote_exec, remote_copy=args.remote_copy) - + c = cls(local, remote, dry_run=args.dry_run) c.run() - + except cdist.Error as e: log.error(e) if parallel: @@ -168,7 +172,7 @@ class Config(object): sys.exit(1) else: raise - + except KeyboardInterrupt: # Ignore in parallel mode, we are existing anyway if parallel: @@ -188,49 +192,50 @@ class Config(object): self.iterate_until_finished() self.local.save_cache() - self.log.info("Finished successful run in %s seconds", time.time() - start_time) - + self.log.info("Finished successful run in %s seconds", + time.time() - start_time) def object_list(self): """Short name for object list retrieval""" - for cdist_object in core.CdistObject.list_objects(self.local.object_path, - self.local.type_path, - self.local.object_marker_name): + for cdist_object in core.CdistObject.list_objects( + self.local.object_path, self.local.type_path, + self.local.object_marker_name): if cdist_object.cdist_type.is_install: - self.log.debug("Running in config mode, ignoring install object: {0}".format(cdist_object)) + self.log.debug(("Running in config mode, ignoring install " + "object: {0}").format(cdist_object)) else: yield cdist_object - def iterate_once(self): """ - Iterate over the objects once - helper method for + Iterate over the objects once - helper method for iterate_until_finished """ - objects_changed = False + objects_changed = False for cdist_object in self.object_list(): if cdist_object.requirements_unfinished(cdist_object.requirements): """We cannot do anything for this poor object""" continue - + if cdist_object.state == core.CdistObject.STATE_UNDEF: """Prepare the virgin object""" - + self.object_prepare(cdist_object) objects_changed = True - + if cdist_object.requirements_unfinished(cdist_object.autorequire): - """The previous step created objects we depend on - wait for them""" + """The previous step created objects we depend on - + wait for them + """ continue - + if cdist_object.state == core.CdistObject.STATE_PREPARED: self.object_run(cdist_object) objects_changed = True return objects_changed - def iterate_until_finished(self): """ Go through all objects and solve them @@ -256,22 +261,32 @@ class Config(object): requirement_names = [] autorequire_names = [] - for requirement in cdist_object.requirements_unfinished(cdist_object.requirements): + for requirement in cdist_object.requirements_unfinished( + cdist_object.requirements): requirement_names.append(requirement.name) - for requirement in cdist_object.requirements_unfinished(cdist_object.autorequire): + for requirement in cdist_object.requirements_unfinished( + cdist_object.autorequire): autorequire_names.append(requirement.name) requirements = "\n ".join(requirement_names) - autorequire = "\n ".join(autorequire_names) - info_string.append("%s requires:\n %s\n%s autorequires:\n %s" % (cdist_object.name, requirements, cdist_object.name, autorequire)) + autorequire = "\n ".join(autorequire_names) + info_string.append(("%s requires:\n" + " %s\n" + "%s ""autorequires:\n" + " %s" % ( + cdist_object.name, + requirements, cdist_object.name, + autorequire))) - raise cdist.UnresolvableRequirementsError("The requirements of the following objects could not be resolved:\n%s" % - ("\n".join(info_string))) + raise cdist.UnresolvableRequirementsError( + ("The requirements of the following objects could not be " + "resolved:\n%s") % ("\n".join(info_string))) def object_prepare(self, cdist_object): """Prepare object: Run type explorer + manifest""" - self.log.info("Running manifest and explorers for " + cdist_object.name) + self.log.info( + "Running manifest and explorers for " + cdist_object.name) self.explorer.run_type_explorers(cdist_object) self.manifest.run_type_manifest(cdist_object) cdist_object.state = core.CdistObject.STATE_PREPARED @@ -281,7 +296,8 @@ class Config(object): self.log.debug("Trying to run object %s" % (cdist_object.name)) if cdist_object.state == core.CdistObject.STATE_DONE: - raise cdist.Error("Attempting to run an already finished object: %s", cdist_object) + raise cdist.Error(("Attempting to run an already finished " + "object: %s"), cdist_object) cdist_type = cdist_object.cdist_type @@ -304,7 +320,6 @@ class Config(object): else: self.log.info("Skipping code execution due to DRY RUN") - # Mark this object as done self.log.debug("Finishing run of " + cdist_object.name) cdist_object.state = core.CdistObject.STATE_DONE diff --git a/cdist/core/__init__.py b/cdist/core/__init__.py index d773fc01..41e00a3a 100644 --- a/cdist/core/__init__.py +++ b/cdist/core/__init__.py @@ -20,10 +20,10 @@ # # -from cdist.core.cdist_type import CdistType -from cdist.core.cdist_type import NoSuchTypeError -from cdist.core.cdist_object import CdistObject -from cdist.core.cdist_object import IllegalObjectIdError -from cdist.core.explorer import Explorer -from cdist.core.manifest import Manifest -from cdist.core.code import Code +from cdist.core.cdist_type import CdistType +from cdist.core.cdist_type import NoSuchTypeError +from cdist.core.cdist_object import CdistObject +from cdist.core.cdist_object import IllegalObjectIdError +from cdist.core.explorer import Explorer +from cdist.core.manifest import Manifest +from cdist.core.code import Code diff --git a/cdist/core/cdist_object.py b/cdist/core/cdist_object.py index 8c6ee9c9..262db8bf 100644 --- a/cdist/core/cdist_object.py +++ b/cdist/core/cdist_object.py @@ -32,6 +32,7 @@ from cdist.util import fsproperty log = logging.getLogger(__name__) + class IllegalObjectIdError(cdist.Error): def __init__(self, object_id, message=None): self.object_id = object_id @@ -40,14 +41,17 @@ class IllegalObjectIdError(cdist.Error): def __str__(self): return '%s: %s' % (self.message, self.object_id) + class MissingObjectIdError(cdist.Error): def __init__(self, type_name): self.type_name = type_name - self.message = "Type %s requires object id (is not a singleton type)" % self.type_name + self.message = ("Type %s requires object id (is not a " + "singleton type)") % self.type_name def __str__(self): return '%s' % (self.message) + class CdistObject(object): """Represents a cdist object. @@ -64,7 +68,7 @@ class CdistObject(object): STATE_DONE = "done" def __init__(self, cdist_type, base_path, object_marker, object_id): - self.cdist_type = cdist_type # instance of Type + self.cdist_type = cdist_type # instance of Type self.base_path = base_path self.object_id = object_id @@ -74,7 +78,8 @@ class CdistObject(object): self.sanitise_object_id() self.name = self.join_name(self.cdist_type.name, self.object_id) - self.path = os.path.join(self.cdist_type.path, self.object_id, self.object_marker) + self.path = os.path.join(self.cdist_type.path, self.object_id, + self.object_marker) self.absolute_path = os.path.join(self.base_path, self.path) self.code_local_path = os.path.join(self.path, "code-local") @@ -84,12 +89,13 @@ class CdistObject(object): @classmethod def list_objects(cls, object_base_path, type_base_path, object_marker): """Return a list of object instances""" - for object_name in cls.list_object_names(object_base_path, object_marker): + for object_name in cls.list_object_names( + object_base_path, object_marker): type_name, object_id = cls.split_name(object_name) yield cls(cdist.core.CdistType(type_base_path, type_name), - base_path=object_base_path, - object_marker=object_marker, - object_id=object_id) + base_path=object_base_path, + object_marker=object_marker, + object_id=object_id) @classmethod def list_object_names(cls, object_base_path, object_marker): @@ -125,26 +131,34 @@ class CdistObject(object): def validate_object_id(self): if self.cdist_type.is_singleton and self.object_id: - raise IllegalObjectIdError('singleton objects can\'t have a object_id') + raise IllegalObjectIdError(('singleton objects can\'t have an ' + 'object_id')) - """Validate the given object_id and raise IllegalObjectIdError if it's not valid. + """Validate the given object_id and raise IllegalObjectIdError + if it's not valid. """ if self.object_id: if self.object_marker in self.object_id.split(os.sep): - raise IllegalObjectIdError(self.object_id, 'object_id may not contain \'%s\'' % self.object_marker) + raise IllegalObjectIdError( + self.object_id, ('object_id may not contain ' + '\'%s\'') % self.object_marker) if '//' in self.object_id: - raise IllegalObjectIdError(self.object_id, 'object_id may not contain //') + raise IllegalObjectIdError( + self.object_id, 'object_id may not contain //') if self.object_id == '.': - raise IllegalObjectIdError(self.object_id, 'object_id may not be a .') + raise IllegalObjectIdError( + self.object_id, 'object_id may not be a .') # If no object_id and type is not singleton => error out if not self.object_id and not self.cdist_type.is_singleton: raise MissingObjectIdError(self.cdist_type.name) - # Does not work: AttributeError: 'CdistObject' object has no attribute 'parameter_path' + # Does not work: + # AttributeError: + # 'CdistObject' object has no attribute 'parameter_path' - #"Type %s is not a singleton type - missing object id (parameters: %s)" % - # (self.cdist_type.name, self.parameters)) + # "Type %s is not a singleton type - missing object id + # (parameters: %s)" % (self.cdist_type.name, self.parameters)) def object_from_name(self, object_name): """Convenience method for creating an object instance from an object name. @@ -152,7 +166,8 @@ class CdistObject(object): Mainly intended to create objects when resolving requirements. e.g: - .object_from_name('__other/object') -> + .object_from_name('__other/object') -> + """ @@ -164,7 +179,8 @@ class CdistObject(object): cdist_type = self.cdist_type.__class__(type_path, type_name) - return self.__class__(cdist_type, base_path, object_marker, object_id=object_id) + return self.__class__(cdist_type, base_path, object_marker, + object_id=object_id) def __repr__(self): return '' % self.name @@ -172,7 +188,7 @@ class CdistObject(object): def __eq__(self, other): """define equality as 'name is the same'""" return self.name == other.name - + def __hash__(self): return hash(self.name) @@ -205,14 +221,22 @@ class CdistObject(object): # return relative path return os.path.join(self.path, "explorer") - requirements = fsproperty.FileListProperty(lambda obj: os.path.join(obj.absolute_path, 'require')) - autorequire = fsproperty.FileListProperty(lambda obj: os.path.join(obj.absolute_path, 'autorequire')) - parameters = fsproperty.DirectoryDictProperty(lambda obj: os.path.join(obj.base_path, obj.parameter_path)) - explorers = fsproperty.DirectoryDictProperty(lambda obj: os.path.join(obj.base_path, obj.explorer_path)) - state = fsproperty.FileStringProperty(lambda obj: os.path.join(obj.absolute_path, "state")) - source = fsproperty.FileListProperty(lambda obj: os.path.join(obj.absolute_path, "source")) - code_local = fsproperty.FileStringProperty(lambda obj: os.path.join(obj.base_path, obj.code_local_path)) - code_remote = fsproperty.FileStringProperty(lambda obj: os.path.join(obj.base_path, obj.code_remote_path)) + requirements = fsproperty.FileListProperty( + lambda obj: os.path.join(obj.absolute_path, 'require')) + autorequire = fsproperty.FileListProperty( + lambda obj: os.path.join(obj.absolute_path, 'autorequire')) + parameters = fsproperty.DirectoryDictProperty( + lambda obj: os.path.join(obj.base_path, obj.parameter_path)) + explorers = fsproperty.DirectoryDictProperty( + lambda obj: os.path.join(obj.base_path, obj.explorer_path)) + state = fsproperty.FileStringProperty( + lambda obj: os.path.join(obj.absolute_path, "state")) + source = fsproperty.FileListProperty( + lambda obj: os.path.join(obj.absolute_path, "source")) + code_local = fsproperty.FileStringProperty( + lambda obj: os.path.join(obj.base_path, obj.code_local_path)) + code_remote = fsproperty.FileStringProperty( + lambda obj: os.path.join(obj.base_path, obj.code_remote_path)) @property def exists(self): @@ -224,10 +248,12 @@ class CdistObject(object): """ try: os.makedirs(self.absolute_path, exist_ok=allow_overwrite) - absolute_parameter_path = os.path.join(self.base_path, self.parameter_path) + absolute_parameter_path = os.path.join(self.base_path, + self.parameter_path) os.makedirs(absolute_parameter_path, exist_ok=allow_overwrite) except EnvironmentError as error: - raise cdist.Error('Error creating directories for cdist object: %s: %s' % (self, error)) + raise cdist.Error(('Error creating directories for cdist object: ' + '%s: %s') % (self, error)) def requirements_unfinished(self, requirements): """Return state whether requirements are satisfied""" diff --git a/cdist/core/cdist_type.py b/cdist/core/cdist_type.py index d5b4ea3e..a548f365 100644 --- a/cdist/core/cdist_type.py +++ b/cdist/core/cdist_type.py @@ -24,6 +24,7 @@ import os import cdist + class NoSuchTypeError(cdist.Error): def __init__(self, name, type_path, type_absolute_path): self.name = name @@ -31,7 +32,8 @@ class NoSuchTypeError(cdist.Error): self.type_absolute_path = type_absolute_path def __str__(self): - return "Type '%s' does not exist at %s" % (self.type_path, self.type_absolute_path) + return "Type '%s' does not exist at %s" % ( + self.type_path, self.type_absolute_path) class CdistType(object): @@ -75,13 +77,13 @@ class CdistType(object): """Return a list of type names""" return os.listdir(base_path) - _instances = {} + def __new__(cls, *args, **kwargs): """only one instance of each named type may exist""" # name is second argument name = args[1] - if not name in cls._instances: + if name not in cls._instances: instance = super(CdistType, cls).__new__(cls) cls._instances[name] = instance # return instance so __init__ is called @@ -103,7 +105,8 @@ class CdistType(object): @property def is_install(self): - """Check whether a type is used for installation (if not: for configuration)""" + """Check whether a type is used for installation + (if not: for configuration)""" return os.path.isfile(os.path.join(self.absolute_path, "install")) @property @@ -111,7 +114,8 @@ class CdistType(object): """Return a list of available explorers""" if not self.__explorers: try: - self.__explorers = os.listdir(os.path.join(self.absolute_path, "explorer")) + self.__explorers = os.listdir(os.path.join(self.absolute_path, + "explorer")) except EnvironmentError: # error ignored self.__explorers = [] @@ -123,7 +127,9 @@ class CdistType(object): if not self.__required_parameters: parameters = [] try: - with open(os.path.join(self.absolute_path, "parameter", "required")) as fd: + with open(os.path.join(self.absolute_path, + "parameter", + "required")) as fd: for line in fd: parameters.append(line.strip()) except EnvironmentError: @@ -139,7 +145,9 @@ class CdistType(object): if not self.__required_multiple_parameters: parameters = [] try: - with open(os.path.join(self.absolute_path, "parameter", "required_multiple")) as fd: + with open(os.path.join(self.absolute_path, + "parameter", + "required_multiple")) as fd: for line in fd: parameters.append(line.strip()) except EnvironmentError: @@ -155,7 +163,9 @@ class CdistType(object): if not self.__optional_parameters: parameters = [] try: - with open(os.path.join(self.absolute_path, "parameter", "optional")) as fd: + with open(os.path.join(self.absolute_path, + "parameter", + "optional")) as fd: for line in fd: parameters.append(line.strip()) except EnvironmentError: @@ -171,7 +181,9 @@ class CdistType(object): if not self.__optional_multiple_parameters: parameters = [] try: - with open(os.path.join(self.absolute_path, "parameter", "optional_multiple")) as fd: + with open(os.path.join(self.absolute_path, + "parameter", + "optional_multiple")) as fd: for line in fd: parameters.append(line.strip()) except EnvironmentError: @@ -187,7 +199,9 @@ class CdistType(object): if not self.__boolean_parameters: parameters = [] try: - with open(os.path.join(self.absolute_path, "parameter", "boolean")) as fd: + with open(os.path.join(self.absolute_path, + "parameter", + "boolean")) as fd: for line in fd: parameters.append(line.strip()) except EnvironmentError: @@ -202,7 +216,9 @@ class CdistType(object): if not self.__parameter_defaults: defaults = {} try: - defaults_dir = os.path.join(self.absolute_path, "parameter", "default") + defaults_dir = os.path.join(self.absolute_path, + "parameter", + "default") for name in os.listdir(defaults_dir): try: with open(os.path.join(defaults_dir, name)) as fd: diff --git a/cdist/core/code.py b/cdist/core/code.py index 64517532..8e3cd63e 100644 --- a/cdist/core/code.py +++ b/cdist/core/code.py @@ -37,15 +37,17 @@ common: PATH: prepend directory with type emulator symlinks == local.bin_path __target_host: the target host we are working on __cdist_manifest: full qualified path of the manifest == script - __cdist_type_base_path: full qualified path to the directory where types are defined for use in type emulator - == local.type_path + __cdist_type_base_path: full qualified path to the directory where + types are defined for use in type emulator + == local.type_path gencode-local script: full qualified path to a types gencode-local env: __target_host: the target host we are working on - __global: full qualified path to the global output dir == local.out_path + __global: full qualified path to the global + output dir == local.out_path __object: full qualified path to the object's dir __object_id: the objects id __object_fq: full qualified object id, iow: $type.name + / + object_id @@ -59,7 +61,8 @@ gencode-remote env: __target_host: the target host we are working on - __global: full qualified path to the global output dir == local.out_path + __global: full qualified path to the global + output dir == local.out_path __object: full qualified path to the object's dir __object_id: the objects id __object_fq: full qualified object id, iow: $type.name + / + object_id @@ -98,7 +101,8 @@ class Code(object): def _run_gencode(self, cdist_object, which): cdist_type = cdist_object.cdist_type - script = os.path.join(self.local.type_path, getattr(cdist_type, 'gencode_%s_path' % which)) + script = os.path.join(self.local.type_path, + getattr(cdist_type, 'gencode_%s_path' % which)) if os.path.isfile(script): env = os.environ.copy() env.update(self.env) @@ -108,8 +112,9 @@ class Code(object): '__object_id': cdist_object.object_id, '__object_name': cdist_object.name, }) - message_prefix=cdist_object.name - return self.local.run_script(script, env=env, return_output=True, message_prefix=message_prefix) + message_prefix = cdist_object.name + return self.local.run_script(script, env=env, return_output=True, + message_prefix=message_prefix) def run_gencode_local(self, cdist_object): """Run the gencode-local script for the given cdist object.""" @@ -120,21 +125,26 @@ class Code(object): return self._run_gencode(cdist_object, 'remote') def transfer_code_remote(self, cdist_object): - """Transfer the code_remote script for the given object to the remote side.""" - source = os.path.join(self.local.object_path, cdist_object.code_remote_path) - destination = os.path.join(self.remote.object_path, cdist_object.code_remote_path) + """Transfer the code_remote script for the given object to the + remote side.""" + source = os.path.join(self.local.object_path, + cdist_object.code_remote_path) + destination = os.path.join(self.remote.object_path, + cdist_object.code_remote_path) # FIXME: BUG: do not create destination, but top level of destination! self.remote.mkdir(destination) self.remote.transfer(source, destination) def _run_code(self, cdist_object, which, env=None): which_exec = getattr(self, which) - script = os.path.join(which_exec.object_path, getattr(cdist_object, 'code_%s_path' % which)) + script = os.path.join(which_exec.object_path, + getattr(cdist_object, 'code_%s_path' % which)) return which_exec.run_script(script, env=env) def run_code_local(self, cdist_object): """Run the code-local script for the given cdist object.""" - # Put some env vars, to allow read only access to the parameters over $__object + # Put some env vars, to allow read only access to the parameters + # over $__object env = os.environ.copy() env.update(self.env) env.update({ @@ -144,10 +154,13 @@ class Code(object): return self._run_code(cdist_object, 'local', env=env) def run_code_remote(self, cdist_object): - """Run the code-remote script for the given cdist object on the remote side.""" - # Put some env vars, to allow read only access to the parameters over $__object which is already on the remote side + """Run the code-remote script for the given cdist object on the + remote side.""" + # Put some env vars, to allow read only access to the parameters + # over $__object which is already on the remote side env = { - '__object': os.path.join(self.remote.object_path, cdist_object.path), + '__object': os.path.join(self.remote.object_path, + cdist_object.path), '__object_id': cdist_object.object_id, } return self._run_code(cdist_object, 'remote', env=env) diff --git a/cdist/core/explorer.py b/cdist/core/explorer.py index 41851bd6..345f45ff 100644 --- a/cdist/core/explorer.py +++ b/cdist/core/explorer.py @@ -31,7 +31,8 @@ common: runs only remotely, needs local and remote to construct paths env: - __explorer: full qualified path to other global explorers on remote side + __explorer: full qualified path to other global explorers on + remote side -> remote.global_explorer_path a global explorer is: @@ -52,7 +53,8 @@ type explorer is: __object: full qualified path to the object's remote dir __object_id: the objects id __object_fq: full qualified object id, iow: $type.name + / + object_id - __type_explorer: full qualified path to the other type explorers on remote side + __type_explorer: full qualified path to the other type explorers on + remote side creates: nothing, returns output @@ -76,7 +78,7 @@ class Explorer(object): } self._type_explorers_transferred = [] - ### global + # global def list_global_explorer_names(self): """Return a list of global explorer names.""" @@ -98,15 +100,17 @@ class Explorer(object): def transfer_global_explorers(self): """Transfer the global explorers to the remote side.""" self.remote.mkdir(self.remote.global_explorer_path) - self.remote.transfer(self.local.global_explorer_path, self.remote.global_explorer_path) - self.remote.run(["chmod", "0700", "%s/*" % (self.remote.global_explorer_path)]) + self.remote.transfer(self.local.global_explorer_path, + self.remote.global_explorer_path) + self.remote.run(["chmod", "0700", + "%s/*" % (self.remote.global_explorer_path)]) def run_global_explorer(self, explorer): """Run the given global explorer and return it's output.""" script = os.path.join(self.remote.global_explorer_path, explorer) return self.remote.run_script(script, env=self.env, return_output=True) - ### type + # type def list_type_explorer_names(self, cdist_type): """Return a list of explorer names for the given type.""" @@ -121,37 +125,48 @@ class Explorer(object): in the object. """ - self.log.debug("Transfering type explorers for type: %s", cdist_object.cdist_type) + self.log.debug("Transfering type explorers for type: %s", + cdist_object.cdist_type) self.transfer_type_explorers(cdist_object.cdist_type) - self.log.debug("Transfering object parameters for object: %s", cdist_object.name) + self.log.debug("Transfering object parameters for object: %s", + cdist_object.name) self.transfer_object_parameters(cdist_object) for explorer in self.list_type_explorer_names(cdist_object.cdist_type): output = self.run_type_explorer(explorer, cdist_object) - self.log.debug("Running type explorer '%s' for object '%s'", explorer, cdist_object.name) + self.log.debug("Running type explorer '%s' for object '%s'", + explorer, cdist_object.name) cdist_object.explorers[explorer] = output def run_type_explorer(self, explorer, cdist_object): - """Run the given type explorer for the given object and return it's output.""" + """Run the given type explorer for the given object and return + it's output.""" cdist_type = cdist_object.cdist_type env = self.env.copy() env.update({ - '__object': os.path.join(self.remote.object_path, cdist_object.path), + '__object': os.path.join(self.remote.object_path, + cdist_object.path), '__object_id': cdist_object.object_id, '__object_name': cdist_object.name, '__object_fq': cdist_object.path, - '__type_explorer': os.path.join(self.remote.type_path, cdist_type.explorer_path) + '__type_explorer': os.path.join(self.remote.type_path, + cdist_type.explorer_path) }) - script = os.path.join(self.remote.type_path, cdist_type.explorer_path, explorer) + script = os.path.join(self.remote.type_path, cdist_type.explorer_path, + explorer) return self.remote.run_script(script, env=env, return_output=True) def transfer_type_explorers(self, cdist_type): - """Transfer the type explorers for the given type to the remote side.""" + """Transfer the type explorers for the given type to the + remote side.""" if cdist_type.explorers: if cdist_type.name in self._type_explorers_transferred: - self.log.debug("Skipping retransfer of type explorers for: %s", cdist_type) + self.log.debug("Skipping retransfer of type explorers for: %s", + cdist_type) else: - source = os.path.join(self.local.type_path, cdist_type.explorer_path) - destination = os.path.join(self.remote.type_path, cdist_type.explorer_path) + source = os.path.join(self.local.type_path, + cdist_type.explorer_path) + destination = os.path.join(self.remote.type_path, + cdist_type.explorer_path) self.remote.mkdir(destination) self.remote.transfer(source, destination) self.remote.run(["chmod", "0700", "%s/*" % (destination)]) @@ -160,7 +175,9 @@ class Explorer(object): def transfer_object_parameters(self, cdist_object): """Transfer the parameters for the given object to the remote side.""" if cdist_object.parameters: - source = os.path.join(self.local.object_path, cdist_object.parameter_path) - destination = os.path.join(self.remote.object_path, cdist_object.parameter_path) + source = os.path.join(self.local.object_path, + cdist_object.parameter_path) + destination = os.path.join(self.remote.object_path, + cdist_object.parameter_path) self.remote.mkdir(destination) self.remote.transfer(source, destination) diff --git a/cdist/core/manifest.py b/cdist/core/manifest.py index 3b71a215..ac322101 100644 --- a/cdist/core/manifest.py +++ b/cdist/core/manifest.py @@ -32,9 +32,11 @@ common: env: PATH: prepend directory with type emulator symlinks == local.bin_path __target_host: the target host we are working on - __global: full qualified path to the global output dir == local.out_path + __global: full qualified path to the global + output dir == local.out_path __cdist_manifest: full qualified path of the manifest == script - __cdist_type_base_path: full qualified path to the directory where types are defined for use in type emulator + __cdist_type_base_path: full qualified path to the directory where + types are defined for use in type emulator == local.type_path __files: full qualified path to the files dir @@ -58,6 +60,7 @@ type manifeste is: creates: new objects through type emulator ''' + class NoInitialManifestError(cdist.Error): """ Display missing initial manifest: @@ -72,7 +75,9 @@ class NoInitialManifestError(cdist.Error): if user_supplied: if os.path.islink(manifest_path): - self.message = "%s: %s -> %s" % (msg_header, manifest_path, os.path.realpath(manifest_path)) + self.message = "%s: %s -> %s" % ( + msg_header, manifest_path, + os.path.realpath(manifest_path)) else: self.message = "%s: %s" % (msg_header, manifest_path) else: @@ -94,14 +99,15 @@ class Manifest(object): self.env = { 'PATH': "%s:%s" % (self.local.bin_path, os.environ['PATH']), - '__cdist_type_base_path': self.local.type_path, # for use in type emulator + # for use in type emulator + '__cdist_type_base_path': self.local.type_path, '__global': self.local.base_path, '__target_host': self.target_host, '__files': self.local.files_path, } - if self.log.getEffectiveLevel() == logging.DEBUG: - self.env.update({'__cdist_debug': "yes" }) + if self.log.getEffectiveLevel() == logging.DEBUG: + self.env.update({'__cdist_debug': "yes"}) def env_initial_manifest(self, initial_manifest): env = os.environ.copy() @@ -124,11 +130,14 @@ class Manifest(object): if not os.path.isfile(initial_manifest): raise NoInitialManifestError(initial_manifest, user_supplied) - message_prefix="initialmanifest" - self.local.run_script(initial_manifest, env=self.env_initial_manifest(initial_manifest), message_prefix=message_prefix) + message_prefix = "initialmanifest" + self.local.run_script(initial_manifest, + env=self.env_initial_manifest(initial_manifest), + message_prefix=message_prefix) def env_type_manifest(self, cdist_object): - type_manifest = os.path.join(self.local.type_path, cdist_object.cdist_type.manifest_path) + type_manifest = os.path.join(self.local.type_path, + cdist_object.cdist_type.manifest_path) env = os.environ.copy() env.update(self.env) env.update({ @@ -143,7 +152,10 @@ class Manifest(object): return env def run_type_manifest(self, cdist_object): - type_manifest = os.path.join(self.local.type_path, cdist_object.cdist_type.manifest_path) + type_manifest = os.path.join(self.local.type_path, + cdist_object.cdist_type.manifest_path) message_prefix = cdist_object.name if os.path.isfile(type_manifest): - self.local.run_script(type_manifest, env=self.env_type_manifest(cdist_object), message_prefix=message_prefix) + self.local.run_script(type_manifest, + env=self.env_type_manifest(cdist_object), + message_prefix=message_prefix) diff --git a/cdist/emulator.py b/cdist/emulator.py index 0e4a41c4..58ab7389 100644 --- a/cdist/emulator.py +++ b/cdist/emulator.py @@ -29,10 +29,12 @@ import sys import cdist from cdist import core + class MissingRequiredEnvironmentVariableError(cdist.Error): def __init__(self, name): self.name = name - self.message = "Emulator requires the environment variable %s to be setup" % self.name + self.message = ("Emulator requires the environment variable %s to be " + "setup" % self.name) def __str__(self): return self.message @@ -41,7 +43,7 @@ class MissingRequiredEnvironmentVariableError(cdist.Error): class DefaultList(list): """Helper class to allow default values for optional_multiple parameters. - @see https://groups.google.com/forum/#!msg/comp.lang.python/sAUvkJEDpRc/RnRymrzJVDYJ + @see https://groups.google.com/forum/#!msg/comp.lang.python/sAUvkJEDpRc/RnRymrzJVDYJ """ def __copy__(self): return [] @@ -54,20 +56,20 @@ class DefaultList(list): class Emulator(object): def __init__(self, argv, stdin=sys.stdin.buffer, env=os.environ): - self.argv = argv - self.stdin = stdin - self.env = env + self.argv = argv + self.stdin = stdin + self.env = env - self.object_id = '' + self.object_id = '' try: - self.global_path = self.env['__global'] - self.target_host = self.env['__target_host'] + self.global_path = self.env['__global'] + self.target_host = self.env['__target_host'] # Internal variables - self.object_source = self.env['__cdist_manifest'] + self.object_source = self.env['__cdist_manifest'] self.type_base_path = self.env['__cdist_type_base_path'] - self.object_marker = self.env['__cdist_object_marker'] + self.object_marker = self.env['__cdist_object_marker'] except KeyError as e: raise MissingRequiredEnvironmentVariableError(e.args[0]) @@ -75,8 +77,8 @@ class Emulator(object): self.object_base_path = os.path.join(self.global_path, "object") self.typeorder_path = os.path.join(self.global_path, "typeorder") - self.type_name = os.path.basename(argv[0]) - self.cdist_type = core.CdistType(self.type_base_path, self.type_name) + self.type_name = os.path.basename(argv[0]) + self.cdist_type = core.CdistType(self.type_base_path, self.type_name) self.__init_log() @@ -88,7 +90,8 @@ class Emulator(object): self.save_stdin() self.record_requirements() self.record_auto_requirements() - self.log.debug("Finished %s %s" % (self.cdist_object.path, self.parameters)) + self.log.debug("Finished %s %s" % ( + self.cdist_object.path, self.parameters)) def __init_log(self): """Setup logging facility""" @@ -98,30 +101,38 @@ class Emulator(object): else: logging.root.setLevel(logging.INFO) - self.log = logging.getLogger(self.target_host) + self.log = logging.getLogger(self.target_host) def commandline(self): """Parse command line""" - parser = argparse.ArgumentParser(add_help=False, argument_default=argparse.SUPPRESS) + parser = argparse.ArgumentParser(add_help=False, + argument_default=argparse.SUPPRESS) for parameter in self.cdist_type.required_parameters: argument = "--" + parameter - parser.add_argument(argument, dest=parameter, action='store', required=True) + parser.add_argument(argument, dest=parameter, action='store', + required=True) for parameter in self.cdist_type.required_multiple_parameters: argument = "--" + parameter - parser.add_argument(argument, dest=parameter, action='append', required=True) + parser.add_argument(argument, dest=parameter, action='append', + required=True) for parameter in self.cdist_type.optional_parameters: argument = "--" + parameter - parser.add_argument(argument, dest=parameter, action='store', required=False, - default=self.cdist_type.parameter_defaults.get(parameter, None)) + default = self.cdist_type.parameter_defaults.get(parameter, None) + parser.add_argument(argument, dest=parameter, action='store', + required=False, default=default) for parameter in self.cdist_type.optional_multiple_parameters: argument = "--" + parameter - parser.add_argument(argument, dest=parameter, action='append', required=False, - default=DefaultList.create(self.cdist_type.parameter_defaults.get(parameter, None))) + default = DefaultList.create( + self.cdist_type.parameter_defaults.get( + parameter, None)) + parser.add_argument(argument, dest=parameter, action='append', + required=False, default=default) for parameter in self.cdist_type.boolean_parameters: argument = "--" + parameter - parser.add_argument(argument, dest=parameter, action='store_const', const='') + parser.add_argument(argument, dest=parameter, + action='store_const', const='') # If not singleton support one positional parameter if not self.cdist_type.is_singleton: @@ -140,30 +151,33 @@ class Emulator(object): del self.args.object_id # Instantiate the cdist object we are defining - self.cdist_object = core.CdistObject(self.cdist_type, - self.object_base_path, self.object_marker, self.object_id) + self.cdist_object = core.CdistObject( + self.cdist_type, self.object_base_path, self.object_marker, + self.object_id) # Create object with given parameters self.parameters = {} - for key,value in vars(self.args).items(): + for key, value in vars(self.args).items(): if value is not None: self.parameters[key] = value - if self.cdist_object.exists and not 'CDIST_OVERRIDE' in self.env: + if self.cdist_object.exists and 'CDIST_OVERRIDE' not in self.env: # make existing requirements a set, so we can compare it # later with new requirements if self.cdist_object.parameters != self.parameters: errmsg = ("Object %s already exists with conflicting " - "parameters:\n%s: %s\n%s: %s" % (self.cdist_object.name, - " ".join(self.cdist_object.source), - self.cdist_object.parameters, - self.object_source, - self.parameters)) + "parameters:\n%s: %s\n%s: %s" % ( + self.cdist_object.name, + " ".join(self.cdist_object.source), + self.cdist_object.parameters, + self.object_source, + self.parameters)) self.log.error(errmsg) raise cdist.Error(errmsg) else: if self.cdist_object.exists: - self.log.debug('Object %s override forced with CDIST_OVERRIDE',self.cdist_object.name) + self.log.debug(('Object %s override forced with ' + 'CDIST_OVERRIDE'), self.cdist_object.name) self.cdist_object.create(True) else: self.cdist_object.create() @@ -176,6 +190,7 @@ class Emulator(object): self.cdist_object.source.append(self.object_source) chunk_size = 65536 + def _read_stdin(self): return self.stdin.read(self.chunk_size) @@ -197,7 +212,6 @@ class Emulator(object): except EnvironmentError as e: raise cdist.Error('Failed to read from stdin: %s' % e) - def record_requirement(self, requirement): """record requirement and return recorded requirement""" @@ -206,13 +220,15 @@ class Emulator(object): cdist_object = self.cdist_object.object_from_name(requirement) except core.cdist_type.NoSuchTypeError as e: self.log.error(("%s requires object %s, but type %s does not" - " exist. Defined at %s" % (self.cdist_object.name, - requirement, e.name, self.object_source))) + " exist. Defined at %s" % ( + self.cdist_object.name, + requirement, e.name, self.object_source))) raise except core.cdist_object.MissingObjectIdError as e: self.log.error(("%s requires object %s without object id." - " Defined at %s" % (self.cdist_object.name, requirement, - self.object_source))) + " Defined at %s" % (self.cdist_object.name, + requirement, + self.object_source))) raise self.log.debug("Recording requirement: %s", requirement) @@ -224,12 +240,13 @@ class Emulator(object): return cdist_object.name - def record_requirements(self): """record requirements""" - # Inject the predecessor, but not if its an override (this would leed to an circular dependency) - if "CDIST_ORDER_DEPENDENCY" in self.env and not 'CDIST_OVERRIDE' in self.env: + # Inject the predecessor, but not if its an override + # (this would leed to an circular dependency) + if ("CDIST_ORDER_DEPENDENCY" in self.env and + 'CDIST_OVERRIDE' not in self.env): # load object name created bevor this one from typeorder file ... with open(self.typeorder_path, 'r') as typecreationfile: typecreationorder = typecreationfile.readlines() @@ -240,9 +257,12 @@ class Emulator(object): self.env['require'] += " " + lastcreatedtype else: self.env['require'] = lastcreatedtype - self.log.debug("Injecting require for CDIST_ORDER_DEPENDENCY: %s for %s", lastcreatedtype, self.cdist_object.name) + self.log.debug(("Injecting require for " + "CDIST_ORDER_DEPENDENCY: %s for %s"), + lastcreatedtype, self.cdist_object.name) except IndexError: - # if no second last line, we are on the first type, so do not set a requirement + # if no second last line, we are on the first type, + # so do not set a requirement pass if "require" in self.env: @@ -250,22 +270,25 @@ class Emulator(object): self.log.debug("reqs = " + requirements) for requirement in requirements.split(" "): # Ignore empty fields - probably the only field anyway - if len(requirement) == 0: continue + if len(requirement) == 0: + continue self.record_requirement(requirement) - def record_auto_requirements(self): - """An object shall automatically depend on all objects that it defined in it's type manifest. + """An object shall automatically depend on all objects that it + defined in it's type manifest. """ - # __object_name is the name of the object whose type manifest is currently executed + # __object_name is the name of the object whose type manifest is + # currently executed __object_name = self.env.get('__object_name', None) if __object_name: # The object whose type manifest is currently run parent = self.cdist_object.object_from_name(__object_name) # The object currently being defined current_object = self.cdist_object - # As parent defined current_object it shall automatically depend on it. + # As parent defined current_object it shall automatically + # depend on it. # But only if the user hasn't said otherwise. # Must prevent circular dependencies. - if not parent.name in current_object.requirements: + if parent.name not in current_object.requirements: parent.autorequire.append(current_object.name) diff --git a/cdist/exec/local.py b/cdist/exec/local.py index 5a0a8644..48067543 100644 --- a/cdist/exec/local.py +++ b/cdist/exec/local.py @@ -35,7 +35,8 @@ import cdist.message from cdist import core import cdist.exec.util as exec_util -CONF_SUBDIRS_LINKED = [ "explorer", "files", "manifest", "type" ] +CONF_SUBDIRS_LINKED = ["explorer", "files", "manifest", "type", ] + class Local(object): """Execute commands locally. @@ -82,7 +83,8 @@ class Local(object): @property def dist_conf_dir(self): - return os.path.abspath(os.path.join(os.path.dirname(cdist.__file__), "conf")) + return os.path.abspath(os.path.join(os.path.dirname(cdist.__file__), + "conf")) @property def home_dir(self): @@ -109,7 +111,8 @@ class Local(object): # Depending on out_path self.bin_path = os.path.join(self.base_path, "bin") self.conf_path = os.path.join(self.base_path, "conf") - self.global_explorer_out_path = os.path.join(self.base_path, "explorer") + self.global_explorer_out_path = os.path.join(self.base_path, + "explorer") self.object_path = os.path.join(self.base_path, "object") self.messages_path = os.path.join(self.base_path, "messages") self.files_path = os.path.join(self.conf_path, "files") @@ -118,7 +121,7 @@ class Local(object): self.global_explorer_path = os.path.join(self.conf_path, "explorer") self.manifest_path = os.path.join(self.conf_path, "manifest") self.initial_manifest = (self.custom_initial_manifest or - os.path.join(self.manifest_path, "init")) + os.path.join(self.manifest_path, "init")) self.type_path = os.path.join(self.conf_path, "type") @@ -164,8 +167,8 @@ class Local(object): with open(self.object_marker_file, 'w') as fd: fd.write("%s\n" % self.object_marker_name) - self.log.debug("Object marker %s saved in %s" % (self.object_marker_name, self.object_marker_file)) - + self.log.debug("Object marker %s saved in %s" % ( + self.object_marker_name, self.object_marker_file)) def _init_cache_dir(self, cache_dir): if cache_dir: @@ -174,7 +177,8 @@ class Local(object): if self.home_dir: self.cache_path = os.path.join(self.home_dir, "cache") else: - raise cdist.Error("No homedir setup and no cache dir location given") + raise cdist.Error( + "No homedir setup and no cache dir location given") def rmdir(self, path): """Remove directory on the local side.""" @@ -192,7 +196,8 @@ class Local(object): """ self.log.debug("Local run: %s", command) - assert isinstance(command, (list, tuple)), "list or tuple argument expected, got: %s" % command + assert isinstance(command, (list, tuple)), ( + "list or tuple argument expected, got: %s" % command) if env is None: env = os.environ.copy() @@ -220,16 +225,17 @@ class Local(object): if message_prefix: message.merge_messages() - def run_script(self, script, env=None, return_output=False, message_prefix=None): + def run_script(self, script, env=None, return_output=False, + message_prefix=None): """Run the given script with the given environment. Return the output as a string. """ - command = [ os.environ.get('CDIST_LOCAL_SHELL',"/bin/sh") , "-e"] + command = [os.environ.get('CDIST_LOCAL_SHELL', "/bin/sh"), "-e"] command.append(script) - return self.run(command=command, env=env, return_output=return_output, message_prefix=message_prefix) - + return self.run(command=command, env=env, return_output=return_output, + message_prefix=message_prefix) def save_cache(self): destination = os.path.join(self.cache_path, self.hostdir) @@ -239,7 +245,8 @@ class Local(object): if os.path.exists(destination): shutil.rmtree(destination) except PermissionError as e: - raise cdist.Error("Cannot delete old cache %s: %s" % (destination, e)) + raise cdist.Error( + "Cannot delete old cache %s: %s" % (destination, e)) shutil.move(self.base_path, destination) @@ -265,18 +272,21 @@ class Local(object): for entry in os.listdir(current_dir): rel_entry_path = os.path.join(sub_dir, entry) - src = os.path.abspath(os.path.join(conf_dir, sub_dir, entry)) + src = os.path.abspath(os.path.join(conf_dir, + sub_dir, + entry)) dst = os.path.join(self.conf_path, sub_dir, entry) # Already exists? remove and link if os.path.exists(dst): os.unlink(dst) - + self.log.debug("Linking %s to %s ..." % (src, dst)) try: os.symlink(src, dst) except OSError as e: - raise cdist.Error("Linking %s %s to %s failed: %s" % (sub_dir, src, dst, e.__str__())) + raise cdist.Error("Linking %s %s to %s failed: %s" % ( + sub_dir, src, dst, e.__str__())) def _link_types_for_emulator(self): """Link emulator to types""" @@ -288,4 +298,6 @@ class Local(object): try: os.symlink(src, dst) except OSError as e: - raise cdist.Error("Linking emulator from %s to %s failed: %s" % (src, dst, e.__str__())) + raise cdist.Error( + "Linking emulator from %s to %s failed: %s" % ( + src, dst, e.__str__())) diff --git a/cdist/exec/remote.py b/cdist/exec/remote.py index 0331f402..ff388e1d 100644 --- a/cdist/exec/remote.py +++ b/cdist/exec/remote.py @@ -30,6 +30,7 @@ import cdist.exec.util as exec_util import cdist + class DecodeError(cdist.Error): def __init__(self, command): self.command = command @@ -75,7 +76,6 @@ class Remote(object): os.environ['__remote_copy'] = self._copy os.environ['__remote_exec'] = self._exec - def create_files_dirs(self): self.rmdir(self.base_path) self.mkdir(self.base_path) @@ -101,11 +101,13 @@ class Remote(object): for f in glob.glob1(source, '*'): command = self._copy.split() path = os.path.join(source, f) - command.extend([path, '{0}:{1}'.format(self.target_host, destination)]) + command.extend([path, '{0}:{1}'.format( + self.target_host, destination)]) self._run_command(command) else: command = self._copy.split() - command.extend([source, '{0}:{1}'.format(self.target_host, destination)]) + command.extend([source, '{0}:{1}'.format( + self.target_host, destination)]) self._run_command(command) def run_script(self, script, env=None, return_output=False): @@ -114,7 +116,7 @@ class Remote(object): """ - command = [ os.environ.get('CDIST_REMOTE_SHELL',"/bin/sh") , "-e"] + command = [os.environ.get('CDIST_REMOTE_SHELL', "/bin/sh"), "-e"] command.append(script) return self.run(command, env, return_output) @@ -148,8 +150,8 @@ class Remote(object): # /bin/csh will execute this script in the right way. if env: remote_env = [" export %s=%s;" % item for item in env.items()] - string_cmd = ("/bin/sh -c '" + " ".join(remote_env) - + " ".join(command) + "'") + string_cmd = ("/bin/sh -c '" + " ".join(remote_env) + + " ".join(command) + "'") cmd.append(string_cmd) else: cmd.extend(command) @@ -160,7 +162,8 @@ class Remote(object): Return the output as a string. """ - assert isinstance(command, (list, tuple)), "list or tuple argument expected, got: %s" % command + assert isinstance(command, (list, tuple)), ( + "list or tuple argument expected, got: %s" % command) # export target_host for use in __remote_{exec,copy} scripts os_environ = os.environ.copy() diff --git a/cdist/exec/util.py b/cdist/exec/util.py index 15430f13..a1bca296 100644 --- a/cdist/exec/util.py +++ b/cdist/exec/util.py @@ -27,6 +27,7 @@ import cdist STDERR_UNSUPPORTED = 'Not supported in this python version' + def call_get_output(command, env=None): """Run the given command with the given environment. Return the tuple of stdout and stderr output as a byte strings. @@ -40,14 +41,16 @@ def call_get_output(command, env=None): else: return (call_get_stdout(command, env), STDERR_UNSUPPORTED) + def handle_called_process_error(err, command): if sys.version_info >= (3, 5): errout = err.stderr else: errout = STDERR_UNSUPPORTED - raise cdist.Error("Command failed: " + " ".join(command) - + " with returncode: {} and stdout: {}, stderr: {}".format( - err.returncode, err.output, errout)) + raise cdist.Error("Command failed: " + " ".join(command) + + " with returncode: {} and stdout: {}, stderr: {}".format( + err.returncode, err.output, errout)) + def call_get_stdout(command, env=None): """Run the given command with the given environment. @@ -63,6 +66,7 @@ def call_get_stdout(command, env=None): return output + def call_get_out_err(command, env=None): """Run the given command with the given environment. Return the tuple of stdout and stderr output as a byte strings. @@ -72,7 +76,7 @@ def call_get_out_err(command, env=None): with TemporaryFile() as fout, TemporaryFile() as ferr: subprocess.check_call(command, env=env, - stdout=fout, stderr=ferr) + stdout=fout, stderr=ferr) fout.seek(0) ferr.seek(0) output = (fout.read(), ferr.read()) diff --git a/cdist/log.py b/cdist/log.py index 8c3aac79..2341c282 100644 --- a/cdist/log.py +++ b/cdist/log.py @@ -22,6 +22,7 @@ import logging + class Log(logging.Logger): def __init__(self, name): diff --git a/cdist/message.py b/cdist/message.py index f9b0c313..98a6e8cf 100644 --- a/cdist/message.py +++ b/cdist/message.py @@ -37,8 +37,9 @@ class Message(object): self.prefix = prefix self.global_messages = messages - in_fd, self.messages_in = tempfile.mkstemp(suffix='.cdist_message_in') - out_fd, self.messages_out = tempfile.mkstemp(suffix='.cdist_message_out') + in_fd, self.messages_in = tempfile.mkstemp(suffix='.cdist_message_in') + out_fd, self.messages_out = tempfile.mkstemp( + suffix='.cdist_message_out') os.close(in_fd) os.close(out_fd) @@ -48,7 +49,7 @@ class Message(object): @property def env(self): env = {} - env['__messages_in'] = self.messages_in + env['__messages_in'] = self.messages_in env['__messages_out'] = self.messages_out return env diff --git a/cdist/shell.py b/cdist/shell.py index 83b2acf7..60faa2f8 100644 --- a/cdist/shell.py +++ b/cdist/shell.py @@ -31,8 +31,9 @@ import cdist.config log = logging.getLogger(__name__) + class Shell(object): - + def __init__(self, shell=None): self.shell = shell @@ -45,16 +46,17 @@ class Shell(object): """Select shell to execute, if not specified by user""" if not self.shell: - self.shell = os.environ.get('SHELL',"/bin/sh") + self.shell = os.environ.get('SHELL', "/bin/sh") def _init_files_dirs(self): self.local.create_files_dirs() def _init_environment(self): self.env = os.environ.copy() - additional_env = { + additional_env = { 'PATH': "%s:%s" % (self.local.bin_path, os.environ['PATH']), - '__cdist_type_base_path': self.local.type_path, # for use in type emulator + # for use in type emulator + '__cdist_type_base_path': self.local.type_path, '__cdist_manifest': "cdist shell", '__global': self.local.base_path, '__target_host': self.target_host, diff --git a/cdist/sphinxext/manpage.py b/cdist/sphinxext/manpage.py index 433f6a1b..97b41f03 100644 --- a/cdist/sphinxext/manpage.py +++ b/cdist/sphinxext/manpage.py @@ -14,12 +14,13 @@ from sphinx import addnodes but leaves everything to actual reStructuredText file content. """ + class ManualPageTranslator(sphinx.writers.manpage.ManualPageTranslator): - def header(self): - tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\"" - " \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n") - return tmpl % self._docinfo + def header(self): + tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\"" + " \"%(date)s\" \"%(version)s\" \"%(manual_group)s\"\n") + return tmpl % self._docinfo class ManualPageWriter(sphinx.writers.manpage.ManualPageWriter): @@ -76,5 +77,6 @@ class ManualPageBuilder(sphinx.builders.manpage.ManualPageBuilder): docwriter.write(largetree, destination) self.info() + def setup(app): app.add_builder(ManualPageBuilder) diff --git a/cdist/test/__init__.py b/cdist/test/__init__.py index ab767699..d9630f53 100644 --- a/cdist/test/__init__.py +++ b/cdist/test/__init__.py @@ -28,7 +28,9 @@ cdist_base_path = os.path.abspath( cdist_exec_path = os.path.join(cdist_base_path, "scripts/cdist") -global_fixtures_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "fixtures")) +global_fixtures_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), + "fixtures")) + class CdistTestCase(unittest.TestCase): diff --git a/cdist/test/banner/__init__.py b/cdist/test/banner/__init__.py index 4b0ab6ac..957b7b12 100644 --- a/cdist/test/banner/__init__.py +++ b/cdist/test/banner/__init__.py @@ -27,6 +27,7 @@ import unittest import cdist import cdist.banner + class Banner(unittest.TestCase): def setUp(self): self.banner = cdist.BANNER + "\n" @@ -38,5 +39,5 @@ class Banner(unittest.TestCase): sys.stdout = output cdist.banner.banner(None) - + self.assertEqual(output.getvalue(), self.banner) diff --git a/cdist/test/cdist_object/__init__.py b/cdist/test/cdist_object/__init__.py index 9c075acb..d03c0642 100644 --- a/cdist/test/cdist_object/__init__.py +++ b/cdist/test/cdist_object/__init__.py @@ -57,29 +57,37 @@ class ObjectClassTestCase(test.CdistTestCase): self.expected_objects = [] for cdist_object_name in expected_object_names: cdist_type, cdist_object_id = cdist_object_name.split("/", 1) - cdist_object = core.CdistObject(core.CdistType(type_base_path, cdist_type), self.object_base_path, - OBJECT_MARKER_NAME, cdist_object_id) + cdist_object = core.CdistObject(core.CdistType(type_base_path, + cdist_type), + self.object_base_path, + OBJECT_MARKER_NAME, + cdist_object_id) cdist_object.create() self.expected_objects.append(cdist_object) - + def tearDown(self): shutil.rmtree(self.tempdir) def test_list_object_names(self): - found_object_names = sorted(list(core.CdistObject.list_object_names(self.object_base_path, OBJECT_MARKER_NAME))) - self.assertEqual(found_object_names, expected_object_names) + found_object_names = sorted(list(core.CdistObject.list_object_names( + self.object_base_path, OBJECT_MARKER_NAME))) + self.assertEqual(found_object_names, expected_object_names) def test_list_type_names(self): - type_names = list(cdist.core.CdistObject.list_type_names(self.object_base_path)) - self.assertEqual(sorted(type_names), ['__first', '__second', '__third']) + type_names = list(cdist.core.CdistObject.list_type_names( + self.object_base_path)) + self.assertEqual(sorted(type_names), + ['__first', '__second', '__third']) def test_list_objects(self): - found_objects = sorted(list(core.CdistObject.list_objects(self.object_base_path, type_base_path, OBJECT_MARKER_NAME))) + found_objects = sorted(list(core.CdistObject.list_objects( + self.object_base_path, type_base_path, OBJECT_MARKER_NAME))) self.assertEqual(found_objects, self.expected_objects) def test_create_singleton(self): """Check whether creating an object without id (singleton) works""" - singleton = self.expected_objects[0].object_from_name("__test_singleton") + singleton = self.expected_objects[0].object_from_name( + "__test_singleton") # came here - everything fine def test_create_singleton_not_singleton_type(self): @@ -88,6 +96,7 @@ class ObjectClassTestCase(test.CdistTestCase): with self.assertRaises(cdist.core.cdist_object.MissingObjectIdError): self.expected_objects[0].object_from_name("__first") + class ObjectIdTestCase(test.CdistTestCase): def setUp(self): @@ -97,11 +106,14 @@ class ObjectIdTestCase(test.CdistTestCase): self.expected_objects = [] for cdist_object_name in expected_object_names: cdist_type, cdist_object_id = cdist_object_name.split("/", 1) - cdist_object = core.CdistObject(core.CdistType(type_base_path, cdist_type), self.object_base_path, - OBJECT_MARKER_NAME, cdist_object_id) + cdist_object = core.CdistObject(core.CdistType(type_base_path, + cdist_type), + self.object_base_path, + OBJECT_MARKER_NAME, + cdist_object_id) cdist_object.create() self.expected_objects.append(cdist_object) - + def tearDown(self): shutil.rmtree(self.tempdir) @@ -109,31 +121,39 @@ class ObjectIdTestCase(test.CdistTestCase): cdist_type = core.CdistType(type_base_path, '__third') illegal_object_id = '/object_id//may/not/contain/double/slash' with self.assertRaises(core.IllegalObjectIdError): - core.CdistObject(cdist_type, self.object_base_path, OBJECT_MARKER_NAME, illegal_object_id) + core.CdistObject(cdist_type, self.object_base_path, + OBJECT_MARKER_NAME, illegal_object_id) def test_object_id_contains_object_marker(self): cdist_type = core.CdistType(type_base_path, '__third') - illegal_object_id = 'object_id/may/not/contain/%s/anywhere' % OBJECT_MARKER_NAME + illegal_object_id = ( + 'object_id/may/not/contain/%s/anywhere' % OBJECT_MARKER_NAME) with self.assertRaises(core.IllegalObjectIdError): - core.CdistObject(cdist_type, self.object_base_path, OBJECT_MARKER_NAME, illegal_object_id) + core.CdistObject(cdist_type, self.object_base_path, + OBJECT_MARKER_NAME, illegal_object_id) def test_object_id_contains_object_marker_string(self): cdist_type = core.CdistType(type_base_path, '__third') - illegal_object_id = 'object_id/may/contain_%s_in_filename' % OBJECT_MARKER_NAME - core.CdistObject(cdist_type, self.object_base_path, OBJECT_MARKER_NAME, illegal_object_id) + illegal_object_id = ( + 'object_id/may/contain_%s_in_filename' % OBJECT_MARKER_NAME) + core.CdistObject(cdist_type, self.object_base_path, + OBJECT_MARKER_NAME, illegal_object_id) # if we get here, the test passed def test_object_id_contains_only_dot(self): cdist_type = core.CdistType(type_base_path, '__third') illegal_object_id = '.' with self.assertRaises(core.IllegalObjectIdError): - core.CdistObject(cdist_type, self.object_base_path, OBJECT_MARKER_NAME, illegal_object_id) + core.CdistObject(cdist_type, self.object_base_path, + OBJECT_MARKER_NAME, illegal_object_id) def test_object_id_on_singleton_type(self): cdist_type = core.CdistType(type_base_path, '__test_singleton') illegal_object_id = 'object_id' with self.assertRaises(core.IllegalObjectIdError): - core.CdistObject(cdist_type, self.object_base_path, OBJECT_MARKER_NAME, illegal_object_id) + core.CdistObject(cdist_type, self.object_base_path, + OBJECT_MARKER_NAME, illegal_object_id) + class ObjectTestCase(test.CdistTestCase): @@ -142,13 +162,14 @@ class ObjectTestCase(test.CdistTestCase): self.object_base_path = self.tempdir self.cdist_type = core.CdistType(type_base_path, '__third') - self.cdist_object = core.CdistObject(self.cdist_type, self.object_base_path, OBJECT_MARKER_NAME, 'moon') + self.cdist_object = core.CdistObject(self.cdist_type, + self.object_base_path, + OBJECT_MARKER_NAME, 'moon') self.cdist_object.create() self.cdist_object.parameters['planet'] = 'Saturn' self.cdist_object.parameters['name'] = 'Prometheus' - def tearDown(self): self.cdist_object.prepared = False self.cdist_object.ran = False @@ -166,22 +187,29 @@ class ObjectTestCase(test.CdistTestCase): self.assertEqual(self.cdist_object.object_id, 'moon') def test_path(self): - self.assertEqual(self.cdist_object.path, "__third/moon/%s" % OBJECT_MARKER_NAME) + self.assertEqual(self.cdist_object.path, + "__third/moon/%s" % OBJECT_MARKER_NAME) def test_absolute_path(self): - self.assertEqual(self.cdist_object.absolute_path, os.path.join(self.object_base_path, "__third/moon/%s" % OBJECT_MARKER_NAME)) + self.assertEqual(self.cdist_object.absolute_path, + os.path.join(self.object_base_path, + "__third/moon/%s" % OBJECT_MARKER_NAME)) def test_code_local_path(self): - self.assertEqual(self.cdist_object.code_local_path, "__third/moon/%s/code-local" % OBJECT_MARKER_NAME) + self.assertEqual(self.cdist_object.code_local_path, + "__third/moon/%s/code-local" % OBJECT_MARKER_NAME) def test_code_remote_path(self): - self.assertEqual(self.cdist_object.code_remote_path, "__third/moon/%s/code-remote" % OBJECT_MARKER_NAME) + self.assertEqual(self.cdist_object.code_remote_path, + "__third/moon/%s/code-remote" % OBJECT_MARKER_NAME) def test_parameter_path(self): - self.assertEqual(self.cdist_object.parameter_path, "__third/moon/%s/parameter" % OBJECT_MARKER_NAME) + self.assertEqual(self.cdist_object.parameter_path, + "__third/moon/%s/parameter" % OBJECT_MARKER_NAME) def test_explorer_path(self): - self.assertEqual(self.cdist_object.explorer_path, "__third/moon/%s/explorer" % OBJECT_MARKER_NAME) + self.assertEqual(self.cdist_object.explorer_path, + "__third/moon/%s/explorer" % OBJECT_MARKER_NAME) def test_parameters(self): expected_parameters = {'planet': 'Saturn', 'name': 'Prometheus'} @@ -190,32 +218,39 @@ class ObjectTestCase(test.CdistTestCase): def test_explorers(self): self.assertEqual(self.cdist_object.explorers, {}) - # FIXME: actually testing fsproperty.DirectoryDictProperty here, move to their own test case + # FIXME: actually testing fsproperty.DirectoryDictProperty here, + # move to their own test case def test_explorers_assign_dict(self): expected = {'first': 'foo', 'second': 'bar'} # when set, written to file self.cdist_object.explorers = expected - object_explorer_path = os.path.join(self.cdist_object.base_path, self.cdist_object.explorer_path) + object_explorer_path = os.path.join(self.cdist_object.base_path, + self.cdist_object.explorer_path) self.assertTrue(os.path.isdir(object_explorer_path)) # when accessed, read from file self.assertEqual(self.cdist_object.explorers, expected) # remove dynamically created folder self.cdist_object.explorers = {} - os.rmdir(os.path.join(self.cdist_object.base_path, self.cdist_object.explorer_path)) + os.rmdir(os.path.join(self.cdist_object.base_path, + self.cdist_object.explorer_path)) - # FIXME: actually testing fsproperty.DirectoryDictProperty here, move to their own test case + # FIXME: actually testing fsproperty.DirectoryDictProperty here, + # move to their own test case def test_explorers_assign_key_value(self): expected = {'first': 'foo', 'second': 'bar'} - object_explorer_path = os.path.join(self.cdist_object.base_path, self.cdist_object.explorer_path) - for key,value in expected.items(): + object_explorer_path = os.path.join(self.cdist_object.base_path, + self.cdist_object.explorer_path) + for key, value in expected.items(): # when set, written to file self.cdist_object.explorers[key] = value - self.assertTrue(os.path.isfile(os.path.join(object_explorer_path, key))) + self.assertTrue(os.path.isfile(os.path.join(object_explorer_path, + key))) # when accessed, read from file self.assertEqual(self.cdist_object.explorers, expected) # remove dynamically created folder self.cdist_object.explorers = {} - os.rmdir(os.path.join(self.cdist_object.base_path, self.cdist_object.explorer_path)) + os.rmdir(os.path.join(self.cdist_object.base_path, + self.cdist_object.explorer_path)) def test_requirements(self): expected = [] @@ -226,15 +261,18 @@ class ObjectTestCase(test.CdistTestCase): def test_state_prepared(self): self.cdist_object.state = core.CdistObject.STATE_PREPARED - self.assertEqual(self.cdist_object.state, core.CdistObject.STATE_PREPARED) + self.assertEqual(self.cdist_object.state, + core.CdistObject.STATE_PREPARED) def test_state_running(self): self.cdist_object.state = core.CdistObject.STATE_RUNNING - self.assertEqual(self.cdist_object.state, core.CdistObject.STATE_RUNNING) + self.assertEqual(self.cdist_object.state, + core.CdistObject.STATE_RUNNING) def test_state_done(self): self.cdist_object.state = core.CdistObject.STATE_DONE - self.assertEqual(self.cdist_object.state, core.CdistObject.STATE_DONE) + self.assertEqual(self.cdist_object.state, + core.CdistObject.STATE_DONE) def test_source(self): self.assertEqual(list(self.cdist_object.source), []) diff --git a/cdist/test/cdist_type/__init__.py b/cdist/test/cdist_type/__init__.py index ccbf6742..feb5fa15 100644 --- a/cdist/test/cdist_type/__init__.py +++ b/cdist/test/cdist_type/__init__.py @@ -34,7 +34,8 @@ class TypeTestCase(test.CdistTestCase): def test_list_type_names(self): base_path = op.join(fixtures, 'list_types') type_names = core.CdistType.list_type_names(base_path) - self.assertEqual(sorted(type_names), ['__first', '__second', '__third']) + self.assertEqual(sorted(type_names), + ['__first', '__second', '__third']) def test_list_types(self): base_path = op.join(fixtures, 'list_types') @@ -54,7 +55,8 @@ class TypeTestCase(test.CdistTestCase): def test_nonexistent_type(self): base_path = fixtures - self.assertRaises(core.NoSuchTypeError, core.CdistType, base_path, '__i-dont-exist') + self.assertRaises(core.NoSuchTypeError, core.CdistType, base_path, + '__i-dont-exist') def test_name(self): base_path = fixtures @@ -74,27 +76,32 @@ class TypeTestCase(test.CdistTestCase): def test_absolute_path(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__name_path') - self.assertEqual(cdist_type.absolute_path, os.path.join(base_path, '__name_path')) + self.assertEqual(cdist_type.absolute_path, + os.path.join(base_path, '__name_path')) def test_manifest_path(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__name_path') - self.assertEqual(cdist_type.manifest_path, os.path.join('__name_path', 'manifest')) + self.assertEqual(cdist_type.manifest_path, + os.path.join('__name_path', 'manifest')) def test_explorer_path(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__name_path') - self.assertEqual(cdist_type.explorer_path, os.path.join('__name_path', 'explorer')) + self.assertEqual(cdist_type.explorer_path, + os.path.join('__name_path', 'explorer')) def test_gencode_local_path(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__name_path') - self.assertEqual(cdist_type.gencode_local_path, os.path.join('__name_path', 'gencode-local')) + self.assertEqual(cdist_type.gencode_local_path, + os.path.join('__name_path', 'gencode-local')) def test_gencode_remote_path(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__name_path') - self.assertEqual(cdist_type.gencode_remote_path, os.path.join('__name_path', 'gencode-remote')) + self.assertEqual(cdist_type.gencode_remote_path, + os.path.join('__name_path', 'gencode-remote')) def test_singleton_is_singleton(self): base_path = fixtures @@ -119,17 +126,20 @@ class TypeTestCase(test.CdistTestCase): def test_with_required_parameters(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__with_required_parameters') - self.assertEqual(cdist_type.required_parameters, ['required1', 'required2']) + self.assertEqual(cdist_type.required_parameters, + ['required1', 'required2']) def test_without_required_parameters(self): base_path = fixtures - cdist_type = core.CdistType(base_path, '__without_required_parameters') + cdist_type = core.CdistType(base_path, + '__without_required_parameters') self.assertEqual(cdist_type.required_parameters, []) def test_with_optional_parameters(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__with_optional_parameters') - self.assertEqual(cdist_type.optional_parameters, ['optional1', 'optional2']) + self.assertEqual(cdist_type.optional_parameters, + ['optional1', 'optional2']) def test_without_optional_parameters(self): base_path = fixtures @@ -139,7 +149,8 @@ class TypeTestCase(test.CdistTestCase): def test_with_boolean_parameters(self): base_path = fixtures cdist_type = core.CdistType(base_path, '__with_boolean_parameters') - self.assertEqual(cdist_type.boolean_parameters, ['boolean1', 'boolean2']) + self.assertEqual(cdist_type.boolean_parameters, + ['boolean1', 'boolean2']) def test_without_boolean_parameters(self): base_path = fixtures @@ -158,5 +169,4 @@ class TypeTestCase(test.CdistTestCase): cdist_type = core.CdistType(base_path, '__directory_in_default') self.assertEqual( list(sorted(cdist_type.parameter_defaults.keys())), - ['bar', 'foo'] - ) + ['bar', 'foo']) diff --git a/cdist/test/code/__init__.py b/cdist/test/code/__init__.py index 811d3a33..7ec9e3c4 100644 --- a/cdist/test/code/__init__.py +++ b/cdist/test/code/__init__.py @@ -36,15 +36,16 @@ my_dir = op.abspath(op.dirname(__file__)) fixtures = op.join(my_dir, 'fixtures') conf_dir = op.join(fixtures, 'conf') + class CodeTestCase(test.CdistTestCase): def setUp(self): self.local_dir = self.mkdtemp() self.local = local.Local( - target_host=self.target_host, - base_path = self.local_dir, - exec_path = cdist.test.cdist_exec_path, + target_host=self.target_host, + base_path=self.local_dir, + exec_path=cdist.test.cdist_exec_path, add_conf_dirs=[conf_dir]) self.local.create_files_dirs() @@ -52,16 +53,19 @@ class CodeTestCase(test.CdistTestCase): remote_exec = self.remote_exec remote_copy = self.remote_copy self.remote = remote.Remote( - target_host=self.target_host, - remote_exec=remote_exec, + target_host=self.target_host, + remote_exec=remote_exec, remote_copy=remote_copy, base_path=self.remote_dir) self.remote.create_files_dirs() self.code = code.Code(self.target_host, self.local, self.remote) - self.cdist_type = core.CdistType(self.local.type_path, '__dump_environment') - self.cdist_object = core.CdistObject(self.cdist_type, self.local.object_path, 'whatever', self.local.object_marker_name) + self.cdist_type = core.CdistType(self.local.type_path, + '__dump_environment') + self.cdist_object = core.CdistObject( + self.cdist_type, self.local.object_path, 'whatever', + self.local.object_marker_name) self.cdist_object.create() def tearDown(self): @@ -73,14 +77,16 @@ class CodeTestCase(test.CdistTestCase): output_dict = {} for line in output_string.split('\n'): if line: - junk,value = line.split(': ') + junk, value = line.split(': ') key = junk.split(' ')[1] output_dict[key] = value self.assertEqual(output_dict['__target_host'], self.local.target_host) self.assertEqual(output_dict['__global'], self.local.base_path) self.assertEqual(output_dict['__type'], self.cdist_type.absolute_path) - self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) - self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) + self.assertEqual(output_dict['__object'], + self.cdist_object.absolute_path) + self.assertEqual(output_dict['__object_id'], + self.cdist_object.object_id) self.assertEqual(output_dict['__object_name'], self.cdist_object.name) self.assertEqual(output_dict['__files'], self.local.files_path) @@ -89,29 +95,35 @@ class CodeTestCase(test.CdistTestCase): output_dict = {} for line in output_string.split('\n'): if line: - junk,value = line.split(': ') + junk, value = line.split(': ') key = junk.split(' ')[1] output_dict[key] = value self.assertEqual(output_dict['__target_host'], self.local.target_host) self.assertEqual(output_dict['__global'], self.local.base_path) self.assertEqual(output_dict['__type'], self.cdist_type.absolute_path) - self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) - self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) + self.assertEqual(output_dict['__object'], + self.cdist_object.absolute_path) + self.assertEqual(output_dict['__object_id'], + self.cdist_object.object_id) self.assertEqual(output_dict['__object_name'], self.cdist_object.name) self.assertEqual(output_dict['__files'], self.local.files_path) def test_transfer_code_remote(self): - self.cdist_object.code_remote = self.code.run_gencode_remote(self.cdist_object) + self.cdist_object.code_remote = self.code.run_gencode_remote( + self.cdist_object) self.code.transfer_code_remote(self.cdist_object) - destination = os.path.join(self.remote.object_path, self.cdist_object.code_remote_path) + destination = os.path.join(self.remote.object_path, + self.cdist_object.code_remote_path) self.assertTrue(os.path.isfile(destination)) def test_run_code_local(self): - self.cdist_object.code_local = self.code.run_gencode_local(self.cdist_object) + self.cdist_object.code_local = self.code.run_gencode_local( + self.cdist_object) self.code.run_code_local(self.cdist_object) def test_run_code_remote_environment(self): - self.cdist_object.code_remote = self.code.run_gencode_remote(self.cdist_object) + self.cdist_object.code_remote = self.code.run_gencode_remote( + self.cdist_object) self.code.transfer_code_remote(self.cdist_object) self.code.run_code_remote(self.cdist_object) diff --git a/cdist/test/config/__init__.py b/cdist/test/config/__init__.py index a36567de..3fd415fd 100644 --- a/cdist/test/config/__init__.py +++ b/cdist/test/config/__init__.py @@ -44,6 +44,7 @@ expected_object_names = sorted([ '__second/on-the', '__third/moon']) + class ConfigRunTestCase(test.CdistTestCase): def setUp(self): @@ -65,8 +66,11 @@ class ConfigRunTestCase(test.CdistTestCase): self.objects = [] for cdist_object_name in expected_object_names: cdist_type, cdist_object_id = cdist_object_name.split("/", 1) - cdist_object = core.CdistObject(core.CdistType(type_base_path, cdist_type), self.object_base_path, - self.local.object_marker_name, cdist_object_id) + cdist_object = core.CdistObject(core.CdistType(type_base_path, + cdist_type), + self.object_base_path, + self.local.object_marker_name, + cdist_object_id) cdist_object.create() self.objects.append(cdist_object) @@ -81,8 +85,8 @@ class ConfigRunTestCase(test.CdistTestCase): remote_exec=self.remote_exec, base_path=self.remote_dir) - self.local.object_path = self.object_base_path - self.local.type_path = type_base_path + self.local.object_path = self.object_base_path + self.local.type_path = type_base_path self.config = cdist.config.Config(self.local, self.remote) @@ -95,14 +99,14 @@ class ConfigRunTestCase(test.CdistTestCase): shutil.rmtree(self.temp_dir) def test_dependency_resolution(self): - first = self.object_index['__first/man'] - second = self.object_index['__second/on-the'] - third = self.object_index['__third/moon'] + first = self.object_index['__first/man'] + second = self.object_index['__second/on-the'] + third = self.object_index['__third/moon'] first.requirements = [second.name] second.requirements = [third.name] - # First run: + # First run: # solves first and maybe second (depending on the order in the set) self.config.iterate_once() self.assertTrue(third.state == third.STATE_DONE) @@ -110,11 +114,11 @@ class ConfigRunTestCase(test.CdistTestCase): self.config.iterate_once() self.assertTrue(second.state == second.STATE_DONE) - try: self.config.iterate_once() except cdist.Error: - # Allow failing, because the third run may or may not be unecessary already, + # Allow failing, because the third run may or may not be + # unecessary already, # depending on the order of the objects pass self.assertTrue(first.state == first.STATE_DONE) @@ -123,8 +127,8 @@ class ConfigRunTestCase(test.CdistTestCase): """Ensure an exception is thrown for unresolvable depedencies""" # Create to objects depending on each other - no solution possible - first = self.object_index['__first/man'] - second = self.object_index['__second/on-the'] + first = self.object_index['__first/man'] + second = self.object_index['__second/on-the'] first.requirements = [second.name] second.requirements = [first.name] @@ -153,21 +157,22 @@ class ConfigRunTestCase(test.CdistTestCase): with self.assertRaises(cdist.core.cdist_object.MissingObjectIdError): self.config.iterate_until_finished() - def test_dryrun(self): """Test if the dryrun option is working like expected""" drylocal = cdist.exec.local.Local( target_host=self.target_host, base_path=self.local_dir, - #exec_path can not derivated from sys.argv in case of unittest ... - exec_path=os.path.abspath(os.path.join(my_dir,'../../../scripts/cdist')), - initial_manifest=os.path.join(fixtures, 'manifest/dryrun_manifest'), - add_conf_dirs=[ fixtures ] ) + # exec_path can not derivated from sys.argv in case of unittest + exec_path=os.path.abspath(os.path.join( + my_dir, '../../../scripts/cdist')), + initial_manifest=os.path.join(fixtures, + 'manifest/dryrun_manifest'), + add_conf_dirs=[fixtures]) dryrun = cdist.config.Config(drylocal, self.remote, dry_run=True) dryrun.run() # if we are here, dryrun works like expected - + # Currently the resolving code will simply detect that this object does # not exist. It should probably check if the type is a singleton as well diff --git a/cdist/test/emulator/__init__.py b/cdist/test/emulator/__init__.py index ee6c3cea..69ca0fd9 100644 --- a/cdist/test/emulator/__init__.py +++ b/cdist/test/emulator/__init__.py @@ -40,6 +40,7 @@ my_dir = op.abspath(op.dirname(__file__)) fixtures = op.join(my_dir, 'fixtures') conf_dir = op.join(fixtures, 'conf') + class EmulatorTestCase(test.CdistTestCase): def setUp(self): @@ -68,7 +69,8 @@ class EmulatorTestCase(test.CdistTestCase): def test_nonexistent_type_exec(self): argv = ['__does-not-exist'] - self.assertRaises(core.cdist_type.NoSuchTypeError, emulator.Emulator, argv, env=self.env) + self.assertRaises(core.cdist_type.NoSuchTypeError, emulator.Emulator, + argv, env=self.env) def test_nonexistent_type_requirement(self): argv = ['__file', '/tmp/foobar'] @@ -78,7 +80,8 @@ class EmulatorTestCase(test.CdistTestCase): def test_illegal_object_id_requirement(self): argv = ['__file', '/tmp/foobar'] - self.env['require'] = "__file/bad/id/with/%s/inside" % self.local.object_marker_name + self.env['require'] = ( + "__file/bad/id/with/%s/inside") % self.local.object_marker_name emu = emulator.Emulator(argv, env=self.env) self.assertRaises(core.IllegalObjectIdError, emu.run) @@ -123,16 +126,21 @@ class EmulatorTestCase(test.CdistTestCase): emu.run() # now load the objects and verify the require parameter of the objects cdist_type = core.CdistType(self.local.type_path, '__planet') - erde_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'erde') - mars_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'mars') + erde_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, 'erde') + mars_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, 'mars') cdist_type = core.CdistType(self.local.type_path, '__file') - file_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, '/tmp/cdisttest') + file_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + '/tmp/cdisttest') # now test the recorded requirements self.assertTrue(len(erde_object.requirements) == 0) self.assertEqual(list(mars_object.requirements), ['__planet/erde']) self.assertEqual(list(file_object.requirements), ['__planet/mars']) # if we get here all is fine + class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): def setUp(self): @@ -170,7 +178,8 @@ class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): emu.run() cdist_type = core.CdistType(self.local.type_path, '__file') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'eggs') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, 'eggs') reqs = set(('__directory/spam',)) self.assertEqual(reqs, set(cdist_object.requirements)) @@ -189,7 +198,8 @@ class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): emu.run() cdist_type = core.CdistType(self.local.type_path, '__file') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'eggs') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, 'eggs') reqs = set(('__directory/spam',)) self.assertEqual(reqs, set(cdist_object.requirements)) @@ -214,7 +224,8 @@ class EmulatorConflictingRequirementsTestCase(test.CdistTestCase): emu.run() cdist_type = core.CdistType(self.local.type_path, '__file') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'eggs') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, 'eggs') reqs = set(('__directory/spam', '__directory/spameggs',)) self.assertEqual(reqs, set(cdist_object.requirements)) @@ -240,11 +251,13 @@ class AutoRequireEmulatorTestCase(test.CdistTestCase): initial_manifest = os.path.join(self.local.manifest_path, "init") self.manifest.run_initial_manifest(initial_manifest) cdist_type = core.CdistType(self.local.type_path, '__saturn') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, '') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, '') self.manifest.run_type_manifest(cdist_object) expected = ['__planet/Saturn', '__moon/Prometheus'] self.assertEqual(sorted(cdist_object.autorequire), sorted(expected)) + class OverrideTestCase(test.CdistTestCase): def setUp(self): @@ -271,7 +284,7 @@ class OverrideTestCase(test.CdistTestCase): argv = ['__file', '/tmp/foobar'] emu = emulator.Emulator(argv, env=self.env) emu.run() - argv = ['__file', '/tmp/foobar','--mode','404'] + argv = ['__file', '/tmp/foobar', '--mode', '404'] emu = emulator.Emulator(argv, env=self.env) self.assertRaises(cdist.Error, emu.run) @@ -279,7 +292,7 @@ class OverrideTestCase(test.CdistTestCase): argv = ['__file', '/tmp/foobar'] emu = emulator.Emulator(argv, env=self.env) emu.run() - argv = ['__file', '/tmp/foobar','--mode','404'] + argv = ['__file', '/tmp/foobar', '--mode', '404'] self.env['CDIST_OVERRIDE'] = 'on' emu = emulator.Emulator(argv, env=self.env) emu.run() @@ -308,13 +321,17 @@ class ArgumentsTestCase(test.CdistTestCase): shutil.rmtree(self.temp_dir) def test_arguments_with_dashes(self): - argv = ['__arguments_with_dashes', 'some-id', '--with-dash', 'some value'] + argv = ['__arguments_with_dashes', 'some-id', '--with-dash', + 'some value'] os.environ.update(self.env) emu = emulator.Emulator(argv) emu.run() - cdist_type = core.CdistType(self.local.type_path, '__arguments_with_dashes') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'some-id') + cdist_type = core.CdistType(self.local.type_path, + '__arguments_with_dashes') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + 'some-id') self.assertTrue('with-dash' in cdist_object.parameters) def test_boolean(self): @@ -326,7 +343,9 @@ class ArgumentsTestCase(test.CdistTestCase): emu.run() cdist_type = core.CdistType(self.local.type_path, type_name) - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, object_id) + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + object_id) self.assertTrue('boolean1' in cdist_object.parameters) self.assertFalse('boolean2' in cdist_object.parameters) # empty file -> True @@ -338,13 +357,16 @@ class ArgumentsTestCase(test.CdistTestCase): type_name = '__arguments_required' object_id = 'some-id' value = 'some value' - argv = [type_name, object_id, '--required1', value, '--required2', value] + argv = [type_name, object_id, '--required1', value, + '--required2', value] os.environ.update(self.env) emu = emulator.Emulator(argv) emu.run() cdist_type = core.CdistType(self.local.type_path, type_name) - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, object_id) + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + object_id) self.assertTrue('required1' in cdist_object.parameters) self.assertTrue('required2' in cdist_object.parameters) self.assertEqual(cdist_object.parameters['required1'], value) @@ -370,7 +392,9 @@ class ArgumentsTestCase(test.CdistTestCase): emu.run() cdist_type = core.CdistType(self.local.type_path, type_name) - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, object_id) + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + object_id) self.assertTrue('optional1' in cdist_object.parameters) self.assertFalse('optional2' in cdist_object.parameters) self.assertEqual(cdist_object.parameters['optional1'], value) @@ -385,7 +409,9 @@ class ArgumentsTestCase(test.CdistTestCase): emu.run() cdist_type = core.CdistType(self.local.type_path, type_name) - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, object_id) + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + object_id) self.assertTrue('optional1' in cdist_object.parameters) self.assertFalse('optional2' in cdist_object.parameters) self.assertEqual(cdist_object.parameters['optional1'], value) @@ -437,7 +463,9 @@ class StdinTestCase(test.CdistTestCase): ###################################################################### # Create path where stdin should reside at cdist_type = core.CdistType(self.local.type_path, type_name) - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, object_id) + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + object_id) stdin_out_path = os.path.join(cdist_object.absolute_path, 'stdin') ###################################################################### diff --git a/cdist/test/exec/local.py b/cdist/test/exec/local.py index 12a0d47b..2cd8b6db 100644 --- a/cdist/test/exec/local.py +++ b/cdist/test/exec/local.py @@ -39,6 +39,7 @@ conf_dir = op.join(fixtures, "conf") bin_true = "true" bin_false = "false" + class LocalTestCase(test.CdistTestCase): def setUp(self): @@ -59,43 +60,52 @@ class LocalTestCase(test.CdistTestCase): def tearDown(self): shutil.rmtree(self.temp_dir) - ### test api + # test api def test_cache_path(self): - self.assertEqual(self.local.cache_path, os.path.join(self.home_dir, "cache")) + self.assertEqual(self.local.cache_path, + os.path.join(self.home_dir, "cache")) def test_conf_path(self): - self.assertEqual(self.local.conf_path, os.path.join(self.out_path, "conf")) + self.assertEqual(self.local.conf_path, + os.path.join(self.out_path, "conf")) def test_out_path(self): self.assertEqual(self.local.base_path, self.out_path) def test_bin_path(self): - self.assertEqual(self.local.bin_path, os.path.join(self.out_path, "bin")) + self.assertEqual(self.local.bin_path, + os.path.join(self.out_path, "bin")) def test_global_explorer_out_path(self): - self.assertEqual(self.local.global_explorer_out_path, os.path.join(self.out_path, "explorer")) + self.assertEqual(self.local.global_explorer_out_path, + os.path.join(self.out_path, "explorer")) def test_object_path(self): - self.assertEqual(self.local.object_path, os.path.join(self.out_path, "object")) + self.assertEqual(self.local.object_path, + os.path.join(self.out_path, "object")) - ### /test api + # /test api - ### test internal implementation + # test internal implementation def test_global_explorer_path(self): - self.assertEqual(self.local.global_explorer_path, os.path.join(self.out_path, "conf", "explorer")) + self.assertEqual(self.local.global_explorer_path, + os.path.join(self.out_path, "conf", "explorer")) def test_manifest_path(self): - self.assertEqual(self.local.manifest_path, os.path.join(self.out_path, "conf", "manifest")) + self.assertEqual(self.local.manifest_path, + os.path.join(self.out_path, "conf", "manifest")) def test_type_path(self): - self.assertEqual(self.local.type_path, os.path.join(self.out_path, "conf", "type")) + self.assertEqual(self.local.type_path, + os.path.join(self.out_path, "conf", "type")) def test_dist_conf_dir_linking(self): - """Ensure that links are correctly created for types included in distribution""" + """Ensure that links are correctly created for types included + in distribution""" - test_type="__file" + test_type = "__file" link_test_local = local.Local( target_host='localhost', @@ -110,9 +120,10 @@ class LocalTestCase(test.CdistTestCase): self.assertTrue(os.path.isdir(our_type_dir)) def test_added_conf_dir_linking(self): - """Ensure that links are correctly created for types in added conf directories""" + """Ensure that links are correctly created for types in added conf + directories""" - test_type="__cdist_test_type" + test_type = "__cdist_test_type" link_test_local = local.Local( target_host='localhost', @@ -128,9 +139,10 @@ class LocalTestCase(test.CdistTestCase): self.assertTrue(os.path.isdir(our_type_dir)) def test_conf_dir_from_path_linking(self): - """Ensure that links are correctly created for types in conf directories which are defined in CDIST_PATH""" + """Ensure that links are correctly created for types in conf + directories which are defined in CDIST_PATH""" - test_type="__cdist_test_type" + test_type = "__cdist_test_type" os.environ['CDIST_PATH'] = conf_dir @@ -146,7 +158,7 @@ class LocalTestCase(test.CdistTestCase): self.assertTrue(os.path.isdir(our_type_dir)) - ### other tests + # other tests def test_run_success(self): self.local.run([bin_true]) @@ -170,7 +182,8 @@ class LocalTestCase(test.CdistTestCase): handle, script = self.mkstemp(dir=self.temp_dir) with os.fdopen(handle, "w") as fd: fd.writelines(["#!/bin/sh\n", "echo foobar"]) - self.assertEqual(self.local.run_script(script, return_output=True), "foobar\n") + self.assertEqual(self.local.run_script(script, return_output=True), + "foobar\n") def test_mkdir(self): temp_dir = self.mkdtemp(dir=self.temp_dir) diff --git a/cdist/test/exec/remote.py b/cdist/test/exec/remote.py index 89e9dbc8..318e4c7b 100644 --- a/cdist/test/exec/remote.py +++ b/cdist/test/exec/remote.py @@ -39,26 +39,32 @@ class RemoteTestCase(test.CdistTestCase): user = getpass.getuser() remote_exec = "ssh -o User=%s -q" % user remote_copy = "scp -o User=%s -q" % user - self.remote = remote.Remote(self.target_host, base_path=self.base_path, remote_exec=remote_exec, remote_copy=remote_copy) + self.remote = remote.Remote(self.target_host, base_path=self.base_path, + remote_exec=remote_exec, + remote_copy=remote_copy) def tearDown(self): shutil.rmtree(self.temp_dir) - ### test api + # test api def test_conf_path(self): - self.assertEqual(self.remote.conf_path, os.path.join(self.base_path, "conf")) + self.assertEqual(self.remote.conf_path, + os.path.join(self.base_path, "conf")) def test_object_path(self): - self.assertEqual(self.remote.object_path, os.path.join(self.base_path, "object")) + self.assertEqual(self.remote.object_path, + os.path.join(self.base_path, "object")) def test_type_path(self): - self.assertEqual(self.remote.type_path, os.path.join(self.base_path, "conf", "type")) + self.assertEqual(self.remote.type_path, + os.path.join(self.base_path, "conf", "type")) def test_global_explorer_path(self): - self.assertEqual(self.remote.global_explorer_path, os.path.join(self.base_path, "conf", "explorer")) + self.assertEqual(self.remote.global_explorer_path, + os.path.join(self.base_path, "conf", "explorer")) - ### /test api + # /test api def test_run_success(self): self.remote.run(['/bin/true']) @@ -76,13 +82,15 @@ class RemoteTestCase(test.CdistTestCase): handle, script = self.mkstemp(dir=self.temp_dir) with os.fdopen(handle, "w") as fd: fd.writelines(["#!/bin/sh\n", "/bin/false"]) - self.assertRaises(remote.RemoteScriptError, self.remote.run_script, script) + self.assertRaises(remote.RemoteScriptError, self.remote.run_script, + script) def test_run_script_get_output(self): handle, script = self.mkstemp(dir=self.temp_dir) with os.fdopen(handle, "w") as fd: fd.writelines(["#!/bin/sh\n", "echo foobar"]) - self.assertEqual(self.remote.run_script(script, return_output=True), "foobar\n") + self.assertEqual(self.remote.run_script(script, return_output=True), + "foobar\n") def test_mkdir(self): temp_dir = self.mkdtemp(dir=self.temp_dir) @@ -125,8 +133,10 @@ class RemoteTestCase(test.CdistTestCase): os.chmod(remote_exec_path, 0o755) remote_exec = remote_exec_path remote_copy = "echo" - r = remote.Remote(self.target_host, base_path=self.base_path, remote_exec=remote_exec, remote_copy=remote_copy) - self.assertEqual(r.run('/bin/true', return_output=True), "%s\n" % self.target_host) + r = remote.Remote(self.target_host, base_path=self.base_path, + remote_exec=remote_exec, remote_copy=remote_copy) + self.assertEqual(r.run('/bin/true', return_output=True), + "%s\n" % self.target_host) def test_run_script_target_host_in_env(self): handle, remote_exec_path = self.mkstemp(dir=self.temp_dir) @@ -135,16 +145,21 @@ class RemoteTestCase(test.CdistTestCase): os.chmod(remote_exec_path, 0o755) remote_exec = remote_exec_path remote_copy = "echo" - r = remote.Remote(self.target_host, base_path=self.base_path, remote_exec=remote_exec, remote_copy=remote_copy) + r = remote.Remote(self.target_host, base_path=self.base_path, + remote_exec=remote_exec, remote_copy=remote_copy) handle, script = self.mkstemp(dir=self.temp_dir) with os.fdopen(handle, "w") as fd: fd.writelines(["#!/bin/sh\n", "/bin/true"]) - self.assertEqual(r.run_script(script, return_output=True), "%s\n" % self.target_host) + self.assertEqual(r.run_script(script, return_output=True), + "%s\n" % self.target_host) def test_run_script_with_env_target_host_in_env(self): handle, script = self.mkstemp(dir=self.temp_dir) with os.fdopen(handle, "w") as fd: - fd.writelines(["#!/bin/sh\n", 'if [ "$__object" ]; then echo $__object; else echo no_env; fi\n']) + fd.writelines([ + "#!/bin/sh\n", + ('if [ "$__object" ]; then echo $__object; ' + 'else echo no_env; fi\n')]) os.chmod(script, 0o755) handle, remote_exec_path = self.mkstemp(dir=self.temp_dir) with os.fdopen(handle, 'w') as fd: @@ -152,7 +167,8 @@ class RemoteTestCase(test.CdistTestCase): os.chmod(remote_exec_path, 0o755) remote_exec = remote_exec_path remote_copy = "echo" - r = remote.Remote(self.target_host, base_path=self.base_path, remote_exec=remote_exec, remote_copy=remote_copy) + r = remote.Remote(self.target_host, base_path=self.base_path, + remote_exec=remote_exec, remote_copy=remote_copy) output = r.run_script(script, return_output=True) self.assertEqual(output, "no_env\n") @@ -164,7 +180,8 @@ class RemoteTestCase(test.CdistTestCase): env = { '__object': 'test_object', } - r = remote.Remote(self.target_host, base_path=self.base_path, remote_exec=remote_exec, remote_copy=remote_copy) + r = remote.Remote(self.target_host, base_path=self.base_path, + remote_exec=remote_exec, remote_copy=remote_copy) output = r.run_script(script, env=env, return_output=True) self.assertEqual(output, "test_object\n") diff --git a/cdist/test/explorer/__init__.py b/cdist/test/explorer/__init__.py index 335d0e32..2ca50b7c 100644 --- a/cdist/test/explorer/__init__.py +++ b/cdist/test/explorer/__init__.py @@ -36,12 +36,13 @@ my_dir = op.abspath(op.dirname(__file__)) fixtures = op.join(my_dir, 'fixtures') conf_dir = op.join(fixtures, "conf") + class ExplorerClassTestCase(test.CdistTestCase): def setUp(self): - self.temp_dir = self.mkdtemp() - self.local_path = os.path.join(self.temp_dir, "local") - self.remote_base_path = os.path.join(self.temp_dir, "remote") + self.temp_dir = self.mkdtemp() + self.local_path = os.path.join(self.temp_dir, "local") + self.remote_base_path = os.path.join(self.temp_dir, "remote") os.makedirs(self.remote_base_path) self.local = local.Local( @@ -54,15 +55,15 @@ class ExplorerClassTestCase(test.CdistTestCase): self.local.create_files_dirs() self.remote = remote.Remote( - target_host=self.target_host, + target_host=self.target_host, remote_exec=self.remote_exec, remote_copy=self.remote_copy, base_path=self.remote_base_path) self.remote.create_files_dirs() self.explorer = explorer.Explorer( - self.target_host, - self.local, + self.target_host, + self.local, self.remote) def tearDown(self): @@ -79,7 +80,8 @@ class ExplorerClassTestCase(test.CdistTestCase): self.explorer.transfer_global_explorers() source = self.local.global_explorer_path destination = self.remote.global_explorer_path - self.assertEqual(sorted(os.listdir(source)), sorted(os.listdir(destination))) + self.assertEqual(sorted(os.listdir(source)), + sorted(os.listdir(destination))) def test_run_global_explorer(self): """Checkt that running ONE global explorer works""" @@ -101,14 +103,16 @@ class ExplorerClassTestCase(test.CdistTestCase): def test_list_type_explorer_names(self): cdist_type = core.CdistType(self.local.type_path, '__test_type') expected = cdist_type.explorers - self.assertEqual(self.explorer.list_type_explorer_names(cdist_type), expected) + self.assertEqual(self.explorer.list_type_explorer_names(cdist_type), + expected) def test_transfer_type_explorers(self): """Test if transferring type explorers works""" cdist_type = core.CdistType(self.local.type_path, '__test_type') self.explorer.transfer_type_explorers(cdist_type) source = os.path.join(self.local.type_path, cdist_type.explorer_path) - destination = os.path.join(self.remote.type_path, cdist_type.explorer_path) + destination = os.path.join(self.remote.type_path, + cdist_type.explorer_path) self.assertEqual(os.listdir(source), os.listdir(destination)) def test_transfer_type_explorers_only_once(self): @@ -116,7 +120,8 @@ class ExplorerClassTestCase(test.CdistTestCase): # first transfer self.explorer.transfer_type_explorers(cdist_type) source = os.path.join(self.local.type_path, cdist_type.explorer_path) - destination = os.path.join(self.remote.type_path, cdist_type.explorer_path) + destination = os.path.join(self.remote.type_path, + cdist_type.explorer_path) self.assertEqual(os.listdir(source), os.listdir(destination)) # nuke destination folder content, but recreate directory shutil.rmtree(destination) @@ -127,24 +132,36 @@ class ExplorerClassTestCase(test.CdistTestCase): def test_transfer_object_parameters(self): cdist_type = core.CdistType(self.local.type_path, '__test_type') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'whatever') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + 'whatever') cdist_object.create() - cdist_object.parameters = {'first': 'first value', 'second': 'second value'} + cdist_object.parameters = { + 'first': 'first value', + 'second': 'second value' + } self.explorer.transfer_object_parameters(cdist_object) - source = os.path.join(self.local.object_path, cdist_object.parameter_path) - destination = os.path.join(self.remote.object_path, cdist_object.parameter_path) - self.assertEqual(sorted(os.listdir(source)), sorted(os.listdir(destination))) + source = os.path.join(self.local.object_path, + cdist_object.parameter_path) + destination = os.path.join(self.remote.object_path, + cdist_object.parameter_path) + self.assertEqual(sorted(os.listdir(source)), + sorted(os.listdir(destination))) def test_run_type_explorer(self): cdist_type = core.CdistType(self.local.type_path, '__test_type') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'whatever') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + 'whatever') self.explorer.transfer_type_explorers(cdist_type) output = self.explorer.run_type_explorer('world', cdist_object) self.assertEqual(output, 'hello\n') def test_run_type_explorers(self): cdist_type = core.CdistType(self.local.type_path, '__test_type') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'whatever') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + 'whatever') cdist_object.create() self.explorer.run_type_explorers(cdist_object) self.assertEqual(cdist_object.explorers, {'world': 'hello'}) diff --git a/cdist/test/manifest/__init__.py b/cdist/test/manifest/__init__.py index f9eb8b8a..84c69ce1 100644 --- a/cdist/test/manifest/__init__.py +++ b/cdist/test/manifest/__init__.py @@ -40,6 +40,7 @@ my_dir = op.abspath(op.dirname(__file__)) fixtures = op.join(my_dir, 'fixtures') conf_dir = op.join(fixtures, 'conf') + class ManifestTestCase(test.CdistTestCase): def setUp(self): @@ -51,7 +52,7 @@ class ManifestTestCase(test.CdistTestCase): self.local = local.Local( target_host=self.target_host, base_path=out_path, - exec_path = cdist.test.cdist_exec_path, + exec_path=cdist.test.cdist_exec_path, add_conf_dirs=[conf_dir]) self.local.create_files_dirs() @@ -63,7 +64,8 @@ class ManifestTestCase(test.CdistTestCase): shutil.rmtree(self.temp_dir) def test_initial_manifest_environment(self): - initial_manifest = os.path.join(self.local.manifest_path, "dump_environment") + initial_manifest = os.path.join(self.local.manifest_path, + "dump_environment") handle, output_file = self.mkstemp(dir=self.temp_dir) os.close(handle) os.environ['__cdist_test_out'] = output_file @@ -74,18 +76,21 @@ class ManifestTestCase(test.CdistTestCase): output_dict = {} for line in output_string.split('\n'): if line: - key,value = line.split(': ') + key, value = line.split(': ') output_dict[key] = value self.assertTrue(output_dict['PATH'].startswith(self.local.bin_path)) self.assertEqual(output_dict['__target_host'], self.local.target_host) self.assertEqual(output_dict['__global'], self.local.base_path) - self.assertEqual(output_dict['__cdist_type_base_path'], self.local.type_path) + self.assertEqual(output_dict['__cdist_type_base_path'], + self.local.type_path) self.assertEqual(output_dict['__manifest'], self.local.manifest_path) self.assertEqual(output_dict['__files'], self.local.files_path) def test_type_manifest_environment(self): cdist_type = core.CdistType(self.local.type_path, '__dump_environment') - cdist_object = core.CdistObject(cdist_type, self.local.object_path, self.local.object_marker_name, 'whatever') + cdist_object = core.CdistObject(cdist_type, self.local.object_path, + self.local.object_marker_name, + 'whatever') handle, output_file = self.mkstemp(dir=self.temp_dir) os.close(handle) os.environ['__cdist_test_out'] = output_file @@ -96,12 +101,13 @@ class ManifestTestCase(test.CdistTestCase): output_dict = {} for line in output_string.split('\n'): if line: - key,value = line.split(': ') + key, value = line.split(': ') output_dict[key] = value self.assertTrue(output_dict['PATH'].startswith(self.local.bin_path)) self.assertEqual(output_dict['__target_host'], self.local.target_host) self.assertEqual(output_dict['__global'], self.local.base_path) - self.assertEqual(output_dict['__cdist_type_base_path'], self.local.type_path) + self.assertEqual(output_dict['__cdist_type_base_path'], + self.local.type_path) self.assertEqual(output_dict['__type'], cdist_type.absolute_path) self.assertEqual(output_dict['__object'], cdist_object.absolute_path) self.assertEqual(output_dict['__object_id'], cdist_object.object_id) diff --git a/cdist/test/message/__init__.py b/cdist/test/message/__init__.py index 653847f1..61cd5d97 100644 --- a/cdist/test/message/__init__.py +++ b/cdist/test/message/__init__.py @@ -25,14 +25,15 @@ import tempfile from cdist import test import cdist.message + class MessageTestCase(test.CdistTestCase): def setUp(self): - self.prefix="cdist-test" + self.prefix = "cdist-test" self.content = "A very short story" self.tempfile = tempfile.mkstemp()[1] self.message = cdist.message.Message(prefix=self.prefix, - messages=self.tempfile) + messages=self.tempfile) def tearDown(self): os.remove(self.tempfile) @@ -48,7 +49,6 @@ class MessageTestCase(test.CdistTestCase): self.assertIn('__messages_in', env) self.assertIn('__messages_out', env) - def test_copy_content(self): """ Ensure content copying is working diff --git a/cdist/util/fsproperty.py b/cdist/util/fsproperty.py index 98de09f8..e458fd9e 100644 --- a/cdist/util/fsproperty.py +++ b/cdist/util/fsproperty.py @@ -136,7 +136,7 @@ class DirectoryDict(collections.MutableMapping): with open(os.path.join(self.path, key), "w") as fd: if (not hasattr(value, 'strip') and (hasattr(value, '__getitem__') or - hasattr(value, '__iter__'))): + hasattr(value, '__iter__'))): # if it looks like a sequence and quacks like a sequence, # it is a sequence for v in value: @@ -175,14 +175,19 @@ class FileBasedProperty(object): """ :param path: string or callable - Abstract super class. Subclass and set the class member attribute_class accordingly. + Abstract super class. Subclass and set the class member + attribute_class accordingly. Usage with a sublcass: class Foo(object): - # note that the actual DirectoryDict is stored as __parameters on the instance - parameters = DirectoryDictProperty(lambda instance: os.path.join(instance.absolute_path, 'parameter')) - # note that the actual DirectoryDict is stored as __other_dict on the instance + # note that the actual DirectoryDict is stored as __parameters + # on the instance + parameters = DirectoryDictProperty( + lambda instance: os.path.join(instance.absolute_path, + 'parameter')) + # note that the actual DirectoryDict is stored as __other_dict + # on the instance other_dict = DirectoryDictProperty('/tmp/other_dict') def __init__(self): From 759c491ef0245daacd9471b5f42ddcfa7686a916 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 6 Jul 2016 07:50:23 +0200 Subject: [PATCH 38/42] Update changelog for pep8. --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index f1aead98..aea94be2 100644 --- a/docs/changelog +++ b/docs/changelog @@ -2,6 +2,7 @@ Changelog --------- next: + * 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) From 22abe43e854d68e94bde346b7c3e0b4c281cbc25 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 6 Jul 2016 08:25:31 +0200 Subject: [PATCH 39/42] Make better msg for exec/util unsupported stderr output. --- cdist/exec/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdist/exec/util.py b/cdist/exec/util.py index 15430f13..81264c73 100644 --- a/cdist/exec/util.py +++ b/cdist/exec/util.py @@ -25,7 +25,7 @@ from tempfile import TemporaryFile import cdist -STDERR_UNSUPPORTED = 'Not supported in this python version' +STDERR_UNSUPPORTED = '' def call_get_output(command, env=None): """Run the given command with the given environment. From a6643f0d7fe2583dd2a6332f63689e5504ab7a20 Mon Sep 17 00:00:00 2001 From: Stu Zhao Date: Wed, 6 Jul 2016 18:39:27 -0400 Subject: [PATCH 40/42] Explore machine type for virtualbox guest --- cdist/conf/explorer/machine_type | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cdist/conf/explorer/machine_type b/cdist/conf/explorer/machine_type index c0541ad5..eb3c9d36 100755 --- a/cdist/conf/explorer/machine_type +++ b/cdist/conf/explorer/machine_type @@ -48,11 +48,12 @@ if [ -r /proc/cpuinfo ]; then if grep -q -i 'vmware' /sys/class/dmi/id/product_name; then echo "virtual_by_vmware" exit - else - if grep -q -i 'bochs' /sys/class/dmi/id/product_name; then - echo "virtual_by_kvm" - exit - fi + elif grep -q -i 'bochs' /sys/class/dmi/id/product_name; then + echo "virtual_by_kvm" + exit + elif grep -q -i 'virtualbox' /sys/class/dmi/id/product_name; then + echo "virtual_by_virtualbox" + exit fi fi fi From 17c03950d95431913a5fcd05ab70f62c6fef8b5e Mon Sep 17 00:00:00 2001 From: Stu Zhao Date: Wed, 6 Jul 2016 23:11:49 -0400 Subject: [PATCH 41/42] Update changelog for commit a6643f0 --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index aea94be2..a5b1a6c3 100644 --- a/docs/changelog +++ b/docs/changelog @@ -13,6 +13,7 @@ next: * 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) From 07ef7cf2a0bf7bb601ac0d7ba0e4fbbe8ac8faf1 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Thu, 7 Jul 2016 07:53:21 +0200 Subject: [PATCH 42/42] Update building on FreeBSD. --- bin/build-helper.freebsd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/build-helper.freebsd b/bin/build-helper.freebsd index 01d86a10..da8170e1 100755 --- a/bin/build-helper.freebsd +++ b/bin/build-helper.freebsd @@ -260,7 +260,15 @@ eof fi # Publish git changes - make helper=${helper} WEBDIR=${WEBDIR} pub + case "$run_as" in + freebsd) + # if we are not Nico :) then just push, no mirror + git push + ;; + *) + make helper=${helper} WEBDIR=${WEBDIR} pub + ;; + esac # publish man, speeches, website if [ "$masterbranch" = yes ]; then