From b9ff43c657de458b22d7113e82d1b2c623314756 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 3 Mar 2011 10:37:11 +0100 Subject: [PATCH 0001/5465] use $__global instead of ./out/ Signed-off-by: Steven Armstrong --- conf/type/__package/manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__package/manifest b/conf/type/__package/manifest index 89b3f179..cf085e2f 100755 --- a/conf/type/__package/manifest +++ b/conf/type/__package/manifest @@ -28,7 +28,7 @@ if [ -f "$type" ]; then type="$(cat "$type")" else # By default determine package manager based on operating system - os="$(cat "out/explorer/os")" + os="$(cat "$__global/explorer/os")" case "$os" in archlinux) type="pacman" ;; debian|ubuntu) type="apt" ;; From 614ff21f4abb45b05504a36420864a56eab86d5c Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 3 Mar 2011 10:37:49 +0100 Subject: [PATCH 0002/5465] /deinstalled/uninstalled/ Signed-off-by: Steven Armstrong --- conf/manifest/init | 4 ++-- conf/type/__package_apt/gencode | 2 +- conf/type/__package_emerge/gencode | 3 +-- conf/type/__package_pacman/gencode | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/conf/manifest/init b/conf/manifest/init index 17ba0e92..51b06e6f 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -16,7 +16,7 @@ case "$__target_host" in # Alias in /etc/hosts for localhost cdist-archlinux) - __package_pacman django --state deinstalled + __package_pacman django --state uninstalled __package_pacman wireshark-cli --state installed __package_pacman zsh --state installed ;; @@ -27,6 +27,6 @@ case "$__target_host" in # Real machines ikq*) __package_apt zsh --state installed - __package_apt apache2 --state deinstalled + __package_apt apache2 --state uninstalled ;; esac diff --git a/conf/type/__package_apt/gencode b/conf/type/__package_apt/gencode index b451eb9f..c85242e6 100755 --- a/conf/type/__package_apt/gencode +++ b/conf/type/__package_apt/gencode @@ -38,7 +38,7 @@ case "$state" in echo apt-get --quiet --yes install \"$name\" fi ;; - deinstalled) + uninstalled) # Remove only if existent if [ -n "$is_installed" ]; then echo apt-get --quiet --yes remove \"$name\" diff --git a/conf/type/__package_emerge/gencode b/conf/type/__package_emerge/gencode index ee95b823..47e8bc5e 100755 --- a/conf/type/__package_emerge/gencode +++ b/conf/type/__package_emerge/gencode @@ -34,9 +34,8 @@ case "$state" in # FIXME: only install if not already installed echo "emerge -q \"$name\"" ;; - deinstalled) + uninstalled) # FIXME: only uninstall if currently installed - # FIXME: rename deinstalled to uninstalled echo "emerge -q -C \"$name\"" ;; esac diff --git a/conf/type/__package_pacman/gencode b/conf/type/__package_pacman/gencode index 9702aa8e..536b7708 100755 --- a/conf/type/__package_pacman/gencode +++ b/conf/type/__package_pacman/gencode @@ -44,7 +44,7 @@ case "$state" in echo pacman "$pacopts" -S \"$name\" fi ;; - deinstalled) + uninstalled) if [ "$pkg_version" ]; then echo pacman "$pacopts" -R \"$name\" fi From f77f551846ca2dc19d6dcda528603c5befb89385 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 8 Mar 2011 19:37:42 +0100 Subject: [PATCH 0003/5465] todos /dani updated --- doc/dev/todo/daninext | 2 ++ doc/dev/todo/post-1.0 | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 doc/dev/todo/daninext diff --git a/doc/dev/todo/daninext b/doc/dev/todo/daninext new file mode 100644 index 00000000..19ebc573 --- /dev/null +++ b/doc/dev/todo/daninext @@ -0,0 +1,2 @@ +file-edit + - add_line_to_file_if_not_existing diff --git a/doc/dev/todo/post-1.0 b/doc/dev/todo/post-1.0 index e469214e..d3fdd2c9 100644 --- a/doc/dev/todo/post-1.0 +++ b/doc/dev/todo/post-1.0 @@ -23,7 +23,6 @@ Types to be written/extended: - __service - __user - __file_edit - - add_line_to_file_if_not_existing - delete_line_from_file - regexp replace (can probably cover all?) - __file: From ac815524f405d4df7509f6766d53df453a149080 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 8 Mar 2011 19:34:51 +0100 Subject: [PATCH 0004/5465] Implementation of addifnosuchline type --- conf/type/__addifnosuchline/explorer/findline | 41 +++++++++++++++++++ conf/type/__addifnosuchline/gencode | 33 +++++++++++++++ .../type/__addifnosuchline/parameter/optional | 1 + .../type/__addifnosuchline/parameter/required | 1 + .../to_check/cdist-type-addifnosuchline.text | 30 ++++++++++++++ 5 files changed, 106 insertions(+) create mode 100755 conf/type/__addifnosuchline/explorer/findline create mode 100755 conf/type/__addifnosuchline/gencode create mode 100644 conf/type/__addifnosuchline/parameter/optional create mode 100644 conf/type/__addifnosuchline/parameter/required create mode 100644 doc/man/to_check/cdist-type-addifnosuchline.text diff --git a/conf/type/__addifnosuchline/explorer/findline b/conf/type/__addifnosuchline/explorer/findline new file mode 100755 index 00000000..9367be42 --- /dev/null +++ b/conf/type/__addifnosuchline/explorer/findline @@ -0,0 +1,41 @@ +#!/bin/sh +# +# 2010-2011 Daniel Roth (dani-cdist@d-roth.li) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# + +if [ -f "$__object/parameter/file" ]; then + file=$(cat "$__object/parameter/file") +else + file="/$__object_id" +fi + +regex=$(cat "$__object/parameter/line") +if [ -f "$file" ]; then + grep -q "^$regex\$" "$file" + if [ $? -eq 1 ]; then + # regex pattern not found --> success + echo "SUCCESS" + else + # regex pattern found --> failure + echo "FAILURE" + fi +else + # file does not exist --> line not in file + echo "SUCCESS" +fi diff --git a/conf/type/__addifnosuchline/gencode b/conf/type/__addifnosuchline/gencode new file mode 100755 index 00000000..898d93f9 --- /dev/null +++ b/conf/type/__addifnosuchline/gencode @@ -0,0 +1,33 @@ +#!/bin/sh +# +# 2010-2011 Daniel Roth (dani-cdist@d-roth.li) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# + +if [ -f "$__object/parameter/file" ]; then + file=$(cat "$__object/parameter/file") +else + file="/$__object_id" +fi + +result=$(cat "$__object/explorer/findline") + +if [ $result = "SUCCESS" ]; then + line=$(cat "$__object/parameter/line") + echo "echo $line >> $file" +fi diff --git a/conf/type/__addifnosuchline/parameter/optional b/conf/type/__addifnosuchline/parameter/optional new file mode 100644 index 00000000..f73f3093 --- /dev/null +++ b/conf/type/__addifnosuchline/parameter/optional @@ -0,0 +1 @@ +file diff --git a/conf/type/__addifnosuchline/parameter/required b/conf/type/__addifnosuchline/parameter/required new file mode 100644 index 00000000..a999a0c2 --- /dev/null +++ b/conf/type/__addifnosuchline/parameter/required @@ -0,0 +1 @@ +line diff --git a/doc/man/to_check/cdist-type-addifnosuchline.text b/doc/man/to_check/cdist-type-addifnosuchline.text new file mode 100644 index 00000000..09618dc3 --- /dev/null +++ b/doc/man/to_check/cdist-type-addifnosuchline.text @@ -0,0 +1,30 @@ +cdist-type-addifnosuchline(1) +====================== +Daniel Roth + + +NAME +---- +cdist-type-addifnosuchline + + +SYNOPSIS +-------- +cdist-type-addifnosuchline Add if no such line + + +DESCRIPTION +----------- +cdist-type-addifnosuchline can be used to check a file for existence of a +specific line and adding that if not found + + +SEE ALSO +-------- +cdist(7) + + +COPYING +------- +Copyright \(C) 2011 Daniel Roth. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 5333b98299d59d2b1e2c543cc3309baa7335bd60 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 7 Mar 2011 20:08:41 +0100 Subject: [PATCH 0005/5465] Testing/Demonstration of type addifnosuchline --- conf/manifest/init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf/manifest/init b/conf/manifest/init index e6cf47d5..bca93d06 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -10,7 +10,11 @@ __file /etc/cdist-configured --type file case "$__target_host" in # Everybody has this localhost) - __file test --type file --destination /tmp/cdist-testfile +# __file test --type file --destination /tmp/cdist-testfile + __addifnosuchline testfile_foo --file /tmp/myTestFile --line "foo" + __addifnosuchline testfile2_foo --file /tmp/myTestFile2 --line "foo" + __addifnosuchline testfile_bar --file /tmp/myTestFile --line "bar" + __addifnosuchline /tmp/myTestFile3 --line "bar" ;; # Alias in /etc/hosts for localhost From 35df79534210b4bb68bd6043a74eecd34c26f758 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 8 Mar 2011 20:21:10 +0100 Subject: [PATCH 0006/5465] Return values replaced --- conf/type/__addifnosuchline/explorer/findline | 9 +++------ conf/type/__addifnosuchline/gencode | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/conf/type/__addifnosuchline/explorer/findline b/conf/type/__addifnosuchline/explorer/findline index 9367be42..c1633626 100755 --- a/conf/type/__addifnosuchline/explorer/findline +++ b/conf/type/__addifnosuchline/explorer/findline @@ -29,13 +29,10 @@ regex=$(cat "$__object/parameter/line") if [ -f "$file" ]; then grep -q "^$regex\$" "$file" if [ $? -eq 1 ]; then - # regex pattern not found --> success - echo "SUCCESS" + echo "NOTFOUND" else - # regex pattern found --> failure - echo "FAILURE" + echo "FOUND" fi else - # file does not exist --> line not in file - echo "SUCCESS" + echo "NOTFOUND" fi diff --git a/conf/type/__addifnosuchline/gencode b/conf/type/__addifnosuchline/gencode index 898d93f9..f97789ae 100755 --- a/conf/type/__addifnosuchline/gencode +++ b/conf/type/__addifnosuchline/gencode @@ -27,7 +27,7 @@ fi result=$(cat "$__object/explorer/findline") -if [ $result = "SUCCESS" ]; then +if [ "$result" = "NOTFOUND" ]; then line=$(cat "$__object/parameter/line") echo "echo $line >> $file" fi From 2f88521d41d4288cdf767ba996c4f7365a5be21a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 8 Mar 2011 21:43:36 +0100 Subject: [PATCH 0007/5465] ads --- asd | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 asd diff --git a/asd b/asd new file mode 100644 index 00000000..e69de29b From 068a7d272b38851504ec64bd5328947c3fc91c51 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 11 Mar 2011 19:25:55 +0100 Subject: [PATCH 0008/5465] place version on top Signed-off-by: Nico Schottelius --- bin/cdist-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index c1498f58..0d0fd152 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,6 +19,8 @@ # # +__cdist_version="1.0.3" + # Fail if something bogus is going on set -u @@ -31,8 +33,6 @@ __cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" __cdist_myname=${0##*/}; __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" -__cdist_version="1.0.3" - ################################################################################ # Names / Constants # From f8b8ba32facae6740688fb509ae3f8e36c9f4c7b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 11 Mar 2011 23:42:44 +0100 Subject: [PATCH 0009/5465] add new cdist-env Signed-off-by: Nico Schottelius --- bin/cdist-env | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 bin/cdist-env diff --git a/bin/cdist-env b/bin/cdist-env new file mode 100755 index 00000000..e95e078b --- /dev/null +++ b/bin/cdist-env @@ -0,0 +1,33 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Setup environment for use with cdist +# + +. cdist-config +[ $# -eq 0 ] || __cdist_usage "no arguments" + +# Allow access to unset variables like PATH and MANPATH +set +u + +echo export PATH=$__cdist_abs_mydir:$PATH + +cd "$__cdist_abs_mydir/../doc/man" +echo export MANPATH=$(pwd -P):$MANPATH From ff1eb0895b6277c50b4a0d366647ae0aa9ec9c82 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 12 Mar 2011 18:47:34 +0100 Subject: [PATCH 0010/5465] add new type: __motd Signed-off-by: Nico Schottelius --- conf/type/__motd/README | 1 + conf/type/__motd/files/motd | 17 +++++++++++++ conf/type/__motd/man.text | 48 +++++++++++++++++++++++++++++++++++++ conf/type/__motd/manifest | 31 ++++++++++++++++++++++++ conf/type/__motd/singleton | 0 5 files changed, 97 insertions(+) create mode 100644 conf/type/__motd/README create mode 100644 conf/type/__motd/files/motd create mode 100644 conf/type/__motd/man.text create mode 100755 conf/type/__motd/manifest create mode 100644 conf/type/__motd/singleton diff --git a/conf/type/__motd/README b/conf/type/__motd/README new file mode 100644 index 00000000..f7bbde5c --- /dev/null +++ b/conf/type/__motd/README @@ -0,0 +1 @@ +Manage /etc/issue diff --git a/conf/type/__motd/files/motd b/conf/type/__motd/files/motd new file mode 100644 index 00000000..b5f5bfdf --- /dev/null +++ b/conf/type/__motd/files/motd @@ -0,0 +1,17 @@ + +Welcome to a cdist automated systems! + + .. . .x+=:. s + dF @88> z` ^% :8 + '88bu. %8P . + + +NAME +---- +cdist-type__motd - Manage message of the day + + +DESCRIPTION +----------- +This cdist type allows you to easily setup /etc/motd. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +source:: + If supplied, copy this file from the host running cdist to the target. + If not supplied, a default message will be placed onto the target. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Use cdist defaults +__motd + +# Supply source file from a different type +__file --source "$__type/files/my-motd" +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__motd/manifest b/conf/type/__motd/manifest new file mode 100755 index 00000000..594977b9 --- /dev/null +++ b/conf/type/__motd/manifest @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# + +destination=/etc/motd + +# Select motd source +if [ -f "$__object/parameter/source" ]; then + source="$(cat "$__object/parameter/source")" +else + source="$__type/files/motd" +fi + +__file "$destination" --source "$source" --type file diff --git a/conf/type/__motd/singleton b/conf/type/__motd/singleton new file mode 100644 index 00000000..e69de29b From 5bd26959e683cc82841d7b95f306deedb68f0559 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 12 Mar 2011 18:48:02 +0100 Subject: [PATCH 0011/5465] update changelog Signed-off-by: Nico Schottelius --- doc/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog b/doc/changelog index d5c5f882..aa466277 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.0.4: + * New type: __motd + 1.0.3: 2011-03-11 * Update regexp used for sane characters * Allow types without parameters From 32042aba8fb8b05fbe9ca6b9c1b9b20ab06608fa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 12 Mar 2011 18:58:22 +0100 Subject: [PATCH 0012/5465] cleanup motd Signed-off-by: Nico Schottelius --- conf/type/__motd/files/motd | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/conf/type/__motd/files/motd b/conf/type/__motd/files/motd index b5f5bfdf..fcba183d 100644 --- a/conf/type/__motd/files/motd +++ b/conf/type/__motd/files/motd @@ -1,17 +1,16 @@ -Welcome to a cdist automated systems! - - .. . .x+=:. s - dF @88> z` ^% :8 - '88bu. %8P . z` ^% :8 + '88bu. %8P . Date: Sat, 12 Mar 2011 19:07:19 +0100 Subject: [PATCH 0013/5465] +banner in readme Signed-off-by: Nico Schottelius --- REAL_README | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/REAL_README b/REAL_README index e69c36ba..0938289f 100644 --- a/REAL_README +++ b/REAL_README @@ -1,5 +1,20 @@ [[!meta title="cdist - configuration management"]] + + .. . .x+=:. s + dF @88> z` ^% :8 + '88bu. %8P . Date: Sat, 12 Mar 2011 19:48:37 +0100 Subject: [PATCH 0014/5465] [DOC] type __issue Signed-off-by: Nico Schottelius --- conf/type/__issue/README | 1 - conf/type/__issue/man.text | 41 ++++++++++++++++++++++++++++++++++++++ conf/type/__motd/README | 1 - doc/changelog | 4 +++- 4 files changed, 44 insertions(+), 3 deletions(-) delete mode 100644 conf/type/__issue/README create mode 100644 conf/type/__issue/man.text delete mode 100644 conf/type/__motd/README diff --git a/conf/type/__issue/README b/conf/type/__issue/README deleted file mode 100644 index f7bbde5c..00000000 --- a/conf/type/__issue/README +++ /dev/null @@ -1 +0,0 @@ -Manage /etc/issue diff --git a/conf/type/__issue/man.text b/conf/type/__issue/man.text new file mode 100644 index 00000000..57ece530 --- /dev/null +++ b/conf/type/__issue/man.text @@ -0,0 +1,41 @@ +cdist-type__issue(7) +=================== +Nico Schottelius + + +NAME +---- +cdist-type__issue - Manage issue + + +DESCRIPTION +----------- +This cdist type allows you to easily setup /etc/issue. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +None + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +__issue +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__motd/README b/conf/type/__motd/README deleted file mode 100644 index f7bbde5c..00000000 --- a/conf/type/__motd/README +++ /dev/null @@ -1 +0,0 @@ -Manage /etc/issue diff --git a/doc/changelog b/doc/changelog index aa466277..c939b547 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,7 @@ 1.0.4: - * New type: __motd + * New type __motd + * New type __addifnosuchline + * Document type __issue 1.0.3: 2011-03-11 * Update regexp used for sane characters From 6ab7df596e3fe860f555675a8ce20a57e1a5429c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 12 Mar 2011 19:48:51 +0100 Subject: [PATCH 0015/5465] +cleanup Signed-off-by: Nico Schottelius --- .gitignore | 4 ++++ doc/dev/todo/post-1.0 | 1 + 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index ba65e3f8..d7c6f7c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ +# -vim .*.swp + +# Ignore generated manpages doc/man/*.[1-9] doc/man/.marker doc/man/man*/ +conf/type/*/*.7 diff --git a/doc/dev/todo/post-1.0 b/doc/dev/todo/post-1.0 index 63872eb2..49c6f8b0 100644 --- a/doc/dev/todo/post-1.0 +++ b/doc/dev/todo/post-1.0 @@ -25,6 +25,7 @@ Types to be written/extended: owner __link type symbolic | hard + - __issue: add --source Documentation: From 8b614b274c6476fd3cfbae92f2c8d04bb10a3466 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 14 Mar 2011 09:32:18 +0100 Subject: [PATCH 0016/5465] fix fixing the merge conflict Signed-off-by: Steven Armstrong --- conf/manifest/init | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 conf/manifest/init diff --git a/conf/manifest/init b/conf/manifest/init new file mode 100755 index 00000000..0a1dca50 --- /dev/null +++ b/conf/manifest/init @@ -0,0 +1,52 @@ +# +# This is a sample manifest, but used in real world +# + +# This is debug and should not be in a production environment +# echo "We could access other manifests in $__manifest" + +# Every machine becomes a marker, so sysadmins know that automatic +# configurations are happening +__file /etc/cdist-configured --type file + +case "$__target_host" in + # Everybody has this + localhost) + # Usual example + __file test --type symlink --source /etc/cdist-configured --destination /tmp/cdist-testfile + ;; + + # + # Examples using different types + # + + # Alias in /etc/hosts for localhost + cdist-archlinux) + # This is the specific package type for pacman + __package_pacman zsh --state installed + + # The __package type autoselect the right type based on the os + __package vim --state installed + + # If the type is a singleton, it does not take an object id + __issue + ;; + # This is how it would look like on gentoo + cdist-gentoo) + # Same stuff for gentoo + __package tree --state installed + ;; + cdist-debian) + __package_apt atop --state installed + __package apache2 --state deinstalled + ;; + + # Real machines may be used with their hostname or fqdn, + # depending on how you call cdist-deploy-to + # machine) + # ... + # ;; + # machine.example.org) + # ... + # ;; +esac From adbf670309fae0b4e9513d846689fac4f541fbe9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Mar 2011 18:25:57 +0100 Subject: [PATCH 0017/5465] +mercurial Signed-off-by: Nico Schottelius --- REAL_README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/REAL_README b/REAL_README index 0938289f..88d5de13 100644 --- a/REAL_README +++ b/REAL_README @@ -165,7 +165,8 @@ Yes, I'm actually eating my own dogfood and currently managing * [kerberos (mit)](http://web.mit.edu/kerberos/) (authentication) * [ircd-hybrid](http://www.ircd-hybrid.org/) (chat) * [stunnel](http://stunnel.mirt.net/) (SSL tunnel) + * [mercurial-server](http://www.lshift.net/mercurial-server.html) -with cdist on a total of **3** production servers of the +with cdist on a total of **4** production servers of the [Systems Group](http://www.systems.ethz.ch) at the [ETH Zurich](http://www.ethz.ch). From 27286c787dc468451ebaeb84ca6e20134462c574 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Mar 2011 23:12:14 +0100 Subject: [PATCH 0018/5465] document files/ directories (in object and type) Signed-off-by: Nico Schottelius --- doc/man/cdist-type.text | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/man/cdist-type.text b/doc/man/cdist-type.text index 7c8b49f3..f8811a16 100644 --- a/doc/man/cdist-type.text +++ b/doc/man/cdist-type.text @@ -179,6 +179,14 @@ level tools like ruby installed. If a type requires specific tools to be present on the target, there must be another type that provides this tool and the first type should create an object of the specific type. +If your type wants to save temporay data, that may be used by other types +later on (for instance __file), you can save them in the subdirectory +"files" below $__object (but you must create it yourself). cdist will not touch +this directory. + +If your type contains static files, it's also recommened to place them in +a folder named "files" within the type (again, because cdist guarantees to +never ever touch this folder). HOW TO INCLUDE A TYPE INTO UPSTREAM CDIST ----------------------------------------- From 710ce98386848ecc1ce6a8c5f1fa426a22881ffa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Mar 2011 23:23:32 +0100 Subject: [PATCH 0019/5465] [DOC] __package_pacman gained manpage Signed-off-by: Nico Schottelius --- conf/type/__package_pacman/man.text | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 conf/type/__package_pacman/man.text diff --git a/conf/type/__package_pacman/man.text b/conf/type/__package_pacman/man.text new file mode 100644 index 00000000..35a7e44c --- /dev/null +++ b/conf/type/__package_pacman/man.text @@ -0,0 +1,53 @@ +cdist-type__package_pacman(7) +============================= +Nico Schottelius + + +NAME +---- +cdist-type__package_pacman - Manage packages with pacman + + +DESCRIPTION +----------- +Pacman is usually used on the Archlinux distribution to manage +packages. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "installed" or "deinstalled". + + +OPTIONAL PARAMETERS +------------------- +name:: + If supplied, use the name and not the object id as the package name. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Ensure zsh in installed +__package_pacman zsh --state installed + +# If you don't want to follow pythonX packages, but always use python +__package_pacman python --state installed --name python2 + +# Remove obsolete package +__package_pacman puppet --state deinstalled +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__package(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 49d3548f46581535de7adc7d8444fb930f9105fc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Mar 2011 23:41:36 +0100 Subject: [PATCH 0020/5465] support debian/ubuntu in __motd Signed-off-by: Nico Schottelius --- conf/type/__motd/manifest | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/conf/type/__motd/manifest b/conf/type/__motd/manifest index 594977b9..a6e963f1 100755 --- a/conf/type/__motd/manifest +++ b/conf/type/__motd/manifest @@ -19,8 +19,6 @@ # # -destination=/etc/motd - # Select motd source if [ -f "$__object/parameter/source" ]; then source="$(cat "$__object/parameter/source")" @@ -28,4 +26,16 @@ else source="$__type/files/motd" fi +os=$(cat $__global/explorer/os) + + +case "$os" in + debian|ubuntu) + destination=/etc/motd.tail + ;; + *) + destination=/etc/motd + ;; +esac + __file "$destination" --source "$source" --type file From 1187a8594afb17205209376032dd62ca66e8c2fa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Mar 2011 23:41:46 +0100 Subject: [PATCH 0021/5465] more stuff for upcoming 1.0.4 Signed-off-by: Nico Schottelius --- conf/manifest/init | 1 + doc/changelog | 1 + 2 files changed, 2 insertions(+) diff --git a/conf/manifest/init b/conf/manifest/init index 0a1dca50..aa1a51da 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -14,6 +14,7 @@ case "$__target_host" in localhost) # Usual example __file test --type symlink --source /etc/cdist-configured --destination /tmp/cdist-testfile + __motd ;; # diff --git a/doc/changelog b/doc/changelog index c939b547..dc332cf2 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,7 @@ * New type __motd * New type __addifnosuchline * Document type __issue + * Document type __package_pacman 1.0.3: 2011-03-11 * Update regexp used for sane characters From 8ff02673f0deca02e003c2a66bab0b3f524192ae Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 14 Mar 2011 23:43:00 +0100 Subject: [PATCH 0022/5465] remove __motd from localhost (not good as an example for testers) Signed-off-by: Nico Schottelius --- conf/manifest/init | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/manifest/init b/conf/manifest/init index aa1a51da..0a1dca50 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -14,7 +14,6 @@ case "$__target_host" in localhost) # Usual example __file test --type symlink --source /etc/cdist-configured --destination /tmp/cdist-testfile - __motd ;; # From 5821ceebbc3d7afeeaf3db7c34d4a0a8f9327636 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 00:00:25 +0100 Subject: [PATCH 0023/5465] add support for --owner and --group in __file Signed-off-by: Nico Schottelius --- conf/type/__file/gencode | 13 +++++++++++-- conf/type/__file/parameter/optional | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/conf/type/__file/gencode b/conf/type/__file/gencode index 5f386349..4921815c 100755 --- a/conf/type/__file/gencode +++ b/conf/type/__file/gencode @@ -109,6 +109,15 @@ esac # Mode settings if [ -f "$__object/parameter/mode" ]; then - mode="$(cat "$__object/parameters/mode")" - echo chmod \"$mode\" \"$destination\" + echo chmod \"$(cat "$__object/parameters/mode")\" \"$destination\" +fi + +# Group +if [ -f "$__object/parameter/group" ]; then + echo chgrp \"$(cat "$__object/parameters/group")\" \"$destination\" +fi + +# Owner +if [ -f "$__object/parameter/owner" ]; then + echo chown \"$(cat "$__object/parameters/owner")\" \"$destination\" fi diff --git a/conf/type/__file/parameter/optional b/conf/type/__file/parameter/optional index de17ffff..0c30f4be 100644 --- a/conf/type/__file/parameter/optional +++ b/conf/type/__file/parameter/optional @@ -1,3 +1,5 @@ +group mode +owner source destination From 2d4cbdddab02c94023fd54bdc0504cbd5f286cac Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 00:05:38 +0100 Subject: [PATCH 0024/5465] document new features Signed-off-by: Nico Schottelius --- conf/type/__file/man.text | 11 +++++++++++ doc/changelog | 1 + 2 files changed, 12 insertions(+) diff --git a/conf/type/__file/man.text b/conf/type/__file/man.text index 04e0ffc3..e1c13db8 100644 --- a/conf/type/__file/man.text +++ b/conf/type/__file/man.text @@ -25,9 +25,15 @@ destination:: If supplied, use this as the destination on the target. Otherwise the object_id is used. +group:: + Group to chgrp to. + mode:: Unix permissions, suitable for chmod. +owner:: + User to chown to. + source:: If supplied, copy this file from the host running cdist to the target. If not supplied, an empty file or directory will be created. @@ -45,6 +51,11 @@ __file cdist-marker --type file --destination /etc/cdist-configured # Use __file from another type __file /etc/issue --source "$__type/files/archlinux" --type file + +# Supply some more settings +__file /etc/shadow --source "$__type/files/shadow" --type file \ + --owner root --group shadow --mode 0640 + -------------------------------------------------------------------------------- diff --git a/doc/changelog b/doc/changelog index dc332cf2..e712c15f 100644 --- a/doc/changelog +++ b/doc/changelog @@ -3,6 +3,7 @@ * New type __addifnosuchline * Document type __issue * Document type __package_pacman + * New parameter for __file: --owner and --group 1.0.3: 2011-03-11 * Update regexp used for sane characters From fe2d4877ced09d6f8999ccd95b052d233d05e8a4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 00:06:50 +0100 Subject: [PATCH 0025/5465] -plural (old stuff) Signed-off-by: Nico Schottelius --- conf/type/__file/gencode | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/type/__file/gencode b/conf/type/__file/gencode index 4921815c..531cc203 100755 --- a/conf/type/__file/gencode +++ b/conf/type/__file/gencode @@ -109,15 +109,15 @@ esac # Mode settings if [ -f "$__object/parameter/mode" ]; then - echo chmod \"$(cat "$__object/parameters/mode")\" \"$destination\" + echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" fi # Group if [ -f "$__object/parameter/group" ]; then - echo chgrp \"$(cat "$__object/parameters/group")\" \"$destination\" + echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" fi # Owner if [ -f "$__object/parameter/owner" ]; then - echo chown \"$(cat "$__object/parameters/owner")\" \"$destination\" + echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" fi From aa4a23e7dd1ddffe6ef6e92dc3a0095720a663ca Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 00:18:31 +0100 Subject: [PATCH 0026/5465] doc: -\n Signed-off-by: Nico Schottelius --- conf/type/__file/man.text | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/type/__file/man.text b/conf/type/__file/man.text index e1c13db8..c60ada44 100644 --- a/conf/type/__file/man.text +++ b/conf/type/__file/man.text @@ -55,7 +55,6 @@ __file /etc/issue --source "$__type/files/archlinux" --type file # Supply some more settings __file /etc/shadow --source "$__type/files/shadow" --type file \ --owner root --group shadow --mode 0640 - -------------------------------------------------------------------------------- From 0aad5724612db50f04d5e8f223d0149f955171a4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 13:01:03 +0100 Subject: [PATCH 0027/5465] define dependency handling Signed-off-by: Nico Schottelius --- doc/dev/logs/2011-03-15 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/dev/logs/2011-03-15 diff --git a/doc/dev/logs/2011-03-15 b/doc/dev/logs/2011-03-15 new file mode 100644 index 00000000..66de8aed --- /dev/null +++ b/doc/dev/logs/2011-03-15 @@ -0,0 +1,27 @@ +Steven, Nico + +How to handle dependencies: + +1) Add --require parameter for all types + - Special handling in cdist-type-emulator + + Everything on one line + +2) Add __require type + + No change in core + - Type influences core + - Additional line + - Core needs to know about requirements + +3) cdist-require as a seperate executable + + No change in cdist-type-emulator + - new behaviour + - first time cdist-xxx dependency in types + +4) require="" environment variable for cdist-type-emulator + + on one line / same context + + special handling is ok for special case + + doesn't touch parameters (i.e. type still has full control) + +-------------------------------------------------------------------------------- + +Result: Use version 4. From dfdd7644b2515dff05b0f22981bb121f8699ffda Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 16:29:11 +0100 Subject: [PATCH 0028/5465] make footer aequivalent to header Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 35c058d9..7f66888f 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -67,4 +67,4 @@ cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ # And finally - execute the code cdist-code-run-all "$__cdist_target_host" -echo "Configuration successfully finished for $__cdist_target_host" +echo "cdist $__cdist_version: success on $__cdist_target_host" From 77381b9981fe3b9730e834522f0ae6fe0339cc26 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 16:35:04 +0100 Subject: [PATCH 0029/5465] cleanup manpages for __issue and __motd Signed-off-by: Nico Schottelius --- conf/type/__issue/man.text | 2 +- conf/type/__motd/man.text | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/type/__issue/man.text b/conf/type/__issue/man.text index 57ece530..18d88947 100644 --- a/conf/type/__issue/man.text +++ b/conf/type/__issue/man.text @@ -1,5 +1,5 @@ cdist-type__issue(7) -=================== +==================== Nico Schottelius diff --git a/conf/type/__motd/man.text b/conf/type/__motd/man.text index 1fca60d3..a4ca80b5 100644 --- a/conf/type/__motd/man.text +++ b/conf/type/__motd/man.text @@ -33,7 +33,7 @@ EXAMPLES __motd # Supply source file from a different type -__file --source "$__type/files/my-motd" +__motd --source "$__type/files/my-motd" -------------------------------------------------------------------------------- From 63452e0feefa68954d81c53a0a7a646c0777756c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 16:37:34 +0100 Subject: [PATCH 0030/5465] document __package_apt Signed-off-by: Nico Schottelius --- conf/type/__package_apt/man.text | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 conf/type/__package_apt/man.text diff --git a/conf/type/__package_apt/man.text b/conf/type/__package_apt/man.text new file mode 100644 index 00000000..0780124d --- /dev/null +++ b/conf/type/__package_apt/man.text @@ -0,0 +1,53 @@ +cdist-type__package_apt(7) +========================== +Nico Schottelius + + +NAME +---- +cdist-type__package_apt - Manage packages with apt-get + + +DESCRIPTION +----------- +apt-get is usually used on Debian and variants (like Ubuntu) to +manage packages. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "installed" or "deinstalled". + + +OPTIONAL PARAMETERS +------------------- +name:: + If supplied, use the name and not the object id as the package name. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Ensure zsh in installed +__package_apt zsh --state installed + +# In case you only want *a* webserver, but don't care which one +__package_apt webserver --state installed --name nginx + +# Remove obsolete package +__package_apt puppet --state deinstalled +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__package(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 05742ae432f2b98c74e5f7c4fc9809f322433784 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 16:38:25 +0100 Subject: [PATCH 0031/5465] +changelog Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index e712c15f..50fb9de1 100644 --- a/doc/changelog +++ b/doc/changelog @@ -3,6 +3,7 @@ * New type __addifnosuchline * Document type __issue * Document type __package_pacman + * Document type __package_apt * New parameter for __file: --owner and --group 1.0.3: 2011-03-11 From 8d8491232c4e2a90861c023161b10a6dabc4283b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 16:41:04 +0100 Subject: [PATCH 0032/5465] add template for type __directory Signed-off-by: Nico Schottelius --- conf/type/__directory/explorer/exists | 34 ++++++++++++ conf/type/__directory/gencode | 63 ++++++++++++++++++++++ conf/type/__directory/man.text | 69 ++++++++++++++++++++++++ conf/type/__directory/parameter/optional | 5 ++ conf/type/__directory/parameter/required | 1 + 5 files changed, 172 insertions(+) create mode 100755 conf/type/__directory/explorer/exists create mode 100755 conf/type/__directory/gencode create mode 100644 conf/type/__directory/man.text create mode 100644 conf/type/__directory/parameter/optional create mode 100644 conf/type/__directory/parameter/required diff --git a/conf/type/__directory/explorer/exists b/conf/type/__directory/explorer/exists new file mode 100755 index 00000000..b0be82fc --- /dev/null +++ b/conf/type/__directory/explorer/exists @@ -0,0 +1,34 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Check whether file exists or not +# + +if [ -f "$__object/parameter/destination" ]; then + destination="$(cat "$__object/parameter/destination")" +else + destination="/$__object_id" +fi + +if [ -e "$destination" ]; then + echo yes +else + echo no +fi diff --git a/conf/type/__directory/gencode b/conf/type/__directory/gencode new file mode 100755 index 00000000..08429b14 --- /dev/null +++ b/conf/type/__directory/gencode @@ -0,0 +1,63 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Handle directories +# + +# If destination was specified, do not use the id +if [ -f "$__object/parameter/destination" ]; then + destination="$(cat "$__object/parameter/destination")" +else + # If no destination has been supplied, the id is the destination + # Prepend /, which got lost in the object id (and relative paths + # don't make sense) + destination="/$__object_id" +fi + +# Ensure we have an absolute path +if ! $(echo "$destination" | grep -q ^/); then + echo "Error: Destination ($destination) of $__object_id is not absolute." >&2 + exit 1 +fi + +if [ -f "$__object/parameter/source" ]; then + echo "Source not supported for directory currently - FIXME" >&2 + exit 1 +else + if [ no = "$(cat "$__object/explorer/exists")" ]; then + echo mkdir \"$destination\" + fi +fi + + +# Mode settings +if [ -f "$__object/parameter/mode" ]; then + echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" +fi + +# Group +if [ -f "$__object/parameter/group" ]; then + echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" +fi + +# Owner +if [ -f "$__object/parameter/owner" ]; then + echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" +fi diff --git a/conf/type/__directory/man.text b/conf/type/__directory/man.text new file mode 100644 index 00000000..c60ada44 --- /dev/null +++ b/conf/type/__directory/man.text @@ -0,0 +1,69 @@ +cdist-type__file(7) +=================== +Nico Schottelius + + +NAME +---- +cdist-type__file - Create files + + +DESCRIPTION +----------- +This cdist type allows you to create files on the target. + + +REQUIRED PARAMETERS +------------------- +type:: + Specifies the type of file to be created. Either "directory" or "file" + + +OPTIONAL PARAMETERS +------------------- +destination:: + If supplied, use this as the destination on the target. Otherwise the + object_id is used. + +group:: + Group to chgrp to. + +mode:: + Unix permissions, suitable for chmod. + +owner:: + User to chown to. + +source:: + If supplied, copy this file from the host running cdist to the target. + If not supplied, an empty file or directory will be created. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create /etc/cdist-configured as an empty file +__file /etc/cdist-configured --type file + +# Same but with a different object id +__file cdist-marker --type file --destination /etc/cdist-configured + +# Use __file from another type +__file /etc/issue --source "$__type/files/archlinux" --type file + +# Supply some more settings +__file /etc/shadow --source "$__type/files/shadow" --type file \ + --owner root --group shadow --mode 0640 +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__directory/parameter/optional b/conf/type/__directory/parameter/optional new file mode 100644 index 00000000..0c30f4be --- /dev/null +++ b/conf/type/__directory/parameter/optional @@ -0,0 +1,5 @@ +group +mode +owner +source +destination diff --git a/conf/type/__directory/parameter/required b/conf/type/__directory/parameter/required new file mode 100644 index 00000000..aa80e646 --- /dev/null +++ b/conf/type/__directory/parameter/required @@ -0,0 +1 @@ +type From a9d0bfee16c484696b0a1230bb6b94ad29a9adfc Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 16:47:40 +0100 Subject: [PATCH 0033/5465] new type __user Signed-off-by: Steven Armstrong --- conf/type/__user/TODO | 3 ++ conf/type/__user/explorer/passwd | 27 +++++++++++++ conf/type/__user/gencode | 44 ++++++++++++++++++++ conf/type/__user/man.text | 62 +++++++++++++++++++++++++++++ conf/type/__user/parameter/optional | 7 ++++ 5 files changed, 143 insertions(+) create mode 100644 conf/type/__user/TODO create mode 100755 conf/type/__user/explorer/passwd create mode 100755 conf/type/__user/gencode create mode 100644 conf/type/__user/man.text create mode 100644 conf/type/__user/parameter/optional diff --git a/conf/type/__user/TODO b/conf/type/__user/TODO new file mode 100644 index 00000000..5c2eec7d --- /dev/null +++ b/conf/type/__user/TODO @@ -0,0 +1,3 @@ +- gencode: compair new value with existing one in $__object/explorer/passwd, only change if nessecary +- delete users + diff --git a/conf/type/__user/explorer/passwd b/conf/type/__user/explorer/passwd new file mode 100755 index 00000000..fdbfb193 --- /dev/null +++ b/conf/type/__user/explorer/passwd @@ -0,0 +1,27 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Get an existing users passwd entry. +# + +name=$__object_id + +getent passwd "$name" || true + diff --git a/conf/type/__user/gencode b/conf/type/__user/gencode new file mode 100755 index 00000000..7445d6f8 --- /dev/null +++ b/conf/type/__user/gencode @@ -0,0 +1,44 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Manage users. +# + +name="$__object_id" + +command= +if grep -q "^$name" "$__object/explorer/passwd"; then + # user exists + command="usermod" +else + # user does not exist + command="useradd" +fi + + +set -- "$@" +cd "$__object/parameter" +for property in $(ls .); do + # TODO: compair new value with existing one in $__object/explorer/passwd, only change if nessecary + set -- "$@" "--$property" "$(cat "$property")" +done + +echo $command $@ $name + diff --git a/conf/type/__user/man.text b/conf/type/__user/man.text new file mode 100644 index 00000000..e571c7c5 --- /dev/null +++ b/conf/type/__user/man.text @@ -0,0 +1,62 @@ +cdist-type__user(7) +=================== +Steven Armstrong + + +NAME +---- +cdist-type__user - Manage users + + +DESCRIPTION +----------- +This cdist type allows you to create or modify users on the target. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +comment:: + see usermod(8) +home:: + see above +gid:: + see above +groups:: + see above +password:: + see above +shell:: + see above +uid:: + see above + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create user account for foobar with operating system default settings +__user foobar + +# Same but with a different shell +__user foobar --shell /bin/zsh + +# Set explicit uid and home +__user foobar --uid 1001 --shell /bin/zsh --home /home/foobar +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__user/parameter/optional b/conf/type/__user/parameter/optional new file mode 100644 index 00000000..fe02e227 --- /dev/null +++ b/conf/type/__user/parameter/optional @@ -0,0 +1,7 @@ +comment +home +gid +groups +password +shell +uid From 26b10dec6906bf93cd5dec6017d4dafa04eae669 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 17:01:35 +0100 Subject: [PATCH 0034/5465] +man Signed-off-by: Steven Armstrong --- conf/type/__package/man.text | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 conf/type/__package/man.text diff --git a/conf/type/__package/man.text b/conf/type/__package/man.text new file mode 100644 index 00000000..eeeceba0 --- /dev/null +++ b/conf/type/__package/man.text @@ -0,0 +1,61 @@ +cdist-type__user(7) +=================== +Steven Armstrong + + +NAME +---- +cdist-type__package - Manage packages + + +DESCRIPTION +----------- +This cdist type allows you to install or uninstall packages on the target. +It dispatches the actual work to the package system dependant types. + + +REQUIRED PARAMETERS +------------------- +state:: + The state the package should be in, either "installed" or "uninstalled" + + +OPTIONAL PARAMETERS +------------------- +name:: + The name of the package to install. Default is to use the object_id as the + package name. +version:: + The version of the package to install. Default is to install the version + choosen by the local package manager. +type:: + The package type to use. Default is determined based on the $os explorer + variable. + e.g. __package_apt for Debian + __package_emerge for Gentoo + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Install the package vim on the target +__package vim --state installed + +# Same but install specific version +__package vim --state installed --version 7.3.50 + +# Force use of a specific package type +__package vim --state installed --type __package_apt +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From f2f67ad0ad5713ae67b72fbdbe5a928b4a47a317 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 17:09:45 +0100 Subject: [PATCH 0035/5465] +man __package_emerge/man.text Signed-off-by: Steven Armstrong --- conf/type/__package_emerge/man.text | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 conf/type/__package_emerge/man.text diff --git a/conf/type/__package_emerge/man.text b/conf/type/__package_emerge/man.text new file mode 100644 index 00000000..002821dd --- /dev/null +++ b/conf/type/__package_emerge/man.text @@ -0,0 +1,58 @@ +cdist-type__user(7) +=================== +Steven Armstrong + + +NAME +---- +cdist-type__package_emerge - Manage packages on Gentoo Linux + + +DESCRIPTION +----------- +This cdist type allows you to install or uninstall packages on a Gentoo Linux +target. + + +REQUIRED PARAMETERS +------------------- +state:: + The state the package should be in, either "installed" or "uninstalled" + + +OPTIONAL PARAMETERS +------------------- +name:: + The name of the package to install. Default is to use the object_id as the + package name. +version:: + FIXME: not yet implemented + The version of the package to install. Default is to install the version + choosen by the local package manager. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Install the package vim on the target +__package_emerge screen --state installed + +# Same but use full qualified package name +__package_emerge app-misc/screen --state installed + +# Same but use install specific package version +# FIXME: not yet implemented +__package_emerge app-misc/screen --state installed --version 4.0.3 +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From bead47f6bf52862c7f3e5df5b2a91304f1b39009 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 17:10:27 +0100 Subject: [PATCH 0036/5465] remove currently unhandled parameter Signed-off-by: Steven Armstrong --- conf/type/__package_emerge/parameter/optional | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/type/__package_emerge/parameter/optional b/conf/type/__package_emerge/parameter/optional index a52167d3..f121bdbf 100644 --- a/conf/type/__package_emerge/parameter/optional +++ b/conf/type/__package_emerge/parameter/optional @@ -1,2 +1 @@ name -version From f5ed590e16995eb2b10da52c8b57b6d1582f68d1 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 17:15:35 +0100 Subject: [PATCH 0037/5465] changelog++ Signed-off-by: Steven Armstrong --- doc/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog b/doc/changelog index c939b547..534f4c3e 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,9 @@ * New type __motd * New type __addifnosuchline * Document type __issue + * New type __user + * Document type __package + * Document type __package_emerge 1.0.3: 2011-03-11 * Update regexp used for sane characters From 88e48c391e2ab3361bf76ad107c408933cb556a7 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 17:19:20 +0100 Subject: [PATCH 0038/5465] fix borken paths in cdist-type-template Signed-off-by: Steven Armstrong --- bin/cdist-type-template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cdist-type-template b/bin/cdist-type-template index 0391510c..cd34027c 100755 --- a/bin/cdist-type-template +++ b/bin/cdist-type-template @@ -37,7 +37,7 @@ touch "$(__cdist_type_parameter_dir "$__cdist_type")/${__cdist_name_parameter_re touch "$(__cdist_type_parameter_dir "$__cdist_type")/${__cdist_name_parameter_optional}" # Manifest -cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_parameter_dir "$__cdist_type")/${__cdist_name_manifest}" +cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_manifest}" # # This is the manifest, which can be used to create other objects like this: @@ -50,7 +50,7 @@ cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_parameter_ eof # Gencode -cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_parameter_dir "$__cdist_type")/${__cdist_name_gencode}" +cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_gencode}" # # This file should generate code on stdout, which will be collected by cdist @@ -63,4 +63,4 @@ cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_parameter_ eof # Explorer -mkdir -p "$(__cdist_type_parameter_dir "$__cdist_type")/${__cdist_name_explorer}" +mkdir -p "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_explorer}" From 4f8932c1427b3491f05dd289fd08e448d67e3bac Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 15 Mar 2011 19:07:58 +0100 Subject: [PATCH 0039/5465] Documented parameters for __addifnosuchline --- .../to_check/cdist-type-addifnosuchline.text | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/man/to_check/cdist-type-addifnosuchline.text b/doc/man/to_check/cdist-type-addifnosuchline.text index 09618dc3..12690000 100644 --- a/doc/man/to_check/cdist-type-addifnosuchline.text +++ b/doc/man/to_check/cdist-type-addifnosuchline.text @@ -19,6 +19,31 @@ cdist-type-addifnosuchline can be used to check a file for existence of a specific line and adding that if not found +REQUIRED PARAMETERS +------------------- +line:: + Specifies the content which shall be added if not existing. + + +OPTIONAL PARAMETERS +------------------- +file:: + If supplied, use this as the destination file. Otherwise the + object_id is used. + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Creates or appends the line specifiend in "foo" to the file "bar" + +__addifnosuchline foo --file bar --line foo + +# Adds the line "foo2" to the file "bar" +__addifnosuchline foo --file bar --line foo2 + +-------------------------------------------------------------------------------- + SEE ALSO -------- cdist(7) From 7c4cff6286ffa121df9bb8d6624c289df03c94a0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 19:56:49 +0100 Subject: [PATCH 0040/5465] + type proposal Signed-off-by: Nico Schottelius --- doc/dev/logs/2011-03-15.file_directory_link | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/dev/logs/2011-03-15.file_directory_link diff --git a/doc/dev/logs/2011-03-15.file_directory_link b/doc/dev/logs/2011-03-15.file_directory_link new file mode 100644 index 00000000..ba4607ca --- /dev/null +++ b/doc/dev/logs/2011-03-15.file_directory_link @@ -0,0 +1,7 @@ +Proposal for new types, which replace __file: + +__directory /etc [--mode --owner --group --parents [yes|no] ] + +__link /destination --source abc --type [symbolic|hard] + +__file /etc/passwd [--source] --mode --owner --group From f306004c9ca018abad6e1e1207ace40f01035127 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 15 Mar 2011 20:16:56 +0100 Subject: [PATCH 0041/5465] Moved manpages for addifnosuchline --- asd | 0 doc/man/{to_check => }/cdist-type-addifnosuchline.text | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 asd rename doc/man/{to_check => }/cdist-type-addifnosuchline.text (100%) diff --git a/asd b/asd deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/man/to_check/cdist-type-addifnosuchline.text b/doc/man/cdist-type-addifnosuchline.text similarity index 100% rename from doc/man/to_check/cdist-type-addifnosuchline.text rename to doc/man/cdist-type-addifnosuchline.text From 3d24edae511bb57002b62e2e5a4c0a8d8a223a87 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 20:37:23 +0100 Subject: [PATCH 0042/5465] + template for __link Signed-off-by: Nico Schottelius --- conf/type/__link/gencode | 43 ++++++++++++++++++++++ conf/type/__link/man.text | 57 +++++++++++++++++++++++++++++ conf/type/__link/parameter/optional | 5 +++ conf/type/__link/parameter/required | 1 + 4 files changed, 106 insertions(+) create mode 100755 conf/type/__link/gencode create mode 100644 conf/type/__link/man.text create mode 100644 conf/type/__link/parameter/optional create mode 100644 conf/type/__link/parameter/required diff --git a/conf/type/__link/gencode b/conf/type/__link/gencode new file mode 100755 index 00000000..4a97ac34 --- /dev/null +++ b/conf/type/__link/gencode @@ -0,0 +1,43 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# __file is a very basic type and should be able to be used as an +# example for typewrites later +# + +destination="/$__object_id" + +type="$(cat "$__object/parameter/type")" +source="$(cat "$__object/parameter/source")" + +case "$type" in + symbolic) + lnopt="-s" + ;; + hard) + lnopt="" + ;; + *) + echo "Unknown type: $type" >&2 + exit 1 + ;; +esac + +echo ln ${lnopts} -f \"$source\" \"$destination\" diff --git a/conf/type/__link/man.text b/conf/type/__link/man.text new file mode 100644 index 00000000..5022697a --- /dev/null +++ b/conf/type/__link/man.text @@ -0,0 +1,57 @@ +cdist-type__link(7) +=================== +Nico Schottelius + + +NAME +---- +cdist-type__link - Create links + + +DESCRIPTION +----------- +This cdist type allows you to hard and symoblic links. The given +object id is the destination for the link. + + +REQUIRED PARAMETERS +------------------- +source:: + Specifies the link source. + +source:: + Specifies the link type: Either hard or symoblic. + + +OPTIONAL PARAMETERS +------------------- +None. + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create /etc/cdist-configured as an empty file +__file /etc/cdist-configured --type file + +# Same but with a different object id +__file cdist-marker --type file --destination /etc/cdist-configured + +# Use __file from another type +__file /etc/issue --source "$__type/files/archlinux" --type file + +# Supply some more settings +__file /etc/shadow --source "$__type/files/shadow" --type file \ + --owner root --group shadow --mode 0640 +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__link/parameter/optional b/conf/type/__link/parameter/optional new file mode 100644 index 00000000..0c30f4be --- /dev/null +++ b/conf/type/__link/parameter/optional @@ -0,0 +1,5 @@ +group +mode +owner +source +destination diff --git a/conf/type/__link/parameter/required b/conf/type/__link/parameter/required new file mode 100644 index 00000000..aa80e646 --- /dev/null +++ b/conf/type/__link/parameter/required @@ -0,0 +1 @@ +type From b8c68fcb9eacd5652047f7fdd763e835f65b5951 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 20:37:51 +0100 Subject: [PATCH 0043/5465] remove explorer for __directory Signed-off-by: Nico Schottelius --- conf/type/__directory/gencode | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/conf/type/__directory/gencode b/conf/type/__directory/gencode index 08429b14..99a89bd1 100755 --- a/conf/type/__directory/gencode +++ b/conf/type/__directory/gencode @@ -37,13 +37,8 @@ if ! $(echo "$destination" | grep -q ^/); then exit 1 fi -if [ -f "$__object/parameter/source" ]; then - echo "Source not supported for directory currently - FIXME" >&2 - exit 1 -else - if [ no = "$(cat "$__object/explorer/exists")" ]; then - echo mkdir \"$destination\" - fi +if [ no = "$(cat "$__object/explorer/exists")" ]; then + echo mkdir \"$destination\" fi From 2072fc196f3ed01b045e3836f6afb33f27fdf335 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 15 Mar 2011 20:46:15 +0100 Subject: [PATCH 0044/5465] Examples changed --- doc/man/cdist-type-addifnosuchline.text | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/man/cdist-type-addifnosuchline.text b/doc/man/cdist-type-addifnosuchline.text index 12690000..2222283a 100644 --- a/doc/man/cdist-type-addifnosuchline.text +++ b/doc/man/cdist-type-addifnosuchline.text @@ -15,14 +15,14 @@ cdist-type-addifnosuchline Add if no such line DESCRIPTION ----------- -cdist-type-addifnosuchline can be used to check a file for existence of a +cdist-type-addifnosuchline can be used to check a file for existence of a specific line and adding that if not found REQUIRED PARAMETERS ------------------- line:: - Specifies the content which shall be added if not existing. + Specifies the content which shall be added if not existing. OPTIONAL PARAMETERS @@ -35,12 +35,12 @@ EXAMPLES -------- -------------------------------------------------------------------------------- -# Creates or appends the line specifiend in "foo" to the file "bar" +# Creates or appends the line specifiend in "include_www" to the file "lighttpd.conf" -__addifnosuchline foo --file bar --line foo +__addifnosuchline www --file lighttpd.conf --line include_www -# Adds the line "foo2" to the file "bar" -__addifnosuchline foo --file bar --line foo2 +# Adds the line "include_git" to the file "bar" +__addifnosuchline git_web --file lighttpd.conf --line include_git -------------------------------------------------------------------------------- From 4c59a0fde14312ad06734ca0ec60ef822b5892a6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 20:51:09 +0100 Subject: [PATCH 0045/5465] cleanup __link Signed-off-by: Nico Schottelius --- conf/type/__link/man.text | 20 +++++++++----------- conf/type/__link/parameter/optional | 5 ----- conf/type/__link/parameter/required | 1 + 3 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 conf/type/__link/parameter/optional diff --git a/conf/type/__link/man.text b/conf/type/__link/man.text index 5022697a..db124cb9 100644 --- a/conf/type/__link/man.text +++ b/conf/type/__link/man.text @@ -19,7 +19,7 @@ REQUIRED PARAMETERS source:: Specifies the link source. -source:: +type:: Specifies the link type: Either hard or symoblic. @@ -31,18 +31,16 @@ EXAMPLES -------- -------------------------------------------------------------------------------- -# Create /etc/cdist-configured as an empty file -__file /etc/cdist-configured --type file +# Create hard link of /etc/shadow +__file /root/shadow --source /etc/shadow --type hard -# Same but with a different object id -__file cdist-marker --type file --destination /etc/cdist-configured +# Relative symbolic link +__file /etc/apache2/sites-enabled/www.test.ch \ + --source ../sites-available/www.test.ch \ + --type symbolic -# Use __file from another type -__file /etc/issue --source "$__type/files/archlinux" --type file - -# Supply some more settings -__file /etc/shadow --source "$__type/files/shadow" --type file \ - --owner root --group shadow --mode 0640 +# Relative absolute link +__file /opt/plone --source /home/services/plone --type symbolic -------------------------------------------------------------------------------- diff --git a/conf/type/__link/parameter/optional b/conf/type/__link/parameter/optional deleted file mode 100644 index 0c30f4be..00000000 --- a/conf/type/__link/parameter/optional +++ /dev/null @@ -1,5 +0,0 @@ -group -mode -owner -source -destination diff --git a/conf/type/__link/parameter/required b/conf/type/__link/parameter/required index aa80e646..f7facfb8 100644 --- a/conf/type/__link/parameter/required +++ b/conf/type/__link/parameter/required @@ -1 +1,2 @@ +source type From 42c87edad1bafbb143822ef3f3bf43363a6d1b46 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 20:52:52 +0100 Subject: [PATCH 0046/5465] moved __package_gentoo to gentoo branch Signed-off-by: Steven Armstrong --- conf/type/__package_emerge/gencode | 43 -------------- conf/type/__package_emerge/man.text | 58 ------------------- conf/type/__package_emerge/manifest | 36 ------------ conf/type/__package_emerge/parameter/optional | 1 - conf/type/__package_emerge/parameter/required | 1 - 5 files changed, 139 deletions(-) delete mode 100755 conf/type/__package_emerge/gencode delete mode 100644 conf/type/__package_emerge/man.text delete mode 100755 conf/type/__package_emerge/manifest delete mode 100644 conf/type/__package_emerge/parameter/optional delete mode 100644 conf/type/__package_emerge/parameter/required diff --git a/conf/type/__package_emerge/gencode b/conf/type/__package_emerge/gencode deleted file mode 100755 index 47e8bc5e..00000000 --- a/conf/type/__package_emerge/gencode +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Manage packages on gentoo. -# - -if [ -f "$__object/parameter/name" ]; then - name="$(cat "$__object/parameter/name")" -else - name="$__object_id" -fi - -state="$(cat "$__object/parameter/state")" - -case "$state" in - installed) - # FIXME: only install if not already installed - echo "emerge -q \"$name\"" - ;; - uninstalled) - # FIXME: only uninstall if currently installed - echo "emerge -q -C \"$name\"" - ;; -esac - -exit 0 diff --git a/conf/type/__package_emerge/man.text b/conf/type/__package_emerge/man.text deleted file mode 100644 index 002821dd..00000000 --- a/conf/type/__package_emerge/man.text +++ /dev/null @@ -1,58 +0,0 @@ -cdist-type__user(7) -=================== -Steven Armstrong - - -NAME ----- -cdist-type__package_emerge - Manage packages on Gentoo Linux - - -DESCRIPTION ------------ -This cdist type allows you to install or uninstall packages on a Gentoo Linux -target. - - -REQUIRED PARAMETERS -------------------- -state:: - The state the package should be in, either "installed" or "uninstalled" - - -OPTIONAL PARAMETERS -------------------- -name:: - The name of the package to install. Default is to use the object_id as the - package name. -version:: - FIXME: not yet implemented - The version of the package to install. Default is to install the version - choosen by the local package manager. - - -EXAMPLES --------- - --------------------------------------------------------------------------------- -# Install the package vim on the target -__package_emerge screen --state installed - -# Same but use full qualified package name -__package_emerge app-misc/screen --state installed - -# Same but use install specific package version -# FIXME: not yet implemented -__package_emerge app-misc/screen --state installed --version 4.0.3 --------------------------------------------------------------------------------- - - -SEE ALSO --------- -- cdist-type(7) - - -COPYING -------- -Copyright \(C) 2011 Steven Armstrong. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__package_emerge/manifest b/conf/type/__package_emerge/manifest deleted file mode 100755 index 178fa510..00000000 --- a/conf/type/__package_emerge/manifest +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# __package is an abstract type which dispatches to the lower level -# __package_$name types which do the actual interaction with the packaging -# system. -# - -# TODO: depend on package gentoolkit for qpkg - -# TODO: -# if /var/cache/eix is older then /usr/portage/metadata/timestamp -# then run /usr/bin/eix-update -# -# check if package is installed: -# -# get currently installed version: -# - diff --git a/conf/type/__package_emerge/parameter/optional b/conf/type/__package_emerge/parameter/optional deleted file mode 100644 index f121bdbf..00000000 --- a/conf/type/__package_emerge/parameter/optional +++ /dev/null @@ -1 +0,0 @@ -name diff --git a/conf/type/__package_emerge/parameter/required b/conf/type/__package_emerge/parameter/required deleted file mode 100644 index ff72b5c7..00000000 --- a/conf/type/__package_emerge/parameter/required +++ /dev/null @@ -1 +0,0 @@ -state From c010c9b2886c1786b13c2bfadeea71a61bf1e1bd Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 15 Mar 2011 21:02:47 +0100 Subject: [PATCH 0047/5465] moved manpages --- .../type/__addifnosuchline/man.text | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/man/cdist-type-addifnosuchline.text => conf/type/__addifnosuchline/man.text (100%) diff --git a/doc/man/cdist-type-addifnosuchline.text b/conf/type/__addifnosuchline/man.text similarity index 100% rename from doc/man/cdist-type-addifnosuchline.text rename to conf/type/__addifnosuchline/man.text From 86d98ddec4aefe663c9f5bda4fc5e38819864cd6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:06:18 +0100 Subject: [PATCH 0048/5465] begin cleanup doc for __directory Signed-off-by: Nico Schottelius --- conf/type/__directory/gencode | 31 +++++++++++++++---------------- conf/type/__directory/man.text | 20 +++++++------------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/conf/type/__directory/gencode b/conf/type/__directory/gencode index 99a89bd1..6d226aae 100755 --- a/conf/type/__directory/gencode +++ b/conf/type/__directory/gencode @@ -20,28 +20,27 @@ # # Handle directories # +# +# __directory /etc [--mode --owner --group --parents [yes|no] ] +# -# If destination was specified, do not use the id -if [ -f "$__object/parameter/destination" ]; then - destination="$(cat "$__object/parameter/destination")" -else - # If no destination has been supplied, the id is the destination - # Prepend /, which got lost in the object id (and relative paths - # don't make sense) - destination="/$__object_id" -fi - -# Ensure we have an absolute path -if ! $(echo "$destination" | grep -q ^/); then - echo "Error: Destination ($destination) of $__object_id is not absolute." >&2 - exit 1 +destination="/$__object_id" + +# Include parent directories? +if [ -f "$__object/parameter/parents" ]; then + parents="$(cat "$__object/parameter/parents")" + if [ yes = "$parents" ]; then + mkdiropt="-p" + else + mkdiropt="" + fi fi +# Only create if not already existent if [ no = "$(cat "$__object/explorer/exists")" ]; then - echo mkdir \"$destination\" + echo mkdir $mkdiropt \"$destination\" fi - # Mode settings if [ -f "$__object/parameter/mode" ]; then echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" diff --git a/conf/type/__directory/man.text b/conf/type/__directory/man.text index c60ada44..a619666d 100644 --- a/conf/type/__directory/man.text +++ b/conf/type/__directory/man.text @@ -1,30 +1,25 @@ -cdist-type__file(7) -=================== +cdist-type__directory(7) +======================== Nico Schottelius NAME ---- -cdist-type__file - Create files +cdist-type__directory - Create a directory DESCRIPTION ----------- -This cdist type allows you to create files on the target. +This cdist type allows you to create directories on the target. REQUIRED PARAMETERS ------------------- -type:: - Specifies the type of file to be created. Either "directory" or "file" +None. OPTIONAL PARAMETERS ------------------- -destination:: - If supplied, use this as the destination on the target. Otherwise the - object_id is used. - group:: Group to chgrp to. @@ -34,9 +29,8 @@ mode:: owner:: User to chown to. -source:: - If supplied, copy this file from the host running cdist to the target. - If not supplied, an empty file or directory will be created. +parents:: + Whether to create parents as well (mkdir -p behaviour) EXAMPLES From 1202131195f4aa4474da941b220a554fd4836a0f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:11:59 +0100 Subject: [PATCH 0049/5465] update __directory parameters Signed-off-by: Nico Schottelius --- conf/type/__directory/parameter/optional | 3 +-- conf/type/__directory/parameter/required | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 conf/type/__directory/parameter/required diff --git a/conf/type/__directory/parameter/optional b/conf/type/__directory/parameter/optional index 0c30f4be..752c3989 100644 --- a/conf/type/__directory/parameter/optional +++ b/conf/type/__directory/parameter/optional @@ -1,5 +1,4 @@ group mode owner -source -destination +parents diff --git a/conf/type/__directory/parameter/required b/conf/type/__directory/parameter/required deleted file mode 100644 index aa80e646..00000000 --- a/conf/type/__directory/parameter/required +++ /dev/null @@ -1 +0,0 @@ -type From 1619964cbbdc61e0bb88c0478a37d26113b52e77 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:13:01 +0100 Subject: [PATCH 0050/5465] __file does not require --type anymore Signed-off-by: Nico Schottelius --- conf/type/__file/man.text | 3 +-- conf/type/__file/parameter/required | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 conf/type/__file/parameter/required diff --git a/conf/type/__file/man.text b/conf/type/__file/man.text index c60ada44..22b367cb 100644 --- a/conf/type/__file/man.text +++ b/conf/type/__file/man.text @@ -15,8 +15,7 @@ This cdist type allows you to create files on the target. REQUIRED PARAMETERS ------------------- -type:: - Specifies the type of file to be created. Either "directory" or "file" +None. OPTIONAL PARAMETERS diff --git a/conf/type/__file/parameter/required b/conf/type/__file/parameter/required deleted file mode 100644 index aa80e646..00000000 --- a/conf/type/__file/parameter/required +++ /dev/null @@ -1 +0,0 @@ -type From e06e8026dd81218ff6a36bc5f9c28ec86be2921e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:18:15 +0100 Subject: [PATCH 0051/5465] begin to cleanup __file Signed-off-by: Nico Schottelius --- conf/type/__file/gencode | 96 ++++++--------------- doc/dev/logs/2011-03-15.file_directory_link | 4 +- 2 files changed, 27 insertions(+), 73 deletions(-) diff --git a/conf/type/__file/gencode b/conf/type/__file/gencode index 531cc203..bf30bb2c 100755 --- a/conf/type/__file/gencode +++ b/conf/type/__file/gencode @@ -18,27 +18,13 @@ # along with cdist. If not, see . # # -# __file is a very basic type and should be able to be used as an -# example for typewrites later +# __file is a very basic type, which will probably be reused quite often # -# If destination was specified, do not use the id -if [ -f "$__object/parameter/destination" ]; then - destination="$(cat "$__object/parameter/destination")" -else - # If no destination has been supplied, the id is the destination - # Prepend /, which got lost in the object id (and relative paths - # don't make sense) - destination="/$__object_id" -fi - -# Ensure we have an absolute path -if ! $(echo "$destination" | grep -q ^/); then - echo "Error: Destination ($destination) of $__object_id is not absolute." >&2 - exit 1 -fi +destination="/$__object_id" # Use correct md5sum binary - MacOSx is different here +# FIXME: broken: we don't know the host os! case "$os" in macosx) md5sum="md5" @@ -49,63 +35,31 @@ case "$os" in ;; esac -type="$(cat "$__object/parameter/type")" +if [ -f "$__object/parameter/source" ]; then + source="$(cat "$__object/parameter/source")" -case "$type" in - directory) - if [ -f "$__object/parameter/source" ]; then - echo "Source not supported for directory currently - FIXME" >&2 - exit 1 - else - if [ no = "$(cat "$__object/explorer/exists")" ]; then - echo mkdir \"$destination\" - fi + if [ -f "$source" ]; then + local_md5sum="$($md5sum < "$source")" + remote_md5sum="$(cat "$__object/explorer/md5sum")" + + # FIXME: Is md5sum the right approach? + if [ "$local_md5sum" != "$remote_md5sum" ]; then + # FIXME: This is ugly and hardcoded, replace after 1.0! + # Probably a better aproach is to have the user configured + # ~/.ssh/config to contain the right username + # Probably describe it in cdist-quickstart... + scp "$source" "root@${__target_host}:${destination}" fi - ;; - - file) - if [ -f "$__object/parameter/source" ]; then - source="$(cat "$__object/parameter/source")" - - if [ -f "$source" ]; then - local_md5sum="$($md5sum < "$source")" - remote_md5sum="$(cat "$__object/explorer/md5sum")" - - # FIXME: Is md5sum the right approach? - if [ "$local_md5sum" != "$remote_md5sum" ]; then - # FIXME: This is ugly and hardcoded, replace after 1.0! - # Probably a better aproach is to have the user configured - # ~/.ssh/config to contain the right username - # Probably describe it in cdist-quickstart... - scp "$source" "root@${__target_host}:${destination}" - fi - else - echo "Source \"$source\" does not exist." >&2 - exit 1 - fi - else - if [ no = "$(cat "$__object/explorer/exists")" ]; then - echo touch \"$destination\" - fi - fi - ;; - - symlink) - if [ ! -f "$__object/parameter/source" ]; then - echo "Source required for symlink" >&2 - exit 1 - fi - source="$(cat "$__object/parameter/source")" - - # FIXME: handle directories or document & ignore? - echo ln -sf \"$source\" \"$destination\" - ;; - - *) - echo "Unsupported type: \"$type\"" >&2 + else + echo "Source \"$source\" does not exist." >&2 exit 1 - ;; -esac + fi +else + if [ no = "$(cat "$__object/explorer/exists")" ]; then + echo touch \"$destination\" + fi +fi + # Mode settings if [ -f "$__object/parameter/mode" ]; then diff --git a/doc/dev/logs/2011-03-15.file_directory_link b/doc/dev/logs/2011-03-15.file_directory_link index ba4607ca..8a975750 100644 --- a/doc/dev/logs/2011-03-15.file_directory_link +++ b/doc/dev/logs/2011-03-15.file_directory_link @@ -1,7 +1,7 @@ Proposal for new types, which replace __file: -__directory /etc [--mode --owner --group --parents [yes|no] ] +x __directory /etc [--mode --owner --group --parents [yes|no] ] -__link /destination --source abc --type [symbolic|hard] +x __link /destination --source abc --type [symbolic|hard] __file /etc/passwd [--source] --mode --owner --group From 2ed638a0a2bafc52f2421f808ee61be567c53aa1 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Tue, 15 Mar 2011 21:18:18 +0100 Subject: [PATCH 0052/5465] Minor doc fixes --- conf/type/__addifnosuchline/man.text | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/conf/type/__addifnosuchline/man.text b/conf/type/__addifnosuchline/man.text index 2222283a..3d332cd0 100644 --- a/conf/type/__addifnosuchline/man.text +++ b/conf/type/__addifnosuchline/man.text @@ -1,21 +1,21 @@ -cdist-type-addifnosuchline(1) +cdist-type__addifnosuchline(1) ====================== Daniel Roth NAME ---- -cdist-type-addifnosuchline +cdist-type__addifnosuchline - Add if no such line SYNOPSIS -------- -cdist-type-addifnosuchline Add if no such line +cdist-type__addifnosuchline - Add if no such line DESCRIPTION ----------- -cdist-type-addifnosuchline can be used to check a file for existence of a +cdist-type__addifnosuchline - can be used to check a file for existence of a specific line and adding that if not found @@ -36,17 +36,16 @@ EXAMPLES -------------------------------------------------------------------------------- # Creates or appends the line specifiend in "include_www" to the file "lighttpd.conf" - __addifnosuchline www --file lighttpd.conf --line include_www -# Adds the line "include_git" to the file "bar" -__addifnosuchline git_web --file lighttpd.conf --line include_git +# Adds the line "include_git" to the file "lighttpd.conf" +__addifnosuchline lighttpd.conf --line include_git -------------------------------------------------------------------------------- SEE ALSO -------- -cdist(7) +- cdist-type(7) COPYING From 4a44b3bdf5cb708135123fb87a6af29305336c9c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:19:49 +0100 Subject: [PATCH 0053/5465] __file: -destination Signed-off-by: Nico Schottelius --- conf/type/__file/parameter/optional | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/type/__file/parameter/optional b/conf/type/__file/parameter/optional index 0c30f4be..06120518 100644 --- a/conf/type/__file/parameter/optional +++ b/conf/type/__file/parameter/optional @@ -2,4 +2,3 @@ group mode owner source -destination From 6f7312e877bd166992f41b9f75f603fe128b8526 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:25:09 +0100 Subject: [PATCH 0054/5465] some cleanups in cdist-type__addifnosuchline(7) Signed-off-by: Nico Schottelius --- conf/type/__addifnosuchline/man.text | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/conf/type/__addifnosuchline/man.text b/conf/type/__addifnosuchline/man.text index 3d332cd0..722a3080 100644 --- a/conf/type/__addifnosuchline/man.text +++ b/conf/type/__addifnosuchline/man.text @@ -1,22 +1,17 @@ -cdist-type__addifnosuchline(1) -====================== +cdist-type__addifnosuchline(7) +============================== Daniel Roth NAME ---- -cdist-type__addifnosuchline - Add if no such line - - -SYNOPSIS --------- -cdist-type__addifnosuchline - Add if no such line +cdist-type__addifnosuchline - Add a line (if not existing already) DESCRIPTION ----------- -cdist-type__addifnosuchline - can be used to check a file for existence of a -specific line and adding that if not found +This type can be used to check a file for existence of a +specific line and adding it, if it was not found. REQUIRED PARAMETERS @@ -28,21 +23,22 @@ line:: OPTIONAL PARAMETERS ------------------- file:: - If supplied, use this as the destination file. Otherwise the - object_id is used. + If supplied, use this as the destination file. + Otherwise the object_id is used. + EXAMPLES -------- -------------------------------------------------------------------------------- # Creates or appends the line specifiend in "include_www" to the file "lighttpd.conf" -__addifnosuchline www --file lighttpd.conf --line include_www +__addifnosuchline www --file /etc/lighttpd.conf --line include_www # Adds the line "include_git" to the file "lighttpd.conf" -__addifnosuchline lighttpd.conf --line include_git - +__addifnosuchline /etc/lighttpd.conf --line include_git -------------------------------------------------------------------------------- + SEE ALSO -------- - cdist-type(7) From b19a29be6e9928da729a3f9748906c777c033954 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:30:02 +0100 Subject: [PATCH 0055/5465] make cdist-env usable standalone (i.e. without cdist-config) Signed-off-by: Nico Schottelius --- bin/cdist-env | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/cdist-env b/bin/cdist-env index e95e078b..a7610aac 100755 --- a/bin/cdist-env +++ b/bin/cdist-env @@ -18,14 +18,14 @@ # along with cdist. If not, see . # # -# Setup environment for use with cdist +# Setup environment for use with cdist - must be standalone! # -. cdist-config -[ $# -eq 0 ] || __cdist_usage "no arguments" - -# Allow access to unset variables like PATH and MANPATH -set +u +__cdist_pwd="$(pwd -P)" +__cdist_mydir="${0%/*}"; +__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" +__cdist_myname=${0##*/}; +__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" echo export PATH=$__cdist_abs_mydir:$PATH From 8fa48be2aeeeb15708ea7cc627b55be9841cebf9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:31:11 +0100 Subject: [PATCH 0056/5465] change footer (looks better) Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 7f66888f..d006dd2d 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -67,4 +67,4 @@ cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ # And finally - execute the code cdist-code-run-all "$__cdist_target_host" -echo "cdist $__cdist_version: success on $__cdist_target_host" +echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" From e69db644b468deaae62dabe3490779dd251f2a4e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 15 Mar 2011 21:38:09 +0100 Subject: [PATCH 0057/5465] prepare version 1.0.4 Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- doc/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 0d0fd152..61b7117f 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.0.3" +__cdist_version="1.0.4" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index 50fb9de1..c869c146 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.0.4: +1.0.4: 2011-03-15 * New type __motd * New type __addifnosuchline * Document type __issue From 1518bf19353294c6b0b95e35f838b2a27a59daa3 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 23:11:01 +0100 Subject: [PATCH 0058/5465] __user: only run commands if value has changed Signed-off-by: Steven Armstrong --- conf/type/__user/TODO | 1 - conf/type/__user/gencode | 28 +++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/conf/type/__user/TODO b/conf/type/__user/TODO index 5c2eec7d..fa6aeee7 100644 --- a/conf/type/__user/TODO +++ b/conf/type/__user/TODO @@ -1,3 +1,2 @@ -- gencode: compair new value with existing one in $__object/explorer/passwd, only change if nessecary - delete users diff --git a/conf/type/__user/gencode b/conf/type/__user/gencode index 7445d6f8..ca31f7d3 100755 --- a/conf/type/__user/gencode +++ b/conf/type/__user/gencode @@ -33,12 +33,34 @@ else fi +get_current_value() { + local key="$1" + local index + case "$key" in + uid) index=3;; + gid) index=4;; + comment) index=5;; + home) index=6;; + shell) index=7;; + esac + cut -d':' -f $index "$__object/explorer/passwd" +} + + set -- "$@" cd "$__object/parameter" for property in $(ls .); do - # TODO: compair new value with existing one in $__object/explorer/passwd, only change if nessecary - set -- "$@" "--$property" "$(cat "$property")" + current_value=$(get_current_value "$property") + new_value="$(cat "$property")" + if [ "$new_value" != "$current_value" ]; then + # Shedule changed properties for update + set -- "$@" "--$property" \"$new_value\" + fi done -echo $command $@ $name + +if [ $# -gt 0 ]; then + # Update changed properties + echo $command $@ $name +fi From 4432b476d08c812e9ee6221049c9ee7095143512 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 23:26:24 +0100 Subject: [PATCH 0059/5465] __user: only set password if it changed Signed-off-by: Steven Armstrong --- conf/type/__user/explorer/shadow | 27 +++++++++++++++++++++++++++ conf/type/__user/gencode | 4 ++++ 2 files changed, 31 insertions(+) create mode 100755 conf/type/__user/explorer/shadow diff --git a/conf/type/__user/explorer/shadow b/conf/type/__user/explorer/shadow new file mode 100755 index 00000000..eab6b2b8 --- /dev/null +++ b/conf/type/__user/explorer/shadow @@ -0,0 +1,27 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Get an existing users shadow entry. +# + +name=$__object_id + +grep "^$name" /etc/shadow || true + diff --git a/conf/type/__user/gencode b/conf/type/__user/gencode index ca31f7d3..5990ac92 100755 --- a/conf/type/__user/gencode +++ b/conf/type/__user/gencode @@ -37,6 +37,10 @@ get_current_value() { local key="$1" local index case "$key" in + password) + cut -d':' -f 2 "$__object/explorer/shadow" + break + ;; uid) index=3;; gid) index=4;; comment) index=5;; From 58718f735aee1f519816ba07e4d7deca44786bb6 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 23:35:55 +0100 Subject: [PATCH 0060/5465] use getent to get entry from shadow database Signed-off-by: Steven Armstrong --- conf/type/__user/explorer/shadow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__user/explorer/shadow b/conf/type/__user/explorer/shadow index eab6b2b8..c75e36f4 100755 --- a/conf/type/__user/explorer/shadow +++ b/conf/type/__user/explorer/shadow @@ -23,5 +23,5 @@ name=$__object_id -grep "^$name" /etc/shadow || true +getent shadow "$name" || true From ec99a22db61ee537836334fdfaa57f5968325b18 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 23:37:17 +0100 Subject: [PATCH 0061/5465] add new type __group Signed-off-by: Steven Armstrong --- conf/type/__group/TODO | 2 + conf/type/__group/explorer/group | 27 ++++++++++++ conf/type/__group/explorer/gshadow | 27 ++++++++++++ conf/type/__group/gencode | 66 ++++++++++++++++++++++++++++ conf/type/__group/man.text | 62 ++++++++++++++++++++++++++ conf/type/__group/parameter/optional | 2 + 6 files changed, 186 insertions(+) create mode 100644 conf/type/__group/TODO create mode 100755 conf/type/__group/explorer/group create mode 100755 conf/type/__group/explorer/gshadow create mode 100755 conf/type/__group/gencode create mode 100644 conf/type/__group/man.text create mode 100644 conf/type/__group/parameter/optional diff --git a/conf/type/__group/TODO b/conf/type/__group/TODO new file mode 100644 index 00000000..c20a5d21 --- /dev/null +++ b/conf/type/__group/TODO @@ -0,0 +1,2 @@ +- delete groups + diff --git a/conf/type/__group/explorer/group b/conf/type/__group/explorer/group new file mode 100755 index 00000000..4c1e6ac0 --- /dev/null +++ b/conf/type/__group/explorer/group @@ -0,0 +1,27 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Get an existing groups group entry. +# + +name=$__object_id + +getent group "$name" || true + diff --git a/conf/type/__group/explorer/gshadow b/conf/type/__group/explorer/gshadow new file mode 100755 index 00000000..51d502a1 --- /dev/null +++ b/conf/type/__group/explorer/gshadow @@ -0,0 +1,27 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Get an existing groups gshadow entry. +# + +name=$__object_id + +getent gshadow "$name" || true + diff --git a/conf/type/__group/gencode b/conf/type/__group/gencode new file mode 100755 index 00000000..527a6079 --- /dev/null +++ b/conf/type/__group/gencode @@ -0,0 +1,66 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Manage groups. +# + +name="$__object_id" + +command= +if grep -q "^$name" "$__object/explorer/group"; then + # group exists + command="groupmod" +else + # group does not exist + command="groupadd" +fi + + +get_current_value() { + local key="$1" + local index + case "$key" in + password) + cut -d':' -f 2 "$__object/explorer/gshadow" + break + ;; + gid) index=3;; + esac + cut -d':' -f $index "$__object/explorer/group" +} + + +set -- "$@" +cd "$__object/parameter" +for property in $(ls .); do + current_value=$(get_current_value "$property") + new_value="$(cat "$property")" + if [ "$new_value" != "$current_value" ]; then + # Shedule changed properties for update + set -- "$@" "--$property" \"$new_value\" + fi +done + + +if [ $# -gt 0 ]; then + # Update changed properties + echo $command $@ $name +fi + diff --git a/conf/type/__group/man.text b/conf/type/__group/man.text new file mode 100644 index 00000000..e571c7c5 --- /dev/null +++ b/conf/type/__group/man.text @@ -0,0 +1,62 @@ +cdist-type__user(7) +=================== +Steven Armstrong + + +NAME +---- +cdist-type__user - Manage users + + +DESCRIPTION +----------- +This cdist type allows you to create or modify users on the target. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +comment:: + see usermod(8) +home:: + see above +gid:: + see above +groups:: + see above +password:: + see above +shell:: + see above +uid:: + see above + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create user account for foobar with operating system default settings +__user foobar + +# Same but with a different shell +__user foobar --shell /bin/zsh + +# Set explicit uid and home +__user foobar --uid 1001 --shell /bin/zsh --home /home/foobar +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__group/parameter/optional b/conf/type/__group/parameter/optional new file mode 100644 index 00000000..4c661c8f --- /dev/null +++ b/conf/type/__group/parameter/optional @@ -0,0 +1,2 @@ +gid +password From af0b62ecef6722c3a2ec7848315c4eebdb67b946 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Mar 2011 23:41:30 +0100 Subject: [PATCH 0062/5465] update man page for __group type Signed-off-by: Steven Armstrong --- conf/type/__group/man.text | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/conf/type/__group/man.text b/conf/type/__group/man.text index e571c7c5..26b52111 100644 --- a/conf/type/__group/man.text +++ b/conf/type/__group/man.text @@ -1,16 +1,16 @@ -cdist-type__user(7) +cdist-type__group(7) =================== Steven Armstrong NAME ---- -cdist-type__user - Manage users +cdist-type__group - Manage groups DESCRIPTION ----------- -This cdist type allows you to create or modify users on the target. +This cdist type allows you to create or modify groups on the target. REQUIRED PARAMETERS @@ -20,34 +20,24 @@ None. OPTIONAL PARAMETERS ------------------- -comment:: - see usermod(8) -home:: - see above gid:: - see above -groups:: - see above + see groupmod(8) password:: see above -shell:: - see above -uid:: - see above EXAMPLES -------- -------------------------------------------------------------------------------- -# Create user account for foobar with operating system default settings -__user foobar +# Create a group 'foobar' with operating system default settings +__group foobar -# Same but with a different shell -__user foobar --shell /bin/zsh +# Same but with a specific gid +__group foobar --gid 1234 -# Set explicit uid and home -__user foobar --uid 1001 --shell /bin/zsh --home /home/foobar +# Same but with a gid and password +__group foobar --gid 1234 --password 'crypted-password-string' -------------------------------------------------------------------------------- From f69802b3d89fbcd144377356f0ec4881570a0a75 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 08:25:36 +0100 Subject: [PATCH 0063/5465] s/md5sum/cksum/g Signed-off-by: Nico Schottelius --- conf/type/__file/explorer/{md5sum => cksum} | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) rename conf/type/__file/explorer/{md5sum => cksum} (82%) diff --git a/conf/type/__file/explorer/md5sum b/conf/type/__file/explorer/cksum similarity index 82% rename from conf/type/__file/explorer/md5sum rename to conf/type/__file/explorer/cksum index 4ac0e1b9..6bcf9cd0 100755 --- a/conf/type/__file/explorer/md5sum +++ b/conf/type/__file/explorer/cksum @@ -27,22 +27,9 @@ else destination="/$__object_id" fi -os="$(cat $__global/explorer/os)" - -case "$os" in - macosx) - md5sum="md5" - ;; - - *) - md5sum="md5sum" - ;; -esac - -# No output if file does not exist - does definitely not match the md5sum :-) if [ -e "$destination" ]; then if [ -f "$destination" ]; then - $md5sum < "$destination" + cksum < "$destination" else echo "NO REGULAR FILE" fi From 501fcf36d191ea5dcf47249950e1daf2def24539 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 08:30:02 +0100 Subject: [PATCH 0064/5465] remove old --destination parameter from __file explorers Signed-off-by: Nico Schottelius --- conf/type/__file/explorer/cksum | 6 +----- conf/type/__file/explorer/exists | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/conf/type/__file/explorer/cksum b/conf/type/__file/explorer/cksum index 6bcf9cd0..dcad99ba 100755 --- a/conf/type/__file/explorer/cksum +++ b/conf/type/__file/explorer/cksum @@ -21,11 +21,7 @@ # Retrieve the md5sum of a file to be created, if it is already existing. # -if [ -f "$__object/parameter/destination" ]; then - destination="$(cat "$__object/parameter/destination")" -else - destination="/$__object_id" -fi +destination="/$__object_id" if [ -e "$destination" ]; then if [ -f "$destination" ]; then diff --git a/conf/type/__file/explorer/exists b/conf/type/__file/explorer/exists index b0be82fc..f8b85671 100755 --- a/conf/type/__file/explorer/exists +++ b/conf/type/__file/explorer/exists @@ -21,11 +21,7 @@ # Check whether file exists or not # -if [ -f "$__object/parameter/destination" ]; then - destination="$(cat "$__object/parameter/destination")" -else - destination="/$__object_id" -fi +destination="/$__object_id" if [ -e "$destination" ]; then echo yes From bf60df1a9baed8a5b6665262a8a4f9a2db0160de Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 08:31:30 +0100 Subject: [PATCH 0065/5465] cleanup in __file manifest Signed-off-by: Nico Schottelius --- conf/type/__file/gencode | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/conf/type/__file/gencode b/conf/type/__file/gencode index bf30bb2c..ef8c5501 100755 --- a/conf/type/__file/gencode +++ b/conf/type/__file/gencode @@ -23,28 +23,15 @@ destination="/$__object_id" -# Use correct md5sum binary - MacOSx is different here -# FIXME: broken: we don't know the host os! -case "$os" in - macosx) - md5sum="md5" - ;; - - *) - md5sum="md5sum" - ;; -esac - if [ -f "$__object/parameter/source" ]; then source="$(cat "$__object/parameter/source")" if [ -f "$source" ]; then - local_md5sum="$($md5sum < "$source")" - remote_md5sum="$(cat "$__object/explorer/md5sum")" + local_cksum="$(cksum < "$source")" + remote_cksum="$(cat "$__object/explorer/cksum")" - # FIXME: Is md5sum the right approach? - if [ "$local_md5sum" != "$remote_md5sum" ]; then - # FIXME: This is ugly and hardcoded, replace after 1.0! + if [ "$local_cksum" != "$remote_cksum" ]; then + # FIXME: The username is ugly and hardcoded, replace after 1.0! # Probably a better aproach is to have the user configured # ~/.ssh/config to contain the right username # Probably describe it in cdist-quickstart... From e7f64758ce18050def03d9423e1495ba4a2e0361 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 08:39:51 +0100 Subject: [PATCH 0066/5465] update conf/manifest/init example Signed-off-by: Nico Schottelius --- conf/manifest/init | 7 ++++--- doc/dev/logs/2011-03-15.file_directory_link | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/conf/manifest/init b/conf/manifest/init index 0a1dca50..0241423b 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -7,13 +7,14 @@ # Every machine becomes a marker, so sysadmins know that automatic # configurations are happening -__file /etc/cdist-configured --type file +__file /etc/cdist-configured case "$__target_host" in # Everybody has this localhost) - # Usual example - __file test --type symlink --source /etc/cdist-configured --destination /tmp/cdist-testfile + __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic + __directory /tmp/cdist-test-dir --mode 4777 + __file /tmp/cdist-test-file --mode 0750 --owner nobody --group root ;; # diff --git a/doc/dev/logs/2011-03-15.file_directory_link b/doc/dev/logs/2011-03-15.file_directory_link index 8a975750..9044bc33 100644 --- a/doc/dev/logs/2011-03-15.file_directory_link +++ b/doc/dev/logs/2011-03-15.file_directory_link @@ -4,4 +4,4 @@ x __directory /etc [--mode --owner --group --parents [yes|no] ] x __link /destination --source abc --type [symbolic|hard] -__file /etc/passwd [--source] --mode --owner --group +x __file /etc/passwd [--source] --mode --owner --group From 2b2545ed8cf20824364eaf85df0afa1ced868182 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 08:40:36 +0100 Subject: [PATCH 0067/5465] add changes for 1.1 release Signed-off-by: Nico Schottelius --- doc/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog b/doc/changelog index c869c146..d83d3d44 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.1: + * Replace type __file with __file, __directory, __link + 1.0.4: 2011-03-15 * New type __motd * New type __addifnosuchline From d2c4ffb5f00ea30382c92e1d1b2432d0d19a6729 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 08:45:01 +0100 Subject: [PATCH 0068/5465] cleanup manpages for new types Signed-off-by: Nico Schottelius --- conf/type/__directory/man.text | 15 ++++----------- conf/type/__file/man.text | 13 +++---------- conf/type/__link/man.text | 9 +++++---- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/conf/type/__directory/man.text b/conf/type/__directory/man.text index a619666d..f7272df9 100644 --- a/conf/type/__directory/man.text +++ b/conf/type/__directory/man.text @@ -37,18 +37,11 @@ EXAMPLES -------- -------------------------------------------------------------------------------- -# Create /etc/cdist-configured as an empty file -__file /etc/cdist-configured --type file +# A silly example +__directory /tmp/foobar -# Same but with a different object id -__file cdist-marker --type file --destination /etc/cdist-configured - -# Use __file from another type -__file /etc/issue --source "$__type/files/archlinux" --type file - -# Supply some more settings -__file /etc/shadow --source "$__type/files/shadow" --type file \ - --owner root --group shadow --mode 0640 +# Ensure /etc exists correctly +__file /etc --owner root --group root --mode 0755 -------------------------------------------------------------------------------- diff --git a/conf/type/__file/man.text b/conf/type/__file/man.text index 22b367cb..67ab53d1 100644 --- a/conf/type/__file/man.text +++ b/conf/type/__file/man.text @@ -20,10 +20,6 @@ None. OPTIONAL PARAMETERS ------------------- -destination:: - If supplied, use this as the destination on the target. Otherwise the - object_id is used. - group:: Group to chgrp to. @@ -43,16 +39,13 @@ EXAMPLES -------------------------------------------------------------------------------- # Create /etc/cdist-configured as an empty file -__file /etc/cdist-configured --type file - -# Same but with a different object id -__file cdist-marker --type file --destination /etc/cdist-configured +__file /etc/cdist-configured # Use __file from another type -__file /etc/issue --source "$__type/files/archlinux" --type file +__file /etc/issue --source "$__type/files/archlinux" # Supply some more settings -__file /etc/shadow --source "$__type/files/shadow" --type file \ +__file /etc/shadow --source "$__type/files/shadow" \ --owner root --group shadow --mode 0640 -------------------------------------------------------------------------------- diff --git a/conf/type/__link/man.text b/conf/type/__link/man.text index db124cb9..fb914298 100644 --- a/conf/type/__link/man.text +++ b/conf/type/__link/man.text @@ -27,20 +27,21 @@ OPTIONAL PARAMETERS ------------------- None. + EXAMPLES -------- -------------------------------------------------------------------------------- # Create hard link of /etc/shadow -__file /root/shadow --source /etc/shadow --type hard +__link /root/shadow --source /etc/shadow --type hard # Relative symbolic link -__file /etc/apache2/sites-enabled/www.test.ch \ +__link /etc/apache2/sites-enabled/www.test.ch \ --source ../sites-available/www.test.ch \ --type symbolic -# Relative absolute link -__file /opt/plone --source /home/services/plone --type symbolic +# Absolute symbolic link +__link /opt/plone --source /home/services/plone --type symbolic -------------------------------------------------------------------------------- From 693e1be85e8ece59c14d9017d606a0b29acd7f0a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 08:54:35 +0100 Subject: [PATCH 0069/5465] add initial manpage for cdist-env Signed-off-by: Nico Schottelius --- doc/man/cdist-env.text | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/man/cdist-env.text diff --git a/doc/man/cdist-env.text b/doc/man/cdist-env.text new file mode 100644 index 00000000..4c2d73bc --- /dev/null +++ b/doc/man/cdist-env.text @@ -0,0 +1,32 @@ +cdist-env(1) +============ +Nico Schottelius + + +NAME +---- +cdist-env - Setup environment for using cdist + + +SYNOPSIS +-------- +cdist-env + + +DESCRIPTION +----------- +cdist-env outputs two strings suitable for usage in your current shell, +so you can use cdist from the checkout. You can evaluate those strings +and make directory usage of them. + + + +SEE ALSO +-------- +cdist(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 01ffe2f3ad855e58340e63a068fd97ca17ab1f0e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 09:00:22 +0100 Subject: [PATCH 0070/5465] cdist-env: add support for tcsh Signed-off-by: Nico Schottelius --- bin/cdist-env | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/cdist-env b/bin/cdist-env index a7610aac..2256965b 100755 --- a/bin/cdist-env +++ b/bin/cdist-env @@ -27,7 +27,17 @@ __cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" __cdist_myname=${0##*/}; __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" -echo export PATH=$__cdist_abs_mydir:$PATH +shell_binary=${SHELL##*/} +NEWPATH="$__cdist_abs_mydir:$PATH" cd "$__cdist_abs_mydir/../doc/man" -echo export MANPATH=$(pwd -P):$MANPATH +NEWMANPATH="$(pwd -P):$MANPATH" + +# Match csh, tcsh to handle differently +if $(echo $shell_binary | grep -q 'csh$'); then + echo setenv PATH $NEWPATH + echo setenv MANPATH $NEWMANPATH +else + echo export PATH=$NEWPATH + echo export MANPATH=$NEWMANPATH +fi From 1cbdcc1f53c7648f7626d4e1131157330f7f042f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 09:15:22 +0100 Subject: [PATCH 0071/5465] + semicolon for csh Signed-off-by: Nico Schottelius --- bin/cdist-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-env b/bin/cdist-env index 2256965b..3b8e1645 100755 --- a/bin/cdist-env +++ b/bin/cdist-env @@ -35,7 +35,7 @@ NEWMANPATH="$(pwd -P):$MANPATH" # Match csh, tcsh to handle differently if $(echo $shell_binary | grep -q 'csh$'); then - echo setenv PATH $NEWPATH + echo setenv PATH $NEWPATH \; echo setenv MANPATH $NEWMANPATH else echo export PATH=$NEWPATH From 0d07b2056fc4b0b5034a145aaa3dabb6b00b0c7d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 09:38:59 +0100 Subject: [PATCH 0072/5465] describe how to use cdist-env in every shell Signed-off-by: Nico Schottelius --- doc/man/cdist-env.text | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/man/cdist-env.text b/doc/man/cdist-env.text index 4c2d73bc..fca115fb 100644 --- a/doc/man/cdist-env.text +++ b/doc/man/cdist-env.text @@ -16,9 +16,23 @@ cdist-env DESCRIPTION ----------- cdist-env outputs two strings suitable for usage in your current shell, -so you can use cdist from the checkout. You can evaluate those strings -and make directory usage of them. +so you can use cdist from the checkout. cdist-env essentially helps you +to easily setup PATH and MANPATH. +If you've multiple checkouts of cdist and run cdist-env from the various +checkouts, a new run will prepend the last directory, thus ensures you +can run it multiple times and does what one expects. + +EXAMPLES +-------- +For use in bourne shell variants (like dash, bash, ksh) as well as +in csh variants (csh, tcsh): + +-------------------------------------------------------------------------------- +eval `~/cdist/bin/cdist-env` +-------------------------------------------------------------------------------- + +Replace ~/cdist with the checkout directory of cdist. SEE ALSO From a5aec139277fc49112d30228c6a30d2ed2416e2d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 09:40:48 +0100 Subject: [PATCH 0073/5465] add cdist-env for MANSRC Signed-off-by: Nico Schottelius --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index a6d78aeb..5b6b6e94 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-bin-transfer.text \ + $(MANDIR)/cdist-env.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ $(MANDIR)/cdist-manifest.text \ From d084cf1422752db88bcc2f4e4a807335148fb0cb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 09:45:22 +0100 Subject: [PATCH 0074/5465] less todo, updates for changelog Signed-off-by: Nico Schottelius --- doc/changelog | 3 ++- doc/dev/todo/niconext | 3 +++ doc/dev/todo/post-1.0 | 22 +--------------------- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/doc/changelog b/doc/changelog index d83d3d44..696bae25 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,9 +1,10 @@ 1.1: * Replace type __file with __file, __directory, __link + * Document cdist-env 1.0.4: 2011-03-15 * New type __motd - * New type __addifnosuchline + * New type __addifnosuchline (Daniel Roth) * Document type __issue * Document type __package_pacman * Document type __package_apt diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index e69de29b..a1916dcd 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -0,0 +1,3 @@ +DOC: + - cdist-dir + - cdist-config diff --git a/doc/dev/todo/post-1.0 b/doc/dev/todo/post-1.0 index 49c6f8b0..0d32dd98 100644 --- a/doc/dev/todo/post-1.0 +++ b/doc/dev/todo/post-1.0 @@ -9,22 +9,9 @@ Types to be written/extended: - __service - __user - __file_edit - - delete_line_from_file + - __deleteline - regexp replace (can probably cover all?) - - __file: - - template == [shell script] stdout - cron - - __file: think about splitting - __file - source - mode - owner - __directory - parents - mode - owner - __link - type symbolic | hard - __issue: add --source @@ -41,16 +28,9 @@ Documentation: + cdist + cdist-deploy-to + cdist-manifest - - cdist-type [IMPORTANT] - - only do necessary work [TYPE IMPLEMENTATION HINTS] - - install packages only if not existent - - copy file only if different - - DOC document that $type/manifest is executed for every object/instance - ensure every file in bin/ has a correspondent manpage - cdist-code-run-all - - cdist-config - cdist-deploy-to - - cdist-dir - cdist-explorer-run-init - cdist-manifest-run - cdist-manifest-run-all From 6a29a7c1d8de4ef969e6b17a48a26a6fb3229f8c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 09:46:14 +0100 Subject: [PATCH 0075/5465] REAL_README -> README Signed-off-by: Nico Schottelius --- README | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++- REAL_README | 172 --------------------------------------------------- 2 files changed, 172 insertions(+), 173 deletions(-) mode change 120000 => 100644 README delete mode 100644 REAL_README diff --git a/README b/README deleted file mode 120000 index ace36209..00000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -REAL_README \ No newline at end of file diff --git a/README b/README new file mode 100644 index 00000000..88d5de13 --- /dev/null +++ b/README @@ -0,0 +1,172 @@ +[[!meta title="cdist - configuration management"]] + + + .. . .x+=:. s + dF @88> z` ^% :8 + '88bu. %8P . origin/ + + # Stay on version 1.0 + git checkout -b 1.0 origin/1.0 + +### Update + +To upgrade cdist in the current branch use + + git pull + + # Also update the manpages + make man + export MANPATH=$MANPATH:$(pwd -P)/doc/man + + +The version branches are designed to change if there are incompatibilities. +Or the other way round: As long as you stay on 1.0 and do git pull, nothing +should break. + +## Support + +### IRC + +You can join the development ***IRC channel*** +[#cLinux on irc.freenode.org](irc://irc.freenode.org/#cLinux). + +### Mailing list + +Bug reports, questions, patches, etc. should be send to the +[cdist mailing list](http://l.schottelius.org/mailman/listinfo/cdist). + +## Used by + +If you're using cdist, feel free to send a report to the mailing list. +Interesting information are for instance + + * Which services do you manage? + * How many machines do you manage? + * What are the pros/cons you see in cdist? + * General comments/critics + +### Nico Schottelius, Systems Group ETH Zurich + +Yes, I'm actually eating my own dogfood and currently managing + + * [plone](http://plone.org/) (cms) + * [moinmoin](http://moinmo.in/) (wiki) + * [apache](http://httpd.apache.org/) (webserver) + * [kerberos (mit)](http://web.mit.edu/kerberos/) (authentication) + * [ircd-hybrid](http://www.ircd-hybrid.org/) (chat) + * [stunnel](http://stunnel.mirt.net/) (SSL tunnel) + * [mercurial-server](http://www.lshift.net/mercurial-server.html) + +with cdist on a total of **4** production servers of the +[Systems Group](http://www.systems.ethz.ch) at the +[ETH Zurich](http://www.ethz.ch). diff --git a/REAL_README b/REAL_README deleted file mode 100644 index 88d5de13..00000000 --- a/REAL_README +++ /dev/null @@ -1,172 +0,0 @@ -[[!meta title="cdist - configuration management"]] - - - .. . .x+=:. s - dF @88> z` ^% :8 - '88bu. %8P . origin/ - - # Stay on version 1.0 - git checkout -b 1.0 origin/1.0 - -### Update - -To upgrade cdist in the current branch use - - git pull - - # Also update the manpages - make man - export MANPATH=$MANPATH:$(pwd -P)/doc/man - - -The version branches are designed to change if there are incompatibilities. -Or the other way round: As long as you stay on 1.0 and do git pull, nothing -should break. - -## Support - -### IRC - -You can join the development ***IRC channel*** -[#cLinux on irc.freenode.org](irc://irc.freenode.org/#cLinux). - -### Mailing list - -Bug reports, questions, patches, etc. should be send to the -[cdist mailing list](http://l.schottelius.org/mailman/listinfo/cdist). - -## Used by - -If you're using cdist, feel free to send a report to the mailing list. -Interesting information are for instance - - * Which services do you manage? - * How many machines do you manage? - * What are the pros/cons you see in cdist? - * General comments/critics - -### Nico Schottelius, Systems Group ETH Zurich - -Yes, I'm actually eating my own dogfood and currently managing - - * [plone](http://plone.org/) (cms) - * [moinmoin](http://moinmo.in/) (wiki) - * [apache](http://httpd.apache.org/) (webserver) - * [kerberos (mit)](http://web.mit.edu/kerberos/) (authentication) - * [ircd-hybrid](http://www.ircd-hybrid.org/) (chat) - * [stunnel](http://stunnel.mirt.net/) (SSL tunnel) - * [mercurial-server](http://www.lshift.net/mercurial-server.html) - -with cdist on a total of **4** production servers of the -[Systems Group](http://www.systems.ethz.ch) at the -[ETH Zurich](http://www.ethz.ch). From b6f231063eb1254b04ae3fda23e83f3c1adac0ec Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 09:48:59 +0100 Subject: [PATCH 0076/5465] 0600 is enough for cdist-config (according to posix) Signed-off-by: Nico Schottelius --- bin/cdist-config | 0 doc/man/{to_check => }/cdist-config.text | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 bin/cdist-config rename doc/man/{to_check => }/cdist-config.text (100%) diff --git a/bin/cdist-config b/bin/cdist-config old mode 100755 new mode 100644 diff --git a/doc/man/to_check/cdist-config.text b/doc/man/cdist-config.text similarity index 100% rename from doc/man/to_check/cdist-config.text rename to doc/man/cdist-config.text From a8ae699c8f095a70872d877419c63881e2d61547 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:02:46 +0100 Subject: [PATCH 0077/5465] [DOC] cleanup cdist-config Signed-off-by: Nico Schottelius --- Makefile | 4 ++-- doc/changelog | 1 + doc/man/cdist-config.text | 16 ++++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 5b6b6e94..b780a983 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,6 @@ WEBPAGE=software/cdist.mdwn MANDIR=doc/man # Unchecked MANSRC=$(MANDIR)/cdist-config-layout.text \ - $(MANDIR)/cdist-config.text \ $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-terms.text \ @@ -21,6 +20,7 @@ MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-bin-transfer.text \ + $(MANDIR)/cdist-config.text \ $(MANDIR)/cdist-env.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ @@ -40,7 +40,7 @@ all: @echo '' @echo 'Here are the possible targets:' @echo '' - @echo ' man: Build manpages' + @echo ' man: Build manpages (requires Asciidoc (a2x binary))' @echo ' clean: Remove build stuff' @echo '' @echo '' diff --git a/doc/changelog b/doc/changelog index 696bae25..a9738e06 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.1: * Replace type __file with __file, __directory, __link * Document cdist-env + * Document cdist-config 1.0.4: 2011-03-15 * New type __motd diff --git a/doc/man/cdist-config.text b/doc/man/cdist-config.text index 969be9cc..9d147988 100644 --- a/doc/man/cdist-config.text +++ b/doc/man/cdist-config.text @@ -10,18 +10,14 @@ cdist-config - Read basic cdist configuration DESCRIPTION ----------- -Cdist-config is sourced by all helper programs and provides -hints on where to find the library. Cdist-config needs to be -in the path. - -AUTHOR ------- -Nico Schottelius +Cdist-config is sourced by cdist programs and provides hints on where to find +types, manifests, etc. Generally speaking, it's just usable from within the +core and is only of interest for cdist-developers. -RESOURCES ---------- -Main web site: http://www.nico.schottelius.org/cdist/[] +SEE ALSO +-------- +cdist(7) COPYING From 3cf23460721f2f611f9055790184001bff636871 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:07:30 +0100 Subject: [PATCH 0078/5465] [DOC] add manpage for cdist-dir Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-dir.text | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 doc/man/cdist-dir.text diff --git a/Makefile b/Makefile index b780a983..3bb33226 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-bin-transfer.text \ $(MANDIR)/cdist-config.text \ + $(MANDIR)/cdist-dir.text \ $(MANDIR)/cdist-env.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ diff --git a/doc/man/cdist-dir.text b/doc/man/cdist-dir.text new file mode 100644 index 00000000..0f4a2e68 --- /dev/null +++ b/doc/man/cdist-dir.text @@ -0,0 +1,36 @@ +cdist-dir(1) +============ +Nico Schottelius + + +NAME +---- +cdist-dir - Poor man's directory synchronisation + + +SYNOPSIS +-------- +cdist-dir TARGET_HOST SRC_DIR DST_DIR + + +DESCRIPTION +----------- +cdist-dir either pushes a local directory to the target host +or pulls a remote directory from a target host to the local host. + +In the push case SRC_DIR is local, in the pull case remote. +In the push case DST_DIR is remote, in the pull case local. + +cdist-dir does not cleanup DST_DIR and thus it may contain old +stuff if used multiple times. + + +SEE ALSO +-------- +cdist(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 24eb626ca85e940c07936070a1ef7b098d080ae9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:11:00 +0100 Subject: [PATCH 0079/5465] clearify dumb behaviour of cdist-dir Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 4 +--- doc/man/cdist-dir.text | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index a1916dcd..7ce8da49 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1 @@ -DOC: - - cdist-dir - - cdist-config +Release 1.1.0 diff --git a/doc/man/cdist-dir.text b/doc/man/cdist-dir.text index 0f4a2e68..223bc779 100644 --- a/doc/man/cdist-dir.text +++ b/doc/man/cdist-dir.text @@ -24,6 +24,8 @@ In the push case DST_DIR is remote, in the pull case local. cdist-dir does not cleanup DST_DIR and thus it may contain old stuff if used multiple times. +cdist-dir does not rely on rsync or other high level tools, because +it cannot expect its existence on the local or target host. SEE ALSO -------- From 2389dde9f565988550c89228ee626ecf8889f6ef Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:18:03 +0100 Subject: [PATCH 0080/5465] [DOC] add manpage for cdist-quickstart Signed-off-by: Nico Schottelius --- Makefile | 3 +- doc/changelog | 2 + doc/dev/todo/post-1.0 | 1 - doc/man/cdist-quickstart.text | 51 ++++++++++++++++++++++++++ doc/man/to_check/cdist-quickstart.text | 42 --------------------- 5 files changed, 54 insertions(+), 45 deletions(-) create mode 100644 doc/man/cdist-quickstart.text delete mode 100644 doc/man/to_check/cdist-quickstart.text diff --git a/Makefile b/Makefile index 3bb33226..660abb09 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,7 @@ WEBPAGE=software/cdist.mdwn MANDIR=doc/man # Unchecked MANSRC=$(MANDIR)/cdist-config-layout.text \ - $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ - $(MANDIR)/cdist-terms.text \ # Clean documentation MANGENERATED=$(MANDIR)/cdist-reference.text @@ -26,6 +24,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ $(MANDIR)/cdist-manifest.text \ + $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ $(MANDIR)/cdist-type-template.text \ diff --git a/doc/changelog b/doc/changelog index a9738e06..1558d59f 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,8 @@ * Replace type __file with __file, __directory, __link * Document cdist-env * Document cdist-config + * Document cdist-dir + * Document cdist-quickstart 1.0.4: 2011-03-15 * New type __motd diff --git a/doc/dev/todo/post-1.0 b/doc/dev/todo/post-1.0 index 0d32dd98..d351a0f7 100644 --- a/doc/dev/todo/post-1.0 +++ b/doc/dev/todo/post-1.0 @@ -38,7 +38,6 @@ Documentation: - cdist-object-codegen - cdist-object-codegen-all - cdist-object-explorer-all - - cdist-quickstart - cdist-remote-code-run-all - cdist-remote-explorer-run - cdist-run-remote diff --git a/doc/man/cdist-quickstart.text b/doc/man/cdist-quickstart.text new file mode 100644 index 00000000..ddcbbccc --- /dev/null +++ b/doc/man/cdist-quickstart.text @@ -0,0 +1,51 @@ +cdist-quickstart(1) +=================== +Nico Schottelius + +NAME +---- +cdist-quickstart - Make use of cinit in 5 minutes + + +SYNOPSIS +-------- +cdist-quickstart + + +DESCRIPTION +----------- +cdist-quickstart is an interactive guide to cdist. It should be one +of the first tools you use when you begin with cdist. + + +EXAMPLES +-------- + +To use cdist-quickstart, add the bin directory to your PATH, +execute cdist-quickstart and enjoy cdist: + + +-------------------------------------------------------------------------------- +# Bourne shell example +export PATH=$(pwd -P)/bin:$PATH + +# Alternatively, usable for csh and bsh, set's up PATH and MANPATH +eval `./bin/cdist-env` + +# Let's go! +cdist-quickstart +-------------------------------------------------------------------------------- + + + +SEE ALSO +-------- +- cdist(7) +- cdist-env(1) + + +COPYING +------- +Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). +## How to use cdist? diff --git a/doc/man/to_check/cdist-quickstart.text b/doc/man/to_check/cdist-quickstart.text deleted file mode 100644 index 570aa310..00000000 --- a/doc/man/to_check/cdist-quickstart.text +++ /dev/null @@ -1,42 +0,0 @@ -cdist-quickstart(1) -=================== -Nico Schottelius - -NAME ----- -cdist-quickstart - Make use of cinit in 5 minutes - - -DESCRIPTION ------------ -This document helps you to take the first steps with cdist. -We'll begin to configure the host "localhost" to have two files -in place, /etc/DO-NOT-CHANGE and /root/CDIST-ENABLED-HOST, which -both are used to warn other sysadmins that this system is managed -by configuration management and manual changes may get overwritten. - -Begin to execute cdist-quickstart, it will show you the steps it -takes and explains what it does: - -% cdist-quickstart - -mkdir -p /etc/cdist/manifests - -# Create - -Cdist uses -kgives you an impression of - 0. Create a host specification (/etc/cdist/hosts/**hostname**) - 0. Add functionalilty to add - 0. Run ***cdist-apply*** - -SEE ALSO --------- -cdist-config-layout(7) - - -COPYING -------- -Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). -## How to use cdist? From e7eecb06d9d926218de1a246124405cf775d6551 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:19:38 +0100 Subject: [PATCH 0081/5465] cdist-config needs to be executable, otherwise which does not find it Signed-off-by: Nico Schottelius --- bin/cdist-config | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bin/cdist-config diff --git a/bin/cdist-config b/bin/cdist-config old mode 100644 new mode 100755 From f82527283ec00de18cf4d79cee10c329d4e2a925 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:20:38 +0100 Subject: [PATCH 0082/5465] remove obsolete documentation Signed-off-by: Nico Schottelius --- doc/man/to_check/cdist-terms.text | 26 ----------------------- doc/man/to_check/cdist-type-manifest.text | 24 --------------------- 2 files changed, 50 deletions(-) delete mode 100644 doc/man/to_check/cdist-terms.text delete mode 100644 doc/man/to_check/cdist-type-manifest.text diff --git a/doc/man/to_check/cdist-terms.text b/doc/man/to_check/cdist-terms.text deleted file mode 100644 index 530c4762..00000000 --- a/doc/man/to_check/cdist-terms.text +++ /dev/null @@ -1,26 +0,0 @@ -cdist-terms(7) -============== -Nico Schottelius - - -NAME ----- -cdist-terms - Describe terms used in cdist - - -DESCRIPTION ------------ -provider: Provides functionality. -object: Instance with provider unique id of a provider. -manifest: Define which objects to create [on hosts] -server: The machine that configures all targets. -target: Host that should be configured. - -SEE ALSO --------- - - -COPYING -------- -Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/doc/man/to_check/cdist-type-manifest.text b/doc/man/to_check/cdist-type-manifest.text deleted file mode 100644 index 7573df6b..00000000 --- a/doc/man/to_check/cdist-type-manifest.text +++ /dev/null @@ -1,24 +0,0 @@ -cdist-type-manifest(7) -====================== -Nico Schottelius - - -NAME ----- -cdist-type-manifest - Manifest of a type - - -DESCRIPTION ------------ -CWD = object directory -ARGV = target host, basedir -ENV = - -SEE ALSO --------- - - -COPYING -------- -Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). From 953837c7335e311e7b78d5082bcf40b1a6f7013c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:21:10 +0100 Subject: [PATCH 0083/5465] cleanup makefile Signed-off-by: Nico Schottelius --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 660abb09..11b9c59a 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,8 @@ A2X=a2x -f manpage --no-xmllint WEBDIR=$$HOME/niconetz WEBPAGE=software/cdist.mdwn +# Documentation MANDIR=doc/man -# Unchecked -MANSRC=$(MANDIR)/cdist-config-layout.text \ - $(MANDIR)/cdist-stages.text \ - -# Clean documentation MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ From 44c8adccbe1e2cb8d529e3d7749f4a2e82dcd4c8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:25:53 +0100 Subject: [PATCH 0084/5465] cdist-env: document ./ as default Signed-off-by: Nico Schottelius --- doc/man/cdist-env.text | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/man/cdist-env.text b/doc/man/cdist-env.text index fca115fb..8d10aa85 100644 --- a/doc/man/cdist-env.text +++ b/doc/man/cdist-env.text @@ -29,10 +29,10 @@ For use in bourne shell variants (like dash, bash, ksh) as well as in csh variants (csh, tcsh): -------------------------------------------------------------------------------- -eval `~/cdist/bin/cdist-env` +eval `./bin/cdist-env` -------------------------------------------------------------------------------- -Replace ~/cdist with the checkout directory of cdist. +Replace "./" with the checkout directory of cdist. SEE ALSO From aee6953ecd5049b2a337bb03e5ed0e41794fb21a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:28:00 +0100 Subject: [PATCH 0085/5465] [BUGFIX] __link: remove trailing 's' in variable name Signed-off-by: Nico Schottelius --- conf/type/__link/gencode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__link/gencode b/conf/type/__link/gencode index 4a97ac34..2e13755c 100755 --- a/conf/type/__link/gencode +++ b/conf/type/__link/gencode @@ -40,4 +40,4 @@ case "$type" in ;; esac -echo ln ${lnopts} -f \"$source\" \"$destination\" +echo ln ${lnopt} -f \"$source\" \"$destination\" From 84b15fac454f5bd9c999aacd154b403fd5808424 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:31:22 +0100 Subject: [PATCH 0086/5465] todo post 1.1 Signed-off-by: Nico Schottelius --- doc/dev/todo/{post-1.0-cache => cache} | 0 doc/dev/todo/{post-1.0 => post-1.1} | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) rename doc/dev/todo/{post-1.0-cache => cache} (100%) rename doc/dev/todo/{post-1.0 => post-1.1} (97%) diff --git a/doc/dev/todo/post-1.0-cache b/doc/dev/todo/cache similarity index 100% rename from doc/dev/todo/post-1.0-cache rename to doc/dev/todo/cache diff --git a/doc/dev/todo/post-1.0 b/doc/dev/todo/post-1.1 similarity index 97% rename from doc/dev/todo/post-1.0 rename to doc/dev/todo/post-1.1 index d351a0f7..2efa1ab7 100644 --- a/doc/dev/todo/post-1.0 +++ b/doc/dev/todo/post-1.1 @@ -1,3 +1,6 @@ +Core: + - write test case: test.sh + Dependencies: - Add meta parameters like --requires --excludes --depends? - Build dependency tree @@ -30,7 +33,6 @@ Documentation: + cdist-manifest - ensure every file in bin/ has a correspondent manpage - cdist-code-run-all - - cdist-deploy-to - cdist-explorer-run-init - cdist-manifest-run - cdist-manifest-run-all From 4fdef270bac4368839dc92d32d87f9b2a6713361 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:44:43 +0100 Subject: [PATCH 0087/5465] describe how to upgrade to 1.1 Signed-off-by: Nico Schottelius --- README | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/README b/README index 88d5de13..9c645e97 100644 --- a/README +++ b/README @@ -40,7 +40,6 @@ it ticks differently: ### Architecture * Push mode (server pushes configuration) - * Pull mode planned (client triggers configuration) * User defines configuration in shell scripts (called ***manifests***) * Generates internal configuration (cconfig style) * Uses ***types*** to generate code be executed on the target @@ -58,15 +57,10 @@ but is not. Or: The reason why I began to write cdist. * Meaningful error messages * No surprise factor * Consistency in behaviour, naming and documentation - * Easy integration nacked installations + * Easy integration into bare metal installations * Simple and well-known DSL: posix shell - * It is very easy to - * extend cdist - * debug cdist-core and cdist-types - * Focus on reuse of existing functionality - * ssh - * sh - * find, rm, ... + * It must be very easy to extend and debug cdist + * Focus on reuse of existing functionality (like sh, ssh, find, rm, ...) ## Requirements @@ -104,21 +98,22 @@ how to use cdist. ### Available versions -There are at least two branches available: +There are at least the following branches available: * master: the development branch - * 1.0: stable branch of version 1.0 + * 1.0: First official release + * 1.1: Current stable (includes __file type change) -Other branches may be available as well for features or bugfixes, but they +Other branches may be available for features or bugfixes, but they may vanish at any point. To select a specific branch use # Generic code git checkout -b origin/ - # Stay on version 1.0 - git checkout -b 1.0 origin/1.0 + # Stay on version 1.1 + git checkout -b 1.1 origin/1.1 -### Update +## Update To upgrade cdist in the current branch use @@ -128,10 +123,20 @@ To upgrade cdist in the current branch use make man export MANPATH=$MANPATH:$(pwd -P)/doc/man +If you stay on a version branche (i.e. 1.0, 1.1., ...), nothing should break. +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. + +### Upgrading 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 -The version branches are designed to change if there are incompatibilities. -Or the other way round: As long as you stay on 1.0 and do git pull, nothing -should break. ## Support From 5e58bfbd28ce0e587f5f4694a588409c0c22377a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:45:13 +0100 Subject: [PATCH 0088/5465] fix web target Signed-off-by: Nico Schottelius --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 11b9c59a..093859a5 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,7 @@ test: .rsync nicosc@ru3.inf.ethz.ch:cdist web: - cp REAL_README $(WEBDIR)/$(WEBPAGE) + cp README $(WEBDIR)/$(WEBPAGE) cd $(WEBDIR) && git commit -m "cdist update" $(WEBPAGE) cd $(WEBDIR) && make pub From 18d0f85fbf4bfb71322d808d34a04d2e9f6a175d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:48:43 +0100 Subject: [PATCH 0089/5465] fight against markdown with \ Signed-off-by: Nico Schottelius --- README | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README b/README index 9c645e97..552aecf1 100644 --- a/README +++ b/README @@ -102,7 +102,7 @@ There are at least the following branches available: * master: the development branch * 1.0: First official release - * 1.1: Current stable (includes __file type change) + * 1.1: Current stable (includes \_\_file type change) Other branches may be available for features or bugfixes, but they may vanish at any point. To select a specific branch use @@ -129,13 +129,13 @@ working, break your setup or eat the tree in your garden. ### Upgrading 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: +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 + * Remove --type from all \_\_file calls + * If type was symlink, use \_\_link and --type symbolic + * If type was directory, use \_\_directory ## Support From 2e97515f0b63ec8f6b4369a0bd883d0bbdf0fbb7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:52:36 +0100 Subject: [PATCH 0090/5465] cleanup README, more stuff done by cdist Signed-off-by: Nico Schottelius --- README | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README b/README index 552aecf1..a897cb55 100644 --- a/README +++ b/README @@ -48,19 +48,22 @@ it ticks differently: ### Features Stuff that should probably be included in every configuration management, -but is not. Or: The reason why I began to write cdist. +but is not. Or: Why I began to write cdist: * Speed * Elegant code * Clean design * Good documentation (man pages) * Meaningful error messages - * No surprise factor + * The no surprise factor * Consistency in behaviour, naming and documentation * Easy integration into bare metal installations * Simple and well-known DSL: posix shell * It must be very easy to extend and debug cdist * Focus on reuse of existing functionality (like sh, ssh, find, rm, ...) + * Easy upgrade: ***There is no need to update cdist on target hosts!*** + * cdist only needs to be update on the master server + ## Requirements @@ -171,7 +174,9 @@ Yes, I'm actually eating my own dogfood and currently managing * [ircd-hybrid](http://www.ircd-hybrid.org/) (chat) * [stunnel](http://stunnel.mirt.net/) (SSL tunnel) * [mercurial-server](http://www.lshift.net/mercurial-server.html) + * [xfce](http://www.xfce.org/) + * [slim](http://slim.berlios.de/) -with cdist on a total of **4** production servers of the +with cdist on a total of **5** production machines of the [Systems Group](http://www.systems.ethz.ch) at the [ETH Zurich](http://www.ethz.ch). From 37255960d61afa60f7bd7392ce4116ebb271d95f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 10:57:16 +0100 Subject: [PATCH 0091/5465] +urls Signed-off-by: Nico Schottelius --- README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index a897cb55..1c0d4111 100644 --- a/README +++ b/README @@ -173,9 +173,9 @@ Yes, I'm actually eating my own dogfood and currently managing * [kerberos (mit)](http://web.mit.edu/kerberos/) (authentication) * [ircd-hybrid](http://www.ircd-hybrid.org/) (chat) * [stunnel](http://stunnel.mirt.net/) (SSL tunnel) - * [mercurial-server](http://www.lshift.net/mercurial-server.html) - * [xfce](http://www.xfce.org/) - * [slim](http://slim.berlios.de/) + * [mercurial-server](http://www.lshift.net/mercurial-server.html) (version control) + * [xfce](http://www.xfce.org/) (lightweight desktop environment) + * [slim](http://slim.berlios.de/) (graphical login manager for X11) with cdist on a total of **5** production machines of the [Systems Group](http://www.systems.ethz.ch) at the From 0f3297bfa21c2bfb484570ef47d16e5c278ef369 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:08:12 +0100 Subject: [PATCH 0092/5465] list know working operating systems Signed-off-by: Nico Schottelius --- README | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README b/README index 1c0d4111..c4a580a4 100644 --- a/README +++ b/README @@ -64,6 +64,16 @@ but is not. Or: Why I began to write cdist: * Easy upgrade: ***There is no need to update cdist on target hosts!*** * cdist only needs to be update on the master server +### OS support + +cdist was tested or is know to run on at least + + * [Archlinux](http://www.archlinux.org/) + * [Debian](http://www.debian.org/) + * [Gentoo](http://www.gentoo.org/) + * [Mac OS X](http://www.apple.com/macosx/) + * [Ubuntu](http://www.ubuntu.com/) + ## Requirements From c733c9f9a4835acc9b7e181855b29ce51c6a118d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:10:37 +0100 Subject: [PATCH 0093/5465] Change to 1.1.0 Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 61b7117f..3e418c77 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.0.4" +__cdist_version="1.1.0" # Fail if something bogus is going on set -u From b11941bdaf56a3c1c1ddd46e673bd76a31fef064 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:12:08 +0100 Subject: [PATCH 0094/5465] update changelog Signed-off-by: Nico Schottelius --- doc/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index 1558d59f..52a872d1 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.1: +1.1.0: 2011-03-16 * Replace type __file with __file, __directory, __link * Document cdist-env * Document cdist-config From f94b39c22bd7262bcd9c3fcc1511c780e4168b01 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:16:45 +0100 Subject: [PATCH 0095/5465] fix __file usage in __issue and add redhat support Signed-off-by: Nico Schottelius --- conf/type/__issue/files/redhat | 3 +++ conf/type/__issue/manifest | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 conf/type/__issue/files/redhat diff --git a/conf/type/__issue/files/redhat b/conf/type/__issue/files/redhat new file mode 100644 index 00000000..d93372b0 --- /dev/null +++ b/conf/type/__issue/files/redhat @@ -0,0 +1,3 @@ +Red Hat Enterprise Linux Server (cdist-automated) +Kernel \r on an \m + diff --git a/conf/type/__issue/manifest b/conf/type/__issue/manifest index aa6f7629..1fab9a07 100755 --- a/conf/type/__issue/manifest +++ b/conf/type/__issue/manifest @@ -23,12 +23,12 @@ destination=/etc/issue source="$(cat "out/explorer/os")" case "$os" in - archlinux) - source="$__type/files/archlinux" + archlinux|redhat) + source="$__type/files/$os" ;; *) source="$__type/files/default" ;; esac -__file "$destination" --source "$source" --type file +__file "$destination" --source "$source" From 1bc37f5ba2f00c6440fd539d03ca16afb50d67c3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:20:07 +0100 Subject: [PATCH 0096/5465] setup mode 0644 for motd Signed-off-by: Nico Schottelius --- conf/type/__motd/manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__motd/manifest b/conf/type/__motd/manifest index a6e963f1..4716f530 100755 --- a/conf/type/__motd/manifest +++ b/conf/type/__motd/manifest @@ -38,4 +38,4 @@ case "$os" in ;; esac -__file "$destination" --source "$source" --type file +__file "$destination" --source "$source" --mode 0644 From e0520edb10695c7aace70ab28f385022ae603cfd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:20:18 +0100 Subject: [PATCH 0097/5465] document redhat support Signed-off-by: Nico Schottelius --- README | 1 + conf/manifest/init | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README b/README index c4a580a4..c1df4618 100644 --- a/README +++ b/README @@ -72,6 +72,7 @@ cdist was tested or is know to run on at least * [Debian](http://www.debian.org/) * [Gentoo](http://www.gentoo.org/) * [Mac OS X](http://www.apple.com/macosx/) + * [Redhat](http://www.redhat.com/) * [Ubuntu](http://www.ubuntu.com/) diff --git a/conf/manifest/init b/conf/manifest/init index 0241423b..85a9a359 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -37,11 +37,17 @@ case "$__target_host" in # Same stuff for gentoo __package tree --state installed ;; + cdist-debian) __package_apt atop --state installed __package apache2 --state deinstalled ;; + cdist-redhat) + __issue + __motd + ;; + # Real machines may be used with their hostname or fqdn, # depending on how you call cdist-deploy-to # machine) From b8a0fce4fa63a37c8cd0c39ec0f1bb21c06acb2c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:33:01 +0100 Subject: [PATCH 0098/5465] remove grep -q, not supported on solaris, from cdist-env Signed-off-by: Nico Schottelius --- bin/cdist-env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-env b/bin/cdist-env index 3b8e1645..3a477e85 100755 --- a/bin/cdist-env +++ b/bin/cdist-env @@ -34,7 +34,7 @@ cd "$__cdist_abs_mydir/../doc/man" NEWMANPATH="$(pwd -P):$MANPATH" # Match csh, tcsh to handle differently -if $(echo $shell_binary | grep -q 'csh$'); then +if [ "$(echo $shell_binary | grep 'csh$')" ]; then echo setenv PATH $NEWPATH \; echo setenv MANPATH $NEWMANPATH else From 44a41b3893119222271958ce7124e677cfaabe99 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:36:45 +0100 Subject: [PATCH 0099/5465] take care of solaris in next version Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.1 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/dev/todo/post-1.1 b/doc/dev/todo/post-1.1 index 2efa1ab7..8556f253 100644 --- a/doc/dev/todo/post-1.1 +++ b/doc/dev/todo/post-1.1 @@ -1,5 +1,6 @@ Core: - write test case: test.sh + - probably remove grep -q (solaris does not have it) Dependencies: - Add meta parameters like --requires --excludes --depends? From 39739835fa7ce194a07a70286e723dcb1109a3b9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:38:05 +0100 Subject: [PATCH 0100/5465] add git mirrors Signed-off-by: Nico Schottelius --- Makefile | 1 + README | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 093859a5..3842e47f 100644 --- a/Makefile +++ b/Makefile @@ -92,3 +92,4 @@ web: pub: git push --mirror + git push --mirror github diff --git a/README b/README index c1df4618..c43e0653 100644 --- a/README +++ b/README @@ -127,6 +127,11 @@ may vanish at any point. To select a specific branch use # Stay on version 1.1 git checkout -b 1.1 origin/1.1 +### Mirrors + + * git://github.com/telmich/cdist.git (Nicos Schottelius' backup) + * git://git.sans.ethz.ch/cdist (Steven Armstrongs main repo) + ## Update To upgrade cdist in the current branch use From 057ee7911e17c161de05dc4c9421ecc920127858 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 11:55:17 +0100 Subject: [PATCH 0101/5465] update mirror description Signed-off-by: Nico Schottelius --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index c43e0653..dbf3d89a 100644 --- a/README +++ b/README @@ -129,8 +129,8 @@ may vanish at any point. To select a specific branch use ### Mirrors - * git://github.com/telmich/cdist.git (Nicos Schottelius' backup) - * git://git.sans.ethz.ch/cdist (Steven Armstrongs main repo) + * git://github.com/telmich/cdist.git ([github](https://github.com/telmich/cdist)) + * git://git.sans.ethz.ch/cdist ([sans](http://git.sans.ethz.ch/?p=cdist;a=summary)) ## Update From 86b8428edd307f9f6ead2b24d7d259e315d94bfc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 12:57:13 +0100 Subject: [PATCH 0102/5465] remove hardcoded paths in cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index a4f66e5b..f8e1d2c2 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -41,8 +41,8 @@ echo "$__cdist_object_id" | grep -q "^${__cdist_sane_regexp}\$" || \ __cdist_usage "Insane object id, ${__cdist_object_id}." __cdist_object="${__cdist_type}/${__cdist_object_id}" -__cdist_ddir="$__cdist_output_dir/${__cdist_object}" -__cdist_parameter_dir="$__cdist_ddir/$__cdist_name_parameter" +__cdist_ddir="$(__cdist_object_dir "$__cdist_object")" +__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" # Append id for error messages __cdist_myname="$__cdist_myname ($__cdist_object_id)" From 1ea57bd9c6fb315e7f2d2f441378ff11524d87d4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 13:03:29 +0100 Subject: [PATCH 0103/5465] cleanup readme Signed-off-by: Nico Schottelius --- README | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README b/README index dbf3d89a..e229614d 100644 --- a/README +++ b/README @@ -115,8 +115,11 @@ how to use cdist. There are at least the following branches available: * master: the development branch + * 1.1: Current stable + +Old versions: + * 1.0: First official release - * 1.1: Current stable (includes \_\_file type change) Other branches may be available for features or bugfixes, but they may vanish at any point. To select a specific branch use From 93eef6900a0a95d5ff3746c0f7ffa374fbc7eaf0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 15:49:28 +0100 Subject: [PATCH 0104/5465] + require in cdist-config Signed-off-by: Nico Schottelius --- bin/cdist-config | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/cdist-config b/bin/cdist-config index 3e418c77..0b6d84fa 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -57,6 +57,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_parameter:=parameter} : ${__cdist_name_parameter_required:=required} : ${__cdist_name_parameter_optional:=optional} +: ${__cdist_name_require:=require} : ${__cdist_name_singleton:=singleton} : ${__cdist_name_target_host:=target_host} : ${__cdist_name_type:=type} @@ -248,6 +249,11 @@ __cdist_remote_object_parameter_dir() echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}" } +__cdist_object_require() +{ + echo "$(__cdist_object_dir "$1")/${__cdist_name_require}" +} + __cdist_object_type_explorer_dir() { echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" From a501863f414442a7523053385c5f74f2be11adea Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 15:49:44 +0100 Subject: [PATCH 0105/5465] begin to record requirements Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index f8e1d2c2..07fdcc75 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -104,3 +104,8 @@ other="$(ls)" if [ "$other" ]; then __cdist_usage "Unsupported parameter: $other" fi + +# Record requirements +for requirement in $require; do + echo $requirement >> "$(__cdist_object_require "$__cdist_object")" +done From 91c70b2cc5dc1415a92a92c6ec0a771cfe828b9b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 16 Mar 2011 15:50:04 +0100 Subject: [PATCH 0106/5465] nicosc todos Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 7ce8da49..edb449de 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1 +1,3 @@ -Release 1.1.0 +Dependencies: + Record in bin/cdist-type-emulator + Fix __cdist_object_base_dir issue (vs. $__cdist_out_object_dir in deploy-to) From 5c39063a89b6bacfe6aa768cac72d1be1fca506c Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 17 Mar 2011 18:55:17 +0100 Subject: [PATCH 0107/5465] Added type __removeline --- conf/type/__removeline/gencode | 31 ++++++++++++++ conf/type/__removeline/man.text | 50 +++++++++++++++++++++++ conf/type/__removeline/parameter/optional | 1 + conf/type/__removeline/parameter/required | 1 + doc/dev/todo/daninext | 2 - doc/dev/todo/post-1.1 | 1 - 6 files changed, 83 insertions(+), 3 deletions(-) create mode 100755 conf/type/__removeline/gencode create mode 100644 conf/type/__removeline/man.text create mode 100644 conf/type/__removeline/parameter/optional create mode 100644 conf/type/__removeline/parameter/required diff --git a/conf/type/__removeline/gencode b/conf/type/__removeline/gencode new file mode 100755 index 00000000..3ec466b9 --- /dev/null +++ b/conf/type/__removeline/gencode @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 2010-2011 Daniel Roth (dani-cdist@d-roth.li) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# + +if [ -f "$__object/parameter/file" ]; then + file=$(cat "$__object/parameter/file") +else + file="/$__object_id" +fi + +line=$(cat "$__object/parameter/line") +echo "ex -c \"/${line}/d|w|q\" \"${file}\" < + + +NAME +---- +cdist-type__removeline - Remove a line (if existing) + + +DESCRIPTION +----------- +This type can be used to check a file for existence of a +specific line and removeing it, if it was not found. + + +REQUIRED PARAMETERS +------------------- +line:: + Specifies the content which shall be removed if existing. + + +OPTIONAL PARAMETERS +------------------- +file:: + If supplied, use this as the destination file. + Otherwise the object_id is used. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Removes the line specifiend in "include_www" from the file "lighttpd.conf" +__removeline www --file /etc/lighttpd.conf --line include_www + +# Removes the line "include_git" from the file "lighttpd.conf" +__removeline /etc/lighttpd.conf --line include_git +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Daniel Roth. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__removeline/parameter/optional b/conf/type/__removeline/parameter/optional new file mode 100644 index 00000000..f73f3093 --- /dev/null +++ b/conf/type/__removeline/parameter/optional @@ -0,0 +1 @@ +file diff --git a/conf/type/__removeline/parameter/required b/conf/type/__removeline/parameter/required new file mode 100644 index 00000000..a999a0c2 --- /dev/null +++ b/conf/type/__removeline/parameter/required @@ -0,0 +1 @@ +line diff --git a/doc/dev/todo/daninext b/doc/dev/todo/daninext index 19ebc573..e69de29b 100644 --- a/doc/dev/todo/daninext +++ b/doc/dev/todo/daninext @@ -1,2 +0,0 @@ -file-edit - - add_line_to_file_if_not_existing diff --git a/doc/dev/todo/post-1.1 b/doc/dev/todo/post-1.1 index 8556f253..a4f525e3 100644 --- a/doc/dev/todo/post-1.1 +++ b/doc/dev/todo/post-1.1 @@ -13,7 +13,6 @@ Types to be written/extended: - __service - __user - __file_edit - - __deleteline - regexp replace (can probably cover all?) - cron - __issue: add --source From 74d3a239305fbd6852335c312b819a807ae87c80 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 17 Mar 2011 19:06:33 +0100 Subject: [PATCH 0108/5465] Removed a not --- conf/type/__removeline/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__removeline/man.text b/conf/type/__removeline/man.text index c945bfd6..5cf7791f 100644 --- a/conf/type/__removeline/man.text +++ b/conf/type/__removeline/man.text @@ -11,7 +11,7 @@ cdist-type__removeline - Remove a line (if existing) DESCRIPTION ----------- This type can be used to check a file for existence of a -specific line and removeing it, if it was not found. +specific line and removeing it, if it was found. REQUIRED PARAMETERS From 6e5710d4fde1ca099cffb83d36c4e6b2cef9fcee Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 19:09:33 +0100 Subject: [PATCH 0109/5465] stuff for 1.1.1 Signed-off-by: Nico Schottelius --- doc/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog b/doc/changelog index fae5607a..d69731ca 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.1.1: + * New type __removeline + 1.1.0: 2011-03-16 * Replace type __file with __file, __directory, __link * Document cdist-env From 6c3631418ee201f7c54f410ece6e0a52b519de31 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 20:19:26 +0100 Subject: [PATCH 0110/5465] notes on current status Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index edb449de..f3c75add 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,24 @@ Dependencies: Record in bin/cdist-type-emulator Fix __cdist_object_base_dir issue (vs. $__cdist_out_object_dir in deploy-to) + | + | +|-----| +| +| +| New problem: + +Parts of the core use argv (see bin/cdist-deploy-to), +assign this either an own name or a "standard" name. + +cdist-config has a function that uses this "standard" var: + /home/users/nico/oeffentlich/rechner/projekte/cdist/bin/cdist-config: Zeile 229: __cdist_object_base_dir ist nicht gesetzt. + +In essence: + + - either argv lists get much longer (supplying all relevant arguments) + - OR cdist-core commands depend on the given environment: + - makes debugging more look like + var1="" var2="" var3="" ... cdist-$tool_to_debug + vs. currently + var1="" cdist-$tool_to_debug opt1 opt2 From 5b82a0fcda81cfcf0a05162d51298768c02532fd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 20:30:19 +0100 Subject: [PATCH 0111/5465] decide to remove argv Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index f3c75add..d0a232cd 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -22,3 +22,10 @@ In essence: var1="" var2="" var3="" ... cdist-$tool_to_debug vs. currently var1="" cdist-$tool_to_debug opt1 opt2 + +-------------------------------------------------------------------------------- +It seems that being able to pass the target host as argv makes sense, +but everything else can be used from cdist-config -> do not pass. + +Changing those variables is only needed if debugging the core and for +this purpose setting variables is fine. From 96c9ecf6fe5111e68eedf8ac4a1526bf443fa351 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 20:33:26 +0100 Subject: [PATCH 0112/5465] strip one parameter from cdist-bin-transfer Signed-off-by: Nico Schottelius --- bin/cdist-bin-transfer | 9 ++++----- bin/cdist-deploy-to | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/cdist-bin-transfer b/bin/cdist-bin-transfer index 7b98de28..e9a0a320 100755 --- a/bin/cdist-bin-transfer +++ b/bin/cdist-bin-transfer @@ -22,11 +22,10 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -eu __cdist_target_host="$1"; shift -__cdist_my_remote_out_dir="$1"; shift # Find directory that contains cdist binaries __cdist_conf_dir_path=$(which cdist-config) @@ -37,15 +36,15 @@ echo "Transferring cdist binaries ..." # re-create basedir so it's clean ssh "${__cdist_remote_user}@${__cdist_target_host}" \ - "rm -rf \"${__cdist_my_remote_out_dir}\" && mkdir -p \"${__cdist_my_remote_out_dir}\"" + "rm -rf \"${__cdist_remote_bin_dir}\" && mkdir -p \"${__cdist_remote_bin_dir}\"" # Transfer cdist-* to the remote host scp -qr "${__cdist_src_base}"* \ - "${__cdist_remote_user}@${__cdist_target_host}:${__cdist_my_remote_out_dir}" + "${__cdist_remote_user}@${__cdist_target_host}:${__cdist_remote_bin_dir}" # Adjust cdist-config to contain static version string tmp_version="$__cdist_version" sed "s/^: \${\(__cdist_version\):=.*/\1=\"$tmp_version\"/" "$(which cdist-config)" | \ ssh -q "${__cdist_remote_user}@${__cdist_target_host}" \ - "cat > \"${__cdist_my_remote_out_dir}\"/cdist-config" + "cat > \"${__cdist_remote_bin_dir}\"/cdist-config" diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index d006dd2d..0693a051 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -43,7 +43,7 @@ echo "cdist $__cdist_version: Configuring $__cdist_target_host" __cdist_init_deploy "$__cdist_target_host" # Transfer cdist "binaries" -cdist-bin-transfer "$__cdist_target_host" "$__cdist_remote_bin_dir" +cdist-bin-transfer "$__cdist_target_host" # Execute general explorers cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir" From e0791f24e22337cd61158b4656e2963c5846bba9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 20:34:01 +0100 Subject: [PATCH 0113/5465] fix nexttodo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index d0a232cd..72693a7b 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -29,3 +29,6 @@ but everything else can be used from cdist-config -> do not pass. Changing those variables is only needed if debugging the core and for this purpose setting variables is fine. +-------------------------------------------------------------------------------- + + ----------> go through cdist-deploy-to and do a cleanup round From f358a34e1d26ab4f4dfbf7e44149827250486be3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 20:40:22 +0100 Subject: [PATCH 0114/5465] obsolete cdist-bin-transfer Signed-off-by: Nico Schottelius --- bin/cdist-bin-transfer | 50 ------------------------------------------ bin/cdist-deploy-to | 5 +++-- conf/manifest/init | 2 +- 3 files changed, 4 insertions(+), 53 deletions(-) delete mode 100755 bin/cdist-bin-transfer diff --git a/bin/cdist-bin-transfer b/bin/cdist-bin-transfer deleted file mode 100755 index e9a0a320..00000000 --- a/bin/cdist-bin-transfer +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Transfer all executables -# - -. cdist-config -[ $# -eq 1 ] || __cdist_usage "" -set -eu - -__cdist_target_host="$1"; shift - -# Find directory that contains cdist binaries -__cdist_conf_dir_path=$(which cdist-config) -__cdist_src_base=${__cdist_conf_dir_path%config} - -# Help the user -echo "Transferring cdist binaries ..." - -# re-create basedir so it's clean -ssh "${__cdist_remote_user}@${__cdist_target_host}" \ - "rm -rf \"${__cdist_remote_bin_dir}\" && mkdir -p \"${__cdist_remote_bin_dir}\"" - -# Transfer cdist-* to the remote host -scp -qr "${__cdist_src_base}"* \ - "${__cdist_remote_user}@${__cdist_target_host}:${__cdist_remote_bin_dir}" - -# Adjust cdist-config to contain static version string -tmp_version="$__cdist_version" -sed "s/^: \${\(__cdist_version\):=.*/\1=\"$tmp_version\"/" "$(which cdist-config)" | \ - ssh -q "${__cdist_remote_user}@${__cdist_target_host}" \ - "cat > \"${__cdist_remote_bin_dir}\"/cdist-config" - diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 0693a051..3d83dfec 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -42,8 +42,9 @@ echo "cdist $__cdist_version: Configuring $__cdist_target_host" # Prepare local and remote directories __cdist_init_deploy "$__cdist_target_host" -# Transfer cdist "binaries" -cdist-bin-transfer "$__cdist_target_host" +# Transfer cdist executables +echo "Transferring cdist binaries ...X" +cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" # Execute general explorers cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir" diff --git a/conf/manifest/init b/conf/manifest/init index 85a9a359..e54f83aa 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -13,7 +13,7 @@ case "$__target_host" in # Everybody has this localhost) __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic - __directory /tmp/cdist-test-dir --mode 4777 + require="foo" __directory /tmp/cdist-test-dir --mode 4777 __file /tmp/cdist-test-file --mode 0750 --owner nobody --group root ;; From 0f8a0097e0c23a1c9670aa6bf317bb9230b02991 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 20:41:31 +0100 Subject: [PATCH 0115/5465] and remove documentation for cdist-bin-transfer Signed-off-by: Nico Schottelius --- Makefile | 1 - doc/man/cdist-bin-transfer.text | 30 ------------------------------ 2 files changed, 31 deletions(-) delete mode 100644 doc/man/cdist-bin-transfer.text diff --git a/Makefile b/Makefile index 3842e47f..90335d99 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ MANDIR=doc/man MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ - $(MANDIR)/cdist-bin-transfer.text \ $(MANDIR)/cdist-config.text \ $(MANDIR)/cdist-dir.text \ $(MANDIR)/cdist-env.text \ diff --git a/doc/man/cdist-bin-transfer.text b/doc/man/cdist-bin-transfer.text deleted file mode 100644 index 21f00b65..00000000 --- a/doc/man/cdist-bin-transfer.text +++ /dev/null @@ -1,30 +0,0 @@ -cdist-bin-transfer(1) -===================== -Nico Schottelius - - -NAME ----- -cdist-bin-transfer - Transfer binaries to the target - - -SYNOPSIS --------- -cdist-deploy-to HOSTNAME REMOTE_DIR - - -DESCRIPTION ------------ -cdist-bin-transfer copies all cdist binaries to the given host HOSTNAME -into the given directory REMOTE_DIR. These binaries will be used in -further stages to retrieve information or apply configurations. - -SEE ALSO --------- -cdist(7) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). From 6b098bff3ba2c2e0feaff8e057cb3500d9ace078 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 23:46:13 +0100 Subject: [PATCH 0116/5465] cleanup bin/cdist-explorer-run-global and rename it from bin/cdist-explorer-run-init Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 2 +- ...cdist-explorer-run-init => cdist-explorer-run-global} | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) rename bin/{cdist-explorer-run-init => cdist-explorer-run-global} (82%) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 3d83dfec..3436ca20 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -47,7 +47,7 @@ echo "Transferring cdist binaries ...X" cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" # Execute general explorers -cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir" +cdist-explorer-run-global "$__cdist_target_host" # Create initial object base cdist-manifest-run-init "$__cdist_target_host" "$__cdist_out_object_dir" diff --git a/bin/cdist-explorer-run-init b/bin/cdist-explorer-run-global similarity index 82% rename from bin/cdist-explorer-run-init rename to bin/cdist-explorer-run-global index 492c70d0..7a06a982 100755 --- a/bin/cdist-explorer-run-init +++ b/bin/cdist-explorer-run-global @@ -18,17 +18,16 @@ # along with cdist. If not, see . # # -# Copy & run the general explorers, i.e. not bound to types +# Copy & run the global explorers, i.e. not bound to types # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -ue __cdist_target_host="$1"; shift -__cdist_my_out_dir="$1"; shift -echo "Running general explorers ..." +echo "Running global explorers ..." # copy the explorers cdist-dir push "$__cdist_target_host" \ @@ -41,4 +40,4 @@ cdist-run-remote "${__cdist_target_host}" cdist-remote-explorer-run \ # retrieve the results cdist-dir pull "$__cdist_target_host" \ - "${__cdist_remote_out_explorer_dir}" "${__cdist_my_out_dir}" + "${__cdist_remote_out_explorer_dir}" "${__cdist_out_explorer_dir}" From 0243e71fe7c7880b317d32582b4ac47e23e1632d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 23:47:46 +0100 Subject: [PATCH 0117/5465] document cdist-explorer-run-global Signed-off-by: Nico Schottelius --- doc/man/cdist-explorer-run-global.text | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/man/cdist-explorer-run-global.text diff --git a/doc/man/cdist-explorer-run-global.text b/doc/man/cdist-explorer-run-global.text new file mode 100644 index 00000000..f4b32dfb --- /dev/null +++ b/doc/man/cdist-explorer-run-global.text @@ -0,0 +1,31 @@ +cdist-explorer-run-global(1) +============================ +Nico Schottelius + + +NAME +---- +cdist-explorer-run-global - Run the global explorers + + +SYNOPSIS +-------- +cdist-explorer-run-global HOSTNAME + + +DESCRIPTION +----------- +Transfer the global explorers to HOSTNAME, execute them and transfer +back the results. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From b7a91a97ac1336b1d2b24ec0e7aea2622bacd3ec Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 23:49:36 +0100 Subject: [PATCH 0118/5465] cleanup makefile + new doc Signed-off-by: Nico Schottelius --- Makefile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 90335d99..4a6f0422 100644 --- a/Makefile +++ b/Makefile @@ -12,17 +12,18 @@ WEBPAGE=software/cdist.mdwn MANDIR=doc/man MANGENERATED=$(MANDIR)/cdist-reference.text -MANSRC=$(MANDIR)/cdist.text \ - $(MANDIR)/cdist-config.text \ - $(MANDIR)/cdist-dir.text \ - $(MANDIR)/cdist-env.text \ - $(MANDIR)/cdist-deploy-to.text \ - $(MANDIR)/cdist-explorer.text \ - $(MANDIR)/cdist-manifest.text \ - $(MANDIR)/cdist-quickstart.text \ - $(MANDIR)/cdist-stages.text \ - $(MANDIR)/cdist-type.text \ - $(MANDIR)/cdist-type-template.text \ +MANSRC=$(MANDIR)/cdist.text \ + $(MANDIR)/cdist-config.text \ + $(MANDIR)/cdist-dir.text \ + $(MANDIR)/cdist-env.text \ + $(MANDIR)/cdist-explorer-run-global.text \ + $(MANDIR)/cdist-deploy-to.text \ + $(MANDIR)/cdist-explorer.text \ + $(MANDIR)/cdist-manifest.text \ + $(MANDIR)/cdist-quickstart.text \ + $(MANDIR)/cdist-stages.text \ + $(MANDIR)/cdist-type.text \ + $(MANDIR)/cdist-type-template.text \ ################################################################################ From 02abb22a0de3d82adca2be9ec8c853c2cb8bfb7f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 23:54:16 +0100 Subject: [PATCH 0119/5465] replace broken __cdist_object_base_dir with __cdist_out_object_dir} Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 0b6d84fa..38f997fa 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -226,7 +226,7 @@ __cdist_object_id_from_object() __cdist_object_dir() { - echo "${__cdist_object_base_dir}/$1" + echo "${__cdist_out_object_dir}/$1" } __cdist_remote_object_dir() From 26eb50c89c65f9f7ed73280219081dce0adae087 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 23:54:45 +0100 Subject: [PATCH 0120/5465] +todo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 72693a7b..3ddcc5b2 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -31,4 +31,4 @@ Changing those variables is only needed if debugging the core and for this purpose setting variables is fine. -------------------------------------------------------------------------------- - ----------> go through cdist-deploy-to and do a cleanup round +go through cdist-deploy-to and do a cleanup round From 4c36c7dddbf4aecbae151a336c25c8954d4f71b5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 17 Mar 2011 23:55:37 +0100 Subject: [PATCH 0121/5465] update cdist-manifest-run-init to argc==1 as well Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 7 ++----- bin/cdist-manifest-run-init | 5 ++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 3436ca20..5eac578b 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -43,14 +43,11 @@ echo "cdist $__cdist_version: Configuring $__cdist_target_host" __cdist_init_deploy "$__cdist_target_host" # Transfer cdist executables -echo "Transferring cdist binaries ...X" +echo "Transferring cdist binaries ..." cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" -# Execute general explorers cdist-explorer-run-global "$__cdist_target_host" - -# Create initial object base -cdist-manifest-run-init "$__cdist_target_host" "$__cdist_out_object_dir" +cdist-manifest-run-init "$__cdist_target_host" # Create dependent objects cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir" diff --git a/bin/cdist-manifest-run-init b/bin/cdist-manifest-run-init index a775d5a5..f895bafa 100755 --- a/bin/cdist-manifest-run-init +++ b/bin/cdist-manifest-run-init @@ -23,13 +23,12 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -e __cdist_target_host="$1"; shift -__cdist_output_dir="$1"; shift eval export $__cdist_name_var_manifest=\"\$__cdist_manifest_dir\" echo "Running initial manifest for $__cdist_target_host ..." -cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" "$__cdist_output_dir" +cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" "$__cdist_out_object_dir" From d1191fb4a9d1043917719f9ca9a34014f507a7c3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:00:28 +0100 Subject: [PATCH 0122/5465] document cdist-manifest-run-init Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-manifest-run-init.text | 32 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 doc/man/cdist-manifest-run-init.text diff --git a/Makefile b/Makefile index 4a6f0422..b53bdbf9 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ $(MANDIR)/cdist-manifest.text \ + $(MANDIR)/cdist-manifest-run-init.text \ $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ diff --git a/doc/man/cdist-manifest-run-init.text b/doc/man/cdist-manifest-run-init.text new file mode 100644 index 00000000..3a3265dc --- /dev/null +++ b/doc/man/cdist-manifest-run-init.text @@ -0,0 +1,32 @@ +cdist-manifest-run-init(1) +========================== +Nico Schottelius + + +NAME +---- +cdist-manifest-run-init - Run the initial manifest + + +SYNOPSIS +-------- +cdist-manifest-run-init HOSTNAME + + +DESCRIPTION +----------- +cdist-manifest-run-init executes the initial manifest, which creates +the first objects. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-manifest-run-all(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From adcb88d53d5328f8fa69a56f717fe5e0465eaa05 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:01:14 +0100 Subject: [PATCH 0123/5465] ignore unset requirements Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 07fdcc75..fcfbe60f 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -106,6 +106,8 @@ if [ "$other" ]; then fi # Record requirements +# it's fine, if it's not set +set +u for requirement in $require; do echo $requirement >> "$(__cdist_object_require "$__cdist_object")" done From 833c09adce9748fe864d2c9eb1d5d5dd6e0ff3fb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:07:49 +0100 Subject: [PATCH 0124/5465] argc == 1 for cdist-manifest-run-all Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 4 +--- bin/cdist-manifest-run-all | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 5eac578b..1461d526 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -48,9 +48,7 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" - -# Create dependent objects -cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir" +cdist-manifest-run-all "$__cdist_target_host" # Run explorer of each type for every object of types with explorer cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir" diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index df4548bf..a111627f 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -28,11 +28,10 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -eu __cdist_target_host="$1"; shift -__cdist_object_base_dir="$1"; shift __cdist_objects_list="${__cdist_tmp_dir}/objects_file" __cdist_new_objects_list="${__cdist_tmp_dir}/new_objects_file" @@ -46,12 +45,12 @@ while [ "$__cdist_new_objects_created" = "y" ]; do # Assume we're done after this run __cdist_new_objects_created=n - __cdist_object_list "$__cdist_object_base_dir" > "$__cdist_objects_list" + __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects_list" # Check every object, if we need to run it while read __cdist_object; do # Full path to current object - __cdist_cur_object_dir="$__cdist_object_base_dir/$__cdist_object" + __cdist_cur_object_dir="$__cdist_out_object_dir/$__cdist_object" # Only the id __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" @@ -89,7 +88,7 @@ while [ "$__cdist_new_objects_created" = "y" ]; do [ "$__cdist_new_objects_created" = "n" ] && __cdist_new_objects_created="y" # where to save the newly created object - __cdist_object_dir="$__cdist_object_base_dir/$__cdist_new_object" + __cdist_object_dir="$__cdist_out_object_dir/$__cdist_new_object" # Source of the new object __cdist_new_object_dir="${__cdist_new_objects_dir}/$__cdist_new_object" From fa97d7080c0190775b777f5d4fd46f92f65f7e8c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:08:38 +0100 Subject: [PATCH 0125/5465] todo -- Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 3ddcc5b2..6576877e 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,34 +1,10 @@ Dependencies: Record in bin/cdist-type-emulator Fix __cdist_object_base_dir issue (vs. $__cdist_out_object_dir in deploy-to) - | - | -|-----| -| -| -| New problem: + go through cdist-deploy-to and do a cleanup round -Parts of the core use argv (see bin/cdist-deploy-to), -assign this either an own name or a "standard" name. - -cdist-config has a function that uses this "standard" var: - /home/users/nico/oeffentlich/rechner/projekte/cdist/bin/cdist-config: Zeile 229: __cdist_object_base_dir ist nicht gesetzt. - -In essence: - - - either argv lists get much longer (supplying all relevant arguments) - - OR cdist-core commands depend on the given environment: - - makes debugging more look like - var1="" var2="" var3="" ... cdist-$tool_to_debug - vs. currently - var1="" cdist-$tool_to_debug opt1 opt2 -------------------------------------------------------------------------------- -It seems that being able to pass the target host as argv makes sense, -but everything else can be used from cdist-config -> do not pass. - -Changing those variables is only needed if debugging the core and for -this purpose setting variables is fine. --------------------------------------------------------------------------------- - -go through cdist-deploy-to and do a cleanup round +done: +* Document cdist-explorer-run-global +* Document cdist-manifest-run-init From 8dddec57db480084f050a32adc7150789541f6b4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:11:12 +0100 Subject: [PATCH 0126/5465] document cdist-manifest-run-all Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/dev/todo/niconext | 1 + doc/man/cdist-manifest-run-all.text | 32 +++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 doc/man/cdist-manifest-run-all.text diff --git a/Makefile b/Makefile index b53bdbf9..2eae1e93 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-explorer.text \ $(MANDIR)/cdist-manifest.text \ $(MANDIR)/cdist-manifest-run-init.text \ + $(MANDIR)/cdist-manifest-run-all.text \ $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 6576877e..0960b372 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -8,3 +8,4 @@ Dependencies: done: * Document cdist-explorer-run-global * Document cdist-manifest-run-init +* Document cdist-manifest-run-all diff --git a/doc/man/cdist-manifest-run-all.text b/doc/man/cdist-manifest-run-all.text new file mode 100644 index 00000000..717089ad --- /dev/null +++ b/doc/man/cdist-manifest-run-all.text @@ -0,0 +1,32 @@ +cdist-manifest-run-all(1) +========================== +Nico Schottelius + + +NAME +---- +cdist-manifest-run-all - Run manifests of all created types + + +SYNOPSIS +-------- +cdist-manifest-run-all HOSTNAME + + +DESCRIPTION +----------- +cdist-manifest-run-all iterates over every existing object and +executes the manifest of its type. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-manifest-run-init(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 618287efaad92083b981fb02ecf1a151700f8e38 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:15:02 +0100 Subject: [PATCH 0127/5465] argc == 1 for cdist-object-explorer-all Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 4 +--- bin/cdist-object-explorer-all | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 1461d526..07e0459a 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -49,9 +49,7 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" cdist-manifest-run-all "$__cdist_target_host" - -# Run explorer of each type for every object of types with explorer -cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir" +cdist-object-explorer-all "$__cdist_target_host" # Generate code for all objects cdist-object-gencode-all "$__cdist_target_host" "$__cdist_out_object_dir" diff --git a/bin/cdist-object-explorer-all b/bin/cdist-object-explorer-all index 8d6ab54a..8654b03f 100755 --- a/bin/cdist-object-explorer-all +++ b/bin/cdist-object-explorer-all @@ -22,18 +22,17 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -eu __cdist_target_host="$1"; shift -__cdist_object_base_dir="$1"; shift object_listing="$__cdist_tmp_dir/objects" type_listing_all="$__cdist_tmp_dir/types_all" type_listing="$__cdist_tmp_dir/types" # Get listing of objects -__cdist_object_list "$__cdist_object_base_dir" > "$object_listing" +__cdist_object_list "$__cdist_out_object_dir" > "$object_listing" # Get listing of types used while read object; do From df2e77f9edf3a561a12be5c37add531bee96ec4d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:18:00 +0100 Subject: [PATCH 0128/5465] document cdist-object-explorer-all Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-object-explorer-all.text | 33 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 doc/man/cdist-object-explorer-all.text diff --git a/Makefile b/Makefile index 2eae1e93..df87de17 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-manifest.text \ $(MANDIR)/cdist-manifest-run-init.text \ $(MANDIR)/cdist-manifest-run-all.text \ + $(MANDIR)/cdist-object-explorer-all.text \ $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ diff --git a/doc/man/cdist-object-explorer-all.text b/doc/man/cdist-object-explorer-all.text new file mode 100644 index 00000000..dda3d30d --- /dev/null +++ b/doc/man/cdist-object-explorer-all.text @@ -0,0 +1,33 @@ +cdist-object-explorer-all(1) +============================ +Nico Schottelius + + +NAME +---- +cdist-object-explorer-all - Run type explorer for every object + + +SYNOPSIS +-------- +cdist-object-explorer-all HOSTNAME + + +DESCRIPTION +----------- +For every object, it checks whether the type has one or more explorers. +If so, the explorers of the type are copied to the target and executed +once per object. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-remote-explorer-run(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 82cac6f3d82c31e6a5f4965cd7174dd3e4107256 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:18:44 +0100 Subject: [PATCH 0129/5465] less todo - more fun Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/doc/dev/todo/post-1.1 b/doc/dev/todo/post-1.1 index a4f525e3..2575d7bb 100644 --- a/doc/dev/todo/post-1.1 +++ b/doc/dev/todo/post-1.1 @@ -33,13 +33,9 @@ Documentation: + cdist-manifest - ensure every file in bin/ has a correspondent manpage - cdist-code-run-all - - cdist-explorer-run-init - cdist-manifest-run - - cdist-manifest-run-all - - cdist-manifest-run-init - cdist-object-codegen - cdist-object-codegen-all - - cdist-object-explorer-all - cdist-remote-code-run-all - cdist-remote-explorer-run - cdist-run-remote From 7e713f1b224a69fc30ba955ccf21dd832fccf0e9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:22:02 +0100 Subject: [PATCH 0130/5465] argc == 1 for cdist-object-gencode-all Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 4 +--- bin/cdist-object-gencode-all | 13 ++++--------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 07e0459a..d122ac08 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -50,9 +50,7 @@ cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" cdist-manifest-run-all "$__cdist_target_host" cdist-object-explorer-all "$__cdist_target_host" - -# Generate code for all objects -cdist-object-gencode-all "$__cdist_target_host" "$__cdist_out_object_dir" +cdist-object-gencode-all "$__cdist_target_host" # Transfer all objects including code cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ diff --git a/bin/cdist-object-gencode-all b/bin/cdist-object-gencode-all index 40c39fd4..024e4a69 100755 --- a/bin/cdist-object-gencode-all +++ b/bin/cdist-object-gencode-all @@ -18,29 +18,24 @@ # along with cdist. If not, see . # # -# For each created object create the code to be executed on the -# target. +# For each created object create the code to be executed on the target. # . cdist-config - -if [ $# -ne 2 ]; then - __cdist_usage " " -fi +[ $# -eq 1 ] || __cdist_usage "" set -eu __cdist_target_host="$1"; shift -__cdist_object_base_dir="$1"; shift -__cdist_object_list "$__cdist_object_base_dir" > "$__cdist_tmp_file" +__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" while read object; do code="$(__cdist_object_code "$object")" echo "Generating code for $object ..." cdist-object-gencode "$__cdist_target_host" \ - "$__cdist_object_base_dir" \ + "$__cdist_out_object_dir" \ "$object" > "${code}" chmod u+x "${code}" From 2f207c29e5d2c54ba62fb52c82ef0a7a74f3794d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:24:58 +0100 Subject: [PATCH 0131/5465] document cdist-object-gencode-all Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-object-gencode-all.text | 31 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 doc/man/cdist-object-gencode-all.text diff --git a/Makefile b/Makefile index df87de17..9317803f 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-manifest-run-init.text \ $(MANDIR)/cdist-manifest-run-all.text \ $(MANDIR)/cdist-object-explorer-all.text \ + $(MANDIR)/cdist-object-gencode-all.text \ $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ diff --git a/doc/man/cdist-object-gencode-all.text b/doc/man/cdist-object-gencode-all.text new file mode 100644 index 00000000..40d4335d --- /dev/null +++ b/doc/man/cdist-object-gencode-all.text @@ -0,0 +1,31 @@ +cdist-object-gencode-all(1) +=========================== +Nico Schottelius + + +NAME +---- +cdist-object-gencode-all - Generate code for every existing object + + +SYNOPSIS +-------- +cdist-object-gencode-all HOSTNAME + + +DESCRIPTION +----------- +For every object that exists, the cdist-object-gencode is executed. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-object-gencode(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 0f8341765200cf72eaa712057125a0a448a75810 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:28:05 +0100 Subject: [PATCH 0132/5465] argc-=1 for cdist-object-gencode Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode | 5 ++--- bin/cdist-object-gencode-all | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index a1092a46..aea1da07 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -23,11 +23,10 @@ # . cdist-config -[ $# -eq 3 ] || __cdist_usage "" "" "" +[ $# -eq 2 ] || __cdist_usage "" "" set -eu __cdist_target_host="$1"; shift -__cdist_object_base_dir="$1"; shift __cdist_object="$1"; shift __cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" @@ -55,7 +54,7 @@ if [ -x "$gencode" ]; then __cdist_exec_fail_on_error "$gencode" else if [ -f "$gencode" ]; then - echo "$gencode" exists, but is not executable >&2 + echo "Warning: $gencode exists, but is not executable" >&2 fi # No gencode? also fine! Ensure we exit 0 diff --git a/bin/cdist-object-gencode-all b/bin/cdist-object-gencode-all index 024e4a69..90090c8a 100755 --- a/bin/cdist-object-gencode-all +++ b/bin/cdist-object-gencode-all @@ -23,7 +23,6 @@ . cdist-config [ $# -eq 1 ] || __cdist_usage "" - set -eu __cdist_target_host="$1"; shift @@ -34,9 +33,7 @@ while read object; do code="$(__cdist_object_code "$object")" echo "Generating code for $object ..." - cdist-object-gencode "$__cdist_target_host" \ - "$__cdist_out_object_dir" \ - "$object" > "${code}" + cdist-object-gencode "$__cdist_target_host" "$object" > "${code}" chmod u+x "${code}" done < "$__cdist_tmp_file" From d204ac523ce6eae16086ae0b53af05dc47d71462 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:32:04 +0100 Subject: [PATCH 0133/5465] document cdist-object-gencode Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-object-gencode.text | 32 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 doc/man/cdist-object-gencode.text diff --git a/Makefile b/Makefile index 9317803f..33bbff1d 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-manifest-run-init.text \ $(MANDIR)/cdist-manifest-run-all.text \ $(MANDIR)/cdist-object-explorer-all.text \ + $(MANDIR)/cdist-object-gencode.text \ $(MANDIR)/cdist-object-gencode-all.text \ $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-stages.text \ diff --git a/doc/man/cdist-object-gencode.text b/doc/man/cdist-object-gencode.text new file mode 100644 index 00000000..c6fc8b18 --- /dev/null +++ b/doc/man/cdist-object-gencode.text @@ -0,0 +1,32 @@ +cdist-object-gencode(1) +======================= +Nico Schottelius + + +NAME +---- +cdist-object-gencode - Generate code for a given object + + +SYNOPSIS +-------- +cdist-object-gencode HOSTNAME OBJECT + + +DESCRIPTION +----------- +For the given object, run the gencode executable. The output of this +executable on stdout will be used by cdist-object-gencode-all(1). + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-object-gencode-all(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From be9eec702c1a9d45c1419959a91ee3342b41b95a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:37:33 +0100 Subject: [PATCH 0134/5465] document cdist-code-run-all Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-code-run-all.text | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 doc/man/cdist-code-run-all.text diff --git a/Makefile b/Makefile index 33bbff1d..f3b1ef78 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ MANDIR=doc/man MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ + $(MANDIR)/cdist-code-run-all.text \ $(MANDIR)/cdist-config.text \ $(MANDIR)/cdist-dir.text \ $(MANDIR)/cdist-env.text \ diff --git a/doc/man/cdist-code-run-all.text b/doc/man/cdist-code-run-all.text new file mode 100644 index 00000000..fba2e7e3 --- /dev/null +++ b/doc/man/cdist-code-run-all.text @@ -0,0 +1,32 @@ +cdist-code-run-all(1) +===================== +Nico Schottelius + + +NAME +---- +cdist-code-run-all - Execute all generated code on the target + + +SYNOPSIS +-------- +cdist-code-run-all HOSTNAME + + +DESCRIPTION +----------- +cdist-code-run-all is just a wrapper for cdist-remote-code-run-all. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-remote-code-run-all(1) +- cdist-run-remote(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 2a3a783cac7e02bae25c08e65c50503d1789508a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:41:18 +0100 Subject: [PATCH 0135/5465] document cdist-run-remote Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-run-remote.text | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 doc/man/cdist-run-remote.text diff --git a/Makefile b/Makefile index f3b1ef78..34c5f719 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-object-gencode.text \ $(MANDIR)/cdist-object-gencode-all.text \ $(MANDIR)/cdist-quickstart.text \ + $(MANDIR)/cdist-run-remote.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ $(MANDIR)/cdist-type-template.text \ diff --git a/doc/man/cdist-run-remote.text b/doc/man/cdist-run-remote.text new file mode 100644 index 00000000..6f06360f --- /dev/null +++ b/doc/man/cdist-run-remote.text @@ -0,0 +1,33 @@ +cdist-run-remote(1) +=================== +Nico Schottelius + + +NAME +---- +cdist-run-remote - Execute something on the target + + +SYNOPSIS +-------- +cdist-run-remote HOSTNAME EXECUTABLE [ARGUMENTS FOR EXECUTABLE] + + +DESCRIPTION +----------- +cdist-run-remote runs the given executable on the remote host. +It ensures PATH is setup correctly on the target side. + + +SEE ALSO +-------- +- cdist(7) +- cdist-code-run-all(1) +- cdist-deploy-to(1) +- cdist-remote-code-run-all(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 0195b14f097fc1e27fe0ee1a5ce23d872bea9b1b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:48:17 +0100 Subject: [PATCH 0136/5465] document cdist-manifest-run Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/dev/todo/niconext | 6 ++++++ doc/man/cdist-manifest-run.text | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 doc/man/cdist-manifest-run.text diff --git a/Makefile b/Makefile index 34c5f719..6c28a88b 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ $(MANDIR)/cdist-manifest.text \ + $(MANDIR)/cdist-manifest-run.text \ $(MANDIR)/cdist-manifest-run-init.text \ $(MANDIR)/cdist-manifest-run-all.text \ $(MANDIR)/cdist-object-explorer-all.text \ diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 0960b372..48a3e125 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -9,3 +9,9 @@ done: * Document cdist-explorer-run-global * Document cdist-manifest-run-init * Document cdist-manifest-run-all +cdist-run-remote +cdist-code-run-all +cdist-object-gencode + +cdist-object-gencode-all +cdist-manifest-run diff --git a/doc/man/cdist-manifest-run.text b/doc/man/cdist-manifest-run.text new file mode 100644 index 00000000..d483b29b --- /dev/null +++ b/doc/man/cdist-manifest-run.text @@ -0,0 +1,33 @@ +cdist-manifest-run(1) +===================== +Nico Schottelius + + +NAME +---- +cdist-manifest-run - Run a given manifest + + +SYNOPSIS +-------- +cdist-manifest-run HOSTNAME MANIFEST OUTPUT_DIR + + +DESCRIPTION +----------- +cdist-manifest-run executes the given MANIFEST and saves the output into +OUTPUT_DIR. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-manifest-run-all(1) +- cdist-manifest-run-init(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 94fce76b02315982dd4693b4d80072f223e21d56 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:49:34 +0100 Subject: [PATCH 0137/5465] todo -- Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.1 | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/dev/todo/post-1.1 b/doc/dev/todo/post-1.1 index 2575d7bb..d75d050d 100644 --- a/doc/dev/todo/post-1.1 +++ b/doc/dev/todo/post-1.1 @@ -1,9 +1,9 @@ Core: - - write test case: test.sh + - write test case: test.sh - probably remove grep -q (solaris does not have it) Dependencies: - - Add meta parameters like --requires --excludes --depends? + - via env - Build dependency tree - Exit on any error - Check return codes @@ -28,17 +28,9 @@ Documentation: - Different environments (production, integration, development) - via version control - Check all references in manpages, ensure all manpages exist, generic ones: - + cdist - + cdist-deploy-to - + cdist-manifest - ensure every file in bin/ has a correspondent manpage - - cdist-code-run-all - - cdist-manifest-run - - cdist-object-codegen - - cdist-object-codegen-all - cdist-remote-code-run-all - cdist-remote-explorer-run - - cdist-run-remote - cdist-type-build-emulation - cdist-type-emulator - Ensure html output of manpages are published on the web From 313e92779c7fafcc9661406aa697b0440b7ad354 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 00:58:33 +0100 Subject: [PATCH 0138/5465] cleanup + replace __cdist_object_base_dir Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run-all | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/cdist-remote-code-run-all b/bin/cdist-remote-code-run-all index 6f21a99d..7135037f 100755 --- a/bin/cdist-remote-code-run-all +++ b/bin/cdist-remote-code-run-all @@ -18,21 +18,17 @@ # along with cdist. If not, see . # # -# This binary is executed on the remote side to execute explorers +# This binary is executed on the remote side to execute code # -# It supports different variables names to be used, so __explorers -# and __type_explorers can be submitted :-) -# . cdist-config -if [ $# -ne 1 ]; then - __cdist_usage "" -fi +[ $# -eq 1 ] || __cdist_usage "" set -ue -__cdist_object_base_dir="$1"; shift +# Warning: Variable is special, as interpreted by __cdist_object_dir() +__cdist_out_object_dir="$1"; shift -__cdist_object_list "$__cdist_object_base_dir" > "$__cdist_tmp_file" +__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" # FIXME post 1.0: add dependencies while read object; do From 20715e4afaf2409403dd8bf793219d8329b7596e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:14:49 +0100 Subject: [PATCH 0139/5465] add template for cdist-remote-code-run Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 bin/cdist-remote-code-run diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run new file mode 100755 index 00000000..0489760d --- /dev/null +++ b/bin/cdist-remote-code-run @@ -0,0 +1,82 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# This binary is executed on the remote side to execute code +# + +. cdist-config +[ $# -eq 1 ] || __cdist_usage "" +set -ue + +# Warning: Variable is special, as interpreted by __cdist_object_dir() +__cdist_out_object_dir="$1"; shift + +__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" + +# FIXME post 1.0: add dependencies +while read object; do + code="$(__cdist_object_code "$object")" + echo "Running code for $object ..." + if [ -e "$code" ]; then + if [ -f "$code" ]; then + if [ -x "$code" ]; then + "$code" + else + __cdist_exit_err "$code exists, but is not executable." + fi + else + __cdist_exit_err "$code exists, but is not a file." + fi + else + __cdist_exit_err "Missing code for ${object}." + fi +done < "$__cdist_tmp_file" + +__cdist_all_code_done=n + +while [ "$__cdist_all_code_done" = n ]; do + while read object; do + code="$(__cdist_object_code "$object")" + require="$(__cdist_object_require "$object")" + + # Object depends on others, execute them before us + if [ -f "$require" ]; then + while read requirement; do + cdist-remote-code-run "$code" + done < "$require" + fi + + + echo "Running code for $object ..." + if [ -e "$code" ]; then + if [ -f "$code" ]; then + if [ -x "$code" ]; then + "$code" + else + __cdist_exit_err "$code exists, but is not executable." + fi + else + __cdist_exit_err "$code exists, but is not a file." + fi + else + __cdist_exit_err "Missing code for ${object}." + fi + done < "$__cdist_tmp_file" +done From 209e34512d0dc35bbf3c829301f547fd0cb04cc9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:31:15 +0100 Subject: [PATCH 0140/5465] in theory finish new cdist-remote-code-run Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run | 82 ++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 49 deletions(-) diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run index 0489760d..a9ecd886 100755 --- a/bin/cdist-remote-code-run +++ b/bin/cdist-remote-code-run @@ -22,61 +22,45 @@ # . cdist-config -[ $# -eq 1 ] || __cdist_usage "" +[ $# -eq 2 ] || __cdist_usage " " set -ue -# Warning: Variable is special, as interpreted by __cdist_object_dir() +# This variable MUST be exactly like this - see __cdist_object_dir __cdist_out_object_dir="$1"; shift -__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" +object="$1"; shift -# FIXME post 1.0: add dependencies -while read object; do - code="$(__cdist_object_code "$object")" - echo "Running code for $object ..." - if [ -e "$code" ]; then - if [ -f "$code" ]; then - if [ -x "$code" ]; then - "$code" - else - __cdist_exit_err "$code exists, but is not executable." - fi +finished="$(__cdist_object_code_finished "$__cdist_object")" +code="$(__cdist_object_code "$object")" +require="$(__cdist_object_require "$object")" + + +# Do nothing if our work has been done +if [ -f "$finished" ]; then + exit 0 +fi + +echo "Checking code for $object ..." + +if [ -f "$require" ]; then + while read requirement; do + echo "Running dependency $requirement for $object ..." + cdist-remote-code-run "$__cdist_out_object_dir" "$object" + done < "$require" +fi + +if [ -e "$code" ]; then + if [ -f "$code" ]; then + if [ -x "$code" ]; then + echo "Executing code for $object ..." + "$code" + touch "$__cdist_finished" else - __cdist_exit_err "$code exists, but is not a file." + __cdist_exit_err "$code exists, but is not executable." fi else - __cdist_exit_err "Missing code for ${object}." + __cdist_exit_err "$code exists, but is not a file." fi -done < "$__cdist_tmp_file" - -__cdist_all_code_done=n - -while [ "$__cdist_all_code_done" = n ]; do - while read object; do - code="$(__cdist_object_code "$object")" - require="$(__cdist_object_require "$object")" - - # Object depends on others, execute them before us - if [ -f "$require" ]; then - while read requirement; do - cdist-remote-code-run "$code" - done < "$require" - fi - - - echo "Running code for $object ..." - if [ -e "$code" ]; then - if [ -f "$code" ]; then - if [ -x "$code" ]; then - "$code" - else - __cdist_exit_err "$code exists, but is not executable." - fi - else - __cdist_exit_err "$code exists, but is not a file." - fi - else - __cdist_exit_err "Missing code for ${object}." - fi - done < "$__cdist_tmp_file" -done +else + __cdist_exit_err "Missing code for ${object}." +fi From 42af407d3ef7c814d8019c7cd518ac3e1e234271 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:31:30 +0100 Subject: [PATCH 0141/5465] refactor cdist-remote-code-run-all Signed-off-by: Nico Schottelius --- bin/cdist-config | 6 ++++++ bin/cdist-remote-code-run-all | 21 +++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 38f997fa..62337024 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -42,6 +42,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_bin:=bin} : ${__cdist_name_code:=code} +: ${__cdist_name_code_finished:=.codedone} : ${__cdist_name_conf_dir:=conf} : ${__cdist_name_explorer:=explorer} : ${__cdist_name_gencode:=gencode} @@ -239,6 +240,11 @@ __cdist_object_code() echo "$(__cdist_object_dir "$1")/${__cdist_name_code}" } +__cdist_object_code_finished() +{ + echo "$(__cdist_object_dir "$1")/${__cdist_name_code_finished}" +} + __cdist_object_parameter_dir() { echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}" diff --git a/bin/cdist-remote-code-run-all b/bin/cdist-remote-code-run-all index 7135037f..6c60337a 100755 --- a/bin/cdist-remote-code-run-all +++ b/bin/cdist-remote-code-run-all @@ -30,21 +30,14 @@ __cdist_out_object_dir="$1"; shift __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" -# FIXME post 1.0: add dependencies while read object; do code="$(__cdist_object_code "$object")" - echo "Running code for $object ..." - if [ -e "$code" ]; then - if [ -f "$code" ]; then - if [ -x "$code" ]; then - "$code" - else - __cdist_exit_err "$code exists, but is not executable." - fi - else - __cdist_exit_err "$code exists, but is not a file." - fi - else - __cdist_exit_err "Missing code for ${object}." + require="$(__cdist_object_require "$object")" + + # Object code depends on others, execute them before us + if [ -f "$require" ]; then + while read requirement; do + cdist-remote-code-run "$code" + done < "$require" fi done < "$__cdist_tmp_file" From 73364999957b5711ba1f5a3ee0e421524b4550d6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:34:34 +0100 Subject: [PATCH 0142/5465] shrink cdist-remote-code-run-all Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 2 -- bin/cdist-remote-code-run | 2 +- bin/cdist-remote-code-run-all | 10 +--------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index d122ac08..d464c523 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -52,11 +52,9 @@ cdist-manifest-run-all "$__cdist_target_host" cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" -# Transfer all objects including code cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ "${__cdist_remote_out_object_base_dir}" -# And finally - execute the code cdist-code-run-all "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run index a9ecd886..a4958897 100755 --- a/bin/cdist-remote-code-run +++ b/bin/cdist-remote-code-run @@ -30,7 +30,7 @@ __cdist_out_object_dir="$1"; shift object="$1"; shift -finished="$(__cdist_object_code_finished "$__cdist_object")" +finished="$(__cdist_object_code_finished "$object")" code="$(__cdist_object_code "$object")" require="$(__cdist_object_require "$object")" diff --git a/bin/cdist-remote-code-run-all b/bin/cdist-remote-code-run-all index 6c60337a..1f051258 100755 --- a/bin/cdist-remote-code-run-all +++ b/bin/cdist-remote-code-run-all @@ -31,13 +31,5 @@ __cdist_out_object_dir="$1"; shift __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" while read object; do - code="$(__cdist_object_code "$object")" - require="$(__cdist_object_require "$object")" - - # Object code depends on others, execute them before us - if [ -f "$require" ]; then - while read requirement; do - cdist-remote-code-run "$code" - done < "$require" - fi + cdist-remote-code-run "$__cdist_out_object_dir" "$object" done < "$__cdist_tmp_file" From 84b4bf628e5b2afe4ab7575e22a4d2843e0c4fab Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:35:52 +0100 Subject: [PATCH 0143/5465] run dependency, not object again Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run index a4958897..2db9d0e7 100755 --- a/bin/cdist-remote-code-run +++ b/bin/cdist-remote-code-run @@ -45,7 +45,7 @@ echo "Checking code for $object ..." if [ -f "$require" ]; then while read requirement; do echo "Running dependency $requirement for $object ..." - cdist-remote-code-run "$__cdist_out_object_dir" "$object" + cdist-remote-code-run "$__cdist_out_object_dir" "$requirement" done < "$require" fi From 4cc237fa03e21302ef5eecbee7d6569196944eca Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:45:54 +0100 Subject: [PATCH 0144/5465] check for missing objects Signed-off-by: Nico Schottelius --- bin/cdist-config | 3 ++- bin/cdist-remote-code-run | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 62337024..56c49772 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -227,7 +227,8 @@ __cdist_object_id_from_object() __cdist_object_dir() { - echo "${__cdist_out_object_dir}/$1" + __cdist_object_dir="${__cdist_out_object_dir}/$1" + echo "$__cdist_object_dir" } __cdist_remote_object_dir() diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run index 2db9d0e7..af362470 100755 --- a/bin/cdist-remote-code-run +++ b/bin/cdist-remote-code-run @@ -30,6 +30,11 @@ __cdist_out_object_dir="$1"; shift object="$1"; shift +if [ ! -d "$(__cdist_object_dir "$object")" ]; then + __cdist_exit_err "Object $object missing." +fi + + finished="$(__cdist_object_code_finished "$object")" code="$(__cdist_object_code "$object")" require="$(__cdist_object_require "$object")" From 50f9d65d0d7f4c66174720572f2f5a8f84bdbbe6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:46:40 +0100 Subject: [PATCH 0145/5465] check for missing objects Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run index af362470..02487a89 100755 --- a/bin/cdist-remote-code-run +++ b/bin/cdist-remote-code-run @@ -45,7 +45,7 @@ if [ -f "$finished" ]; then exit 0 fi -echo "Checking code for $object ..." +echo "Checking code for $object ..." if [ -f "$require" ]; then while read requirement; do From 63416e4af83c2717a37e986f91620c1bc113c5f0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:48:30 +0100 Subject: [PATCH 0146/5465] indent messages Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run index 02487a89..7fa6a4f6 100755 --- a/bin/cdist-remote-code-run +++ b/bin/cdist-remote-code-run @@ -31,7 +31,7 @@ __cdist_out_object_dir="$1"; shift object="$1"; shift if [ ! -d "$(__cdist_object_dir "$object")" ]; then - __cdist_exit_err "Object $object missing." + __cdist_exit_err "Object $object is missing." fi @@ -45,11 +45,11 @@ if [ -f "$finished" ]; then exit 0 fi -echo "Checking code for $object ..." +echo "Checking code for $object ..." if [ -f "$require" ]; then while read requirement; do - echo "Running dependency $requirement for $object ..." + echo "Requiring object $requirement for $object ..." cdist-remote-code-run "$__cdist_out_object_dir" "$requirement" done < "$require" fi From 96cbb37a29835741d48463b82b8987e462758243 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:51:44 +0100 Subject: [PATCH 0147/5465] fix example code in conf/manifest/init Signed-off-by: Nico Schottelius --- conf/manifest/init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/manifest/init b/conf/manifest/init index e54f83aa..0b0dc9a5 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -13,8 +13,8 @@ case "$__target_host" in # Everybody has this localhost) __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic - require="foo" __directory /tmp/cdist-test-dir --mode 4777 - __file /tmp/cdist-test-file --mode 0750 --owner nobody --group root + require="__directory/tmp/cdist-test-dir" __file /tmp/cdist-test-dir/test-file --mode 0750 --owner nobody --group root + __directory /tmp/cdist-test-dir --mode 4777 ;; # From c287d33ee3b0b7a57ec72ae1ee6587febb4c0d9b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:52:00 +0100 Subject: [PATCH 0148/5465] use correct finish variable Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cdist-remote-code-run b/bin/cdist-remote-code-run index 7fa6a4f6..009c0743 100755 --- a/bin/cdist-remote-code-run +++ b/bin/cdist-remote-code-run @@ -49,7 +49,7 @@ echo "Checking code for $object ..." if [ -f "$require" ]; then while read requirement; do - echo "Requiring object $requirement for $object ..." + echo "Requiring dependency $requirement for $object ..." cdist-remote-code-run "$__cdist_out_object_dir" "$requirement" done < "$require" fi @@ -57,9 +57,9 @@ fi if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then - echo "Executing code for $object ..." + echo "Executing code for $object ..." "$code" - touch "$__cdist_finished" + touch "$finished" else __cdist_exit_err "$code exists, but is not executable." fi From 756226f15373ecdf351e8af41746e98ed8efd095 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 01:53:54 +0100 Subject: [PATCH 0149/5465] enhance example even further Signed-off-by: Nico Schottelius --- conf/manifest/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/manifest/init b/conf/manifest/init index 0b0dc9a5..f6328971 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -12,7 +12,7 @@ __file /etc/cdist-configured case "$__target_host" in # Everybody has this localhost) - __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic + require="__file/etc/cdist-configured" __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic require="__directory/tmp/cdist-test-dir" __file /tmp/cdist-test-dir/test-file --mode 0750 --owner nobody --group root __directory /tmp/cdist-test-dir --mode 4777 ;; From d4d2f47b602784bccf74fde686c6fb5fc4a1fd96 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:01:37 +0100 Subject: [PATCH 0150/5465] more examples, document dependencies Signed-off-by: Nico Schottelius --- conf/manifest/init | 10 ++++++++-- doc/man/cdist-manifest.text | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/conf/manifest/init b/conf/manifest/init index f6328971..1863a784 100755 --- a/conf/manifest/init +++ b/conf/manifest/init @@ -12,9 +12,15 @@ __file /etc/cdist-configured case "$__target_host" in # Everybody has this localhost) - require="__file/etc/cdist-configured" __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic - require="__directory/tmp/cdist-test-dir" __file /tmp/cdist-test-dir/test-file --mode 0750 --owner nobody --group root + require="__file/etc/cdist-configured" __link /tmp/cdist-testfile \ + --source /etc/cdist-configured --type symbolic + require="__directory/tmp/cdist-test-dir" __file /tmp/cdist-test-dir/test-file \ + --mode 0750 --owner nobody --group root __directory /tmp/cdist-test-dir --mode 4777 + + require="__file/etc/cdist-configured __link/tmp/cdist-testfile" \ + __file /tmp/cdist-another-testfile + ;; # diff --git a/doc/man/cdist-manifest.text b/doc/man/cdist-manifest.text index efa5a8eb..7da90f71 100644 --- a/doc/man/cdist-manifest.text +++ b/doc/man/cdist-manifest.text @@ -40,6 +40,28 @@ The manifest of the type "nologin" may look like this: __file /etc/nologin --type file --source "$__type/files/default.nologin" -------------------------------------------------------------------------------- +DEPENDENCIES +------------ +If you want to describe that something requires something else, just +setup the variable "require" to contain the requirements. Multiple +requirements can be added white space seperated. + + +-------------------------------------------------------------------------------- +# No dependency +__file /etc/cdist-configured + +# Require above object +require="__file/etc/cdist-configured" __link /tmp/cdist-testfile \ + --source /etc/cdist-configured --type symbolic + +# Require two objects +require="__file/etc/cdist-configured __link/tmp/cdist-testfile" \ + __file /tmp/cdist-another-testfile + + +-------------------------------------------------------------------------------- + SEE ALSO -------- From 4c54a6c15930270fe6a75844aa829ba778ee4aec Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:05:03 +0100 Subject: [PATCH 0151/5465] way less todo Signed-off-by: Nico Schottelius --- doc/changelog | 14 ++++++++++++-- doc/dev/todo/niconext | 18 +----------------- doc/dev/todo/post-1.1 | 6 ------ 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/doc/changelog b/doc/changelog index d69731ca..1d5ca3f8 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,15 @@ -1.1.1: - * New type __removeline +1.2.0: + * Added dependencies + * New type __removeline (Daniel Roth) + * Document cdist-run-remote + * Document cdist-code-run-all + * Document cdist-object-gencode + * Document cdist-explorer-run-global + * Document cdist-manifest-run-init + * Document cdist-manifest-run-all + * Document cdist-object-gencode-all + * Document cdist-manifest-run + 1.1.0: 2011-03-16 * Replace type __file with __file, __directory, __link diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 48a3e125..6b456f35 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,17 +1 @@ -Dependencies: - Record in bin/cdist-type-emulator - Fix __cdist_object_base_dir issue (vs. $__cdist_out_object_dir in deploy-to) - go through cdist-deploy-to and do a cleanup round - - --------------------------------------------------------------------------------- -done: -* Document cdist-explorer-run-global -* Document cdist-manifest-run-init -* Document cdist-manifest-run-all -cdist-run-remote -cdist-code-run-all -cdist-object-gencode - -cdist-object-gencode-all -cdist-manifest-run +Cleanup and release 1.2.0 diff --git a/doc/dev/todo/post-1.1 b/doc/dev/todo/post-1.1 index d75d050d..00e69937 100644 --- a/doc/dev/todo/post-1.1 +++ b/doc/dev/todo/post-1.1 @@ -2,12 +2,6 @@ Core: - write test case: test.sh - probably remove grep -q (solaris does not have it) -Dependencies: - - via env - - Build dependency tree - - Exit on any error - - Check return codes - Types to be written/extended: - __ssh-keys (host/user) - __service From d2b7fd052071b509eccac68548eddaf6484860f7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:11:35 +0100 Subject: [PATCH 0152/5465] prepare more stuff for 1.2 Signed-off-by: Nico Schottelius --- README | 3 ++- doc/dev/todo/{post-1.1 => post-1.2} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename doc/dev/todo/{post-1.1 => post-1.2} (100%) diff --git a/README b/README index e229614d..7be8f013 100644 --- a/README +++ b/README @@ -115,11 +115,12 @@ how to use cdist. There are at least the following branches available: * master: the development branch - * 1.1: Current stable + * 1.2: Current stable: Dependencies supported Old versions: * 1.0: First official release + * 1.1: __file to __file, __directory, __link migration Other branches may be available for features or bugfixes, but they may vanish at any point. To select a specific branch use diff --git a/doc/dev/todo/post-1.1 b/doc/dev/todo/post-1.2 similarity index 100% rename from doc/dev/todo/post-1.1 rename to doc/dev/todo/post-1.2 From cbc8a254f462c2e66c26bd1aa08137cd5f767077 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:11:47 +0100 Subject: [PATCH 0153/5465] += Signed-off-by: Nico Schottelius --- conf/type/__group/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__group/man.text b/conf/type/__group/man.text index 26b52111..c57ae337 100644 --- a/conf/type/__group/man.text +++ b/conf/type/__group/man.text @@ -1,5 +1,5 @@ cdist-type__group(7) -=================== +==================== Steven Armstrong From 43afb07598c204240e0059be27bebc6f6c91d050 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:17:49 +0100 Subject: [PATCH 0154/5465] move init to init.sample to avoid conflicts with real world Signed-off-by: Nico Schottelius --- conf/manifest/{init => init.sample} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename conf/manifest/{init => init.sample} (100%) diff --git a/conf/manifest/init b/conf/manifest/init.sample similarity index 100% rename from conf/manifest/init rename to conf/manifest/init.sample From 6fa055fcc2fce2aa81a5b73e551175ded5bc22c1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:20:59 +0100 Subject: [PATCH 0155/5465] more todo for nico, less for 1.2.0 Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 8 ++++++++ doc/dev/todo/post-1.2 | 11 ++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 6b456f35..640288a6 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1 +1,9 @@ Cleanup and release 1.2.0 + - document init.sample + - update cdist-quickstart + - ensure every file in bin/ has a correspondent manpage + - cdist-remote-code-run-all + - cdist-remote-explorer-run + - cdist-type-build-emulation + - cdist-type-emulator + diff --git a/doc/dev/todo/post-1.2 b/doc/dev/todo/post-1.2 index 00e69937..90eb1664 100644 --- a/doc/dev/todo/post-1.2 +++ b/doc/dev/todo/post-1.2 @@ -5,13 +5,11 @@ Core: Types to be written/extended: - __ssh-keys (host/user) - __service - - __user - __file_edit - regexp replace (can probably cover all?) - - cron + - __cron - __issue: add --source - Documentation: - Describe Multi master setups - use ssh with master socket? @@ -21,10 +19,5 @@ Documentation: - cdist-trigger after first run from /var/lib/cdist/out/bin? - Different environments (production, integration, development) - via version control - - Check all references in manpages, ensure all manpages exist, generic ones: - - ensure every file in bin/ has a correspondent manpage - - cdist-remote-code-run-all - - cdist-remote-explorer-run - - cdist-type-build-emulation - - cdist-type-emulator + - Check all references in manpages, ensure all manpages exist - Ensure html output of manpages are published on the web From 34389e68fc867da3f0ca66c720a0c67877b5b1d0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:27:55 +0100 Subject: [PATCH 0156/5465] add cdist logo / slogan Signed-off-by: Nico Schottelius --- doc/gfx/cdist-automated.png | Bin 0 -> 1738 bytes doc/gfx/cdist-logo.png | Bin 0 -> 1542 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/gfx/cdist-automated.png create mode 100644 doc/gfx/cdist-logo.png diff --git a/doc/gfx/cdist-automated.png b/doc/gfx/cdist-automated.png new file mode 100644 index 0000000000000000000000000000000000000000..c964004d8964285f741f8cc12f3903d16ae4629e GIT binary patch literal 1738 zcmV;*1~vJKP)Px#22e~?MF0Q*|NsA`*`M720004EOGiWihy@);00009a7bBm000XU000XU0RWnu z7ytkO2XskIMF-mh5&;-CMgGKp000I(Nkl7<&RO3Sq!!nt! z*UDmu38kc9%w|i7n@gR1g0vKRtYx2)lUN!m%Q+a6qX~=f!T1zPk0EU16uGCIdvkkn zk0GC+@4XpmHPY^84}mOg277lr`uWZKH*aRd*vIxCYc>-TVRCgt^_*}VXMGcDdG2_D z-K_J;Sj_6IW~f4ee>x;lT-hEyM3mq@ZJP zy{seS27Yj&vSLCi_ zNm64K{RZ3;>E~g0b{r?jUJBm%uxdx1SFF$Cx%1*^u%~jk&G95lqvLCuV{fU_HAjye3Teq7tkxtd?igCrB<#_fD?xgu}Cd2wjS8^z7BrS$T*1Jc2H<05yMkR*_Iu-6{QORC%+ z&1jCFuW%=?@e(|qUyoErl6T}ih{uBAuOx1T`ax^JZLblR``=zX z2>w9F%$#xRG->uGyG_$keqhJ;4^`$^Co1qQ^$C>;#LS#!^Va&X(nALdL!$;|6CO#QjsfH~ zSSGu$LV=5kvug0b1`hmCYQrxOs4Y`@McXG2NZzxx?mzj3h!~J)T>{y&I55&~vL0#LyFrTeg zbX-V9H4l2(y%BeRTO9*%a8w>BZh__8h&*7;&8D>eQi_S4(@}AQ-T$g&Qp=0j7!HEg zcsI8cA0{l*&zRS=SL}SBFtC@-2T>&tMCQNx=4YH;RriSOg~<4~D<3=$IBMajLPjI6 zl=}P)9@FOXdXOOJ!bYI31~P7uJHZ`rT%QGpM>&TFhqzbaz)S9v7%mRvKOO-G^WHDd z8_|J;He1}M!QHO9=auB`s%xabufBlu4DM>ExSqO3`Y%RtT3%mWb4fou6GUBsheYXW zt{KvqQC)+yy)GUDQ-K@7BG-2GaevFMUyVXN=&CD-J7w<-sNGHZ)-lvhI3%*Wc>h`n z(s>3hc~n=xb@le=o=-Pv3;Yxj2N8e5+RVD8tC}2exNtDu0}hLU<~j@dUdq)A0~POr z!&cbfHbzBQy)aPmX3Wnnp2F}Ya-rg0(7@*-IrYLo$D1`q%hO!MiaTS8Lp#((QL8Vr zju;&b@u7T= gwPdFMKTp$t0cm;W#H0($-~a#s07*qoM6N<$f*So(djJ3c literal 0 HcmV?d00001 diff --git a/doc/gfx/cdist-logo.png b/doc/gfx/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~+ Date: Fri, 18 Mar 2011 02:28:47 +0100 Subject: [PATCH 0157/5465] +text versions of the logo Signed-off-by: Nico Schottelius --- doc/gfx/cdist-automated.text | 15 +++++++++++++++ doc/gfx/cdist-logo.text | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 doc/gfx/cdist-automated.text create mode 100644 doc/gfx/cdist-logo.text diff --git a/doc/gfx/cdist-automated.text b/doc/gfx/cdist-automated.text new file mode 100644 index 00000000..58353099 --- /dev/null +++ b/doc/gfx/cdist-automated.text @@ -0,0 +1,15 @@ + .. . .x+=:. s + dF @88> z` ^% :8 + '88bu. %8P . z` ^% :8 + '88bu. %8P . Date: Fri, 18 Mar 2011 02:31:20 +0100 Subject: [PATCH 0158/5465] +extend title Signed-off-by: Nico Schottelius --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 7be8f013..8b4ae6b5 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -[[!meta title="cdist - configuration management"]] +[[!meta title="cdist - usable configuration management"]] .. . .x+=:. s From 581b29ca9755f7c3fd520a8e54bed96cd8d4d007 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:43:25 +0100 Subject: [PATCH 0159/5465] warn about missing manifest (i.e. abort) Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/cdist-manifest-run b/bin/cdist-manifest-run index 240d446b..8561f1f7 100755 --- a/bin/cdist-manifest-run +++ b/bin/cdist-manifest-run @@ -47,6 +47,8 @@ cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ export PATH="${__cdist_out_type_bin_dir}:$PATH" # Force -x, so the user is aware the file is executed +[ -f "${__cdist_manifest}" ] \ + || __cdist_exit_err "Missing manifest ${__cdist_manifest}" [ -x "${__cdist_manifest}" ] \ || __cdist_exit_err "${__cdist_manifest} needs to be executable." mkdir -p "${__cdist_output_dir}" \ From 99054b7d825c68a26a1b2968082f2ab69b50161c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 02:48:11 +0100 Subject: [PATCH 0160/5465] update cdist-quickstart Signed-off-by: Nico Schottelius --- bin/cdist-quickstart | 63 ++++++++++++++++++++++++++++++++++++------- doc/dev/todo/niconext | 12 ++++----- 2 files changed, 59 insertions(+), 16 deletions(-) diff --git a/bin/cdist-quickstart b/bin/cdist-quickstart index 781c1b45..4d89180c 100755 --- a/bin/cdist-quickstart +++ b/bin/cdist-quickstart @@ -69,7 +69,7 @@ that the command cdist-deploy-to is the main cdist command. See also: - Source of cdist-deploy-to, cdist-stages(7) + Source of cdist-deploy-to(1), cdist-stages(7) eof __prompt "$continue" @@ -232,17 +232,60 @@ __prompt "$continue" cat << eof -Now you've got some basic knowledge about cdist, let's configure your localhost! +Now you've got some basic knowledge about cdist, let's configure your a host! -Ensure that you have a ssh server running locally and that you can login as root. - -The cdist distribution contains some sensible default initial manifest, which -will create 2 files, /etc/cdist-configured (for every host) and -/tmp/cdist-testfile (only for localhost). +Ensure that you have a ssh server running on the host and that you can login as root. eof -cmd="cdist-deploy-to localhost" +__prompt "Enter hostname or press enter for localhost: " + +if [ "$answer" ]; then + host="$answer" +else + host="localhost" +fi + +manifestinit="conf/manifest/init" +cat << eof + +I'll know setup $manifestinit, containing the following code: + +-------------------------------------------------------------------------------- +# Every machine becomes a marker, so sysadmins know that automatic +# configurations are happening +__file /etc/cdist-configured + +case "\$__target_host" in + $host) + __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic + __addifnosuchline /tmp/cdist-welcome --line "Welcome to cdist" + ;; +esac +-------------------------------------------------------------------------------- + +WARNING: This will overwrite ${manifestinit}. + +eof + +cat > "$__cdist_abs_mydir/../$manifestinit" << eof + +# Every machine becomes a marker, so sysadmins know that automatic +# configurations are happening +__file /etc/cdist-configured + +case "\$__target_host" in + $host) + __link /tmp/cdist-testfile --source /etc/cdist-configured --type symbolic + __addifnosuchline /tmp/cdist-welcome --line "Welcome to cdist" + ;; +esac + +eof + +chmod u+x "$__cdist_abs_mydir/../$manifestinit" + +cmd="cdist-deploy-to $host" __prompt "Press enter to run \"$cmd\"" @@ -255,7 +298,9 @@ $cmd cat << eof -That's it, this is the end of the cdist-introduction. + +-------------------------------------------------------------------------------- +That's it, this is the end of the cdist-quickstart. I hope you've got some impression on how cdist works, here are again some pointers on where to continue to read: diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 640288a6..5a816f5b 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,9 +1,7 @@ Cleanup and release 1.2.0 - - document init.sample - - update cdist-quickstart - - ensure every file in bin/ has a correspondent manpage - - cdist-remote-code-run-all - - cdist-remote-explorer-run - - cdist-type-build-emulation - - cdist-type-emulator + - ensure every file in bin/ has a correspondent manpage + - cdist-remote-code-run-all + - cdist-remote-explorer-run + - cdist-type-build-emulation + - cdist-type-emulator From 3f19f924358a5e7cd65b1c6f887d162a2f31dee7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 10:17:35 +0100 Subject: [PATCH 0161/5465] remove obsolete cd call Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/cdist-manifest-run b/bin/cdist-manifest-run index 8561f1f7..96ab4169 100755 --- a/bin/cdist-manifest-run +++ b/bin/cdist-manifest-run @@ -30,9 +30,6 @@ __cdist_target_host="$1"; shift __cdist_manifest="$1"; shift __cdist_output_dir="$1"; shift -# Always start from local base -__cdist_work_dir="$__cdist_local_base_dir" - # Export information for cdist-type-emulator export __cdist_conf_dir __cdist_output_dir __cdist_manifest __cdist_version @@ -46,14 +43,13 @@ cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ # prepend our path, so all cdist tools come before other tools export PATH="${__cdist_out_type_bin_dir}:$PATH" -# Force -x, so the user is aware the file is executed +# Sanity checks [ -f "${__cdist_manifest}" ] \ || __cdist_exit_err "Missing manifest ${__cdist_manifest}" [ -x "${__cdist_manifest}" ] \ || __cdist_exit_err "${__cdist_manifest} needs to be executable." mkdir -p "${__cdist_output_dir}" \ || __cdist_exit_err "Cannot create output dir ${__cdist_output_dir}" -cd "$__cdist_work_dir" \ - || __cdist_exit_err "Cannot change to work dir \"$__cdist_work_dir\"." +# FIXME remove $@? i think this has been deprecated! __cdist_exec_fail_on_error "${__cdist_manifest}" "$@" From fdea6edcd2d3b37fb56c41b26e0a36233748aaff Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 10:32:07 +0100 Subject: [PATCH 0162/5465] cleaupn cdist-manifest-run and in theory fix output problem Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/bin/cdist-manifest-run b/bin/cdist-manifest-run index 96ab4169..23c6792a 100755 --- a/bin/cdist-manifest-run +++ b/bin/cdist-manifest-run @@ -23,18 +23,32 @@ # . cdist-config -[ $# -eq 3 ] || __cdist_usage " " +[ $# -eq 3 ] || __cdist_usage " " set -u __cdist_target_host="$1"; shift __cdist_manifest="$1"; shift -__cdist_output_dir="$1"; shift -# Export information for cdist-type-emulator -export __cdist_conf_dir __cdist_output_dir __cdist_manifest __cdist_version +################################################################################ +# Export information for cdist-type-emulator or manifest +# + +# This is a special variable, as being used by __cdist_object_dir +# We need to adjust it, so cdist-type-emulator writes to the right location +export __cdist_out_object_dir="$1"; shift + +# Config dir should not get reset - FIXME: why did I do this? +export __cdist_conf_dir + +# Used to record the source in the object +export __cdist_manifest # Export information for manifests -export __global="$__cdist_out_dir" +export __global="$__cdist_out_object_dir" + +################################################################################ +# The actual run +# # Ensure binaries exist and are up-to-date cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ @@ -48,8 +62,7 @@ export PATH="${__cdist_out_type_bin_dir}:$PATH" || __cdist_exit_err "Missing manifest ${__cdist_manifest}" [ -x "${__cdist_manifest}" ] \ || __cdist_exit_err "${__cdist_manifest} needs to be executable." -mkdir -p "${__cdist_output_dir}" \ - || __cdist_exit_err "Cannot create output dir ${__cdist_output_dir}" +mkdir -p "${__cdist_out_object_dir}" \ + || __cdist_exit_err "Cannot create output dir ${__cdist_out_object_dir}" -# FIXME remove $@? i think this has been deprecated! -__cdist_exec_fail_on_error "${__cdist_manifest}" "$@" +__cdist_exec_fail_on_error "${__cdist_manifest}" From e39a810685b8ecdd8caea5e99eee79fd9e66cba2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 10:32:19 +0100 Subject: [PATCH 0163/5465] less todo for 1.2 for nico Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 2 -- doc/dev/todo/post-1.2 | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 5a816f5b..f6b8809a 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,7 +1,5 @@ Cleanup and release 1.2.0 - - ensure every file in bin/ has a correspondent manpage - cdist-remote-code-run-all - cdist-remote-explorer-run - cdist-type-build-emulation - cdist-type-emulator - diff --git a/doc/dev/todo/post-1.2 b/doc/dev/todo/post-1.2 index 90eb1664..c5b85d8b 100644 --- a/doc/dev/todo/post-1.2 +++ b/doc/dev/todo/post-1.2 @@ -21,3 +21,4 @@ Documentation: - via version control - Check all references in manpages, ensure all manpages exist - Ensure html output of manpages are published on the web + - ensure every file in bin/ has a correspondent manpage From 35a6eefc00882e9aa7e94098a0879bdbe6c5751d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 10:35:53 +0100 Subject: [PATCH 0164/5465] __global is not where it seems to be :-) Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-manifest-run b/bin/cdist-manifest-run index 23c6792a..892f27cf 100755 --- a/bin/cdist-manifest-run +++ b/bin/cdist-manifest-run @@ -43,8 +43,8 @@ export __cdist_conf_dir # Used to record the source in the object export __cdist_manifest -# Export information for manifests -export __global="$__cdist_out_object_dir" +# Export information for manifests - __cdist_out_dir comes from cdist-config +export __global="$__cdist_out_dir" ################################################################################ # The actual run From 68adb9453a259dedd3abe61d3d1aa1cd5bef983d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 10:40:31 +0100 Subject: [PATCH 0165/5465] make the user aware of the copy process (waiting and nothing happens stinks) Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index d464c523..551575c3 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -43,7 +43,7 @@ echo "cdist $__cdist_version: Configuring $__cdist_target_host" __cdist_init_deploy "$__cdist_target_host" # Transfer cdist executables -echo "Transferring cdist binaries ..." +echo "Transferring cdist binaries to $__cdist_target_host ..." cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" cdist-explorer-run-global "$__cdist_target_host" @@ -52,6 +52,7 @@ cdist-manifest-run-all "$__cdist_target_host" cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" +echo "Transferring created objects to $__cdist_target_host ..." cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ "${__cdist_remote_out_object_base_dir}" From 793d8b379d91dfa679b1e4f78246521f13f667bc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 10:43:13 +0100 Subject: [PATCH 0166/5465] remove config.guess: not really needed Signed-off-by: Nico Schottelius --- doc/dev/config.guess | 1354 ------------------------------------------ 1 file changed, 1354 deletions(-) delete mode 100644 doc/dev/config.guess diff --git a/doc/dev/config.guess b/doc/dev/config.guess deleted file mode 100644 index fd30ab03..00000000 --- a/doc/dev/config.guess +++ /dev/null @@ -1,1354 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. - -timestamp='2002-07-23' - -# This file 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 2 of the License, or -# (at your option) any later version. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# This shell variable is my proudest work .. or something. --bje - -set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; -(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) - || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; -dummy=$tmpdir/dummy ; -files="$dummy.c $dummy.o $dummy.rel $dummy" ; -trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - rm -f $files ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; -unset files' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - eval $set_cc_for_build - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - 3-1307) - UNAME_MACHINE="alphaev7" - ;; - esac - fi - rm -f $dummy.s $dummy && rmdir $tmpdir - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy && rmdir $tmpdir - fi ;; - esac - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 - rm -f $dummy.c $dummy && rmdir $tmpdir - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c && rmdir $tmpdir - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c && rmdir $tmpdir - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c && rmdir $tmpdir - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 -rm -f $dummy.c $dummy && rmdir $tmpdir - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: From f48b67ecd63c3a24596d71c435529a378c932df1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 10:44:21 +0100 Subject: [PATCH 0167/5465] more changes for 1.2.0 Signed-off-by: Nico Schottelius --- doc/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog b/doc/changelog index 1d5ca3f8..0aedec10 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,8 @@ 1.2.0: * Added dependencies * New type __removeline (Daniel Roth) + * New type __group (Steven Armstrong) + * New type __user (Steven Armstrong) * Document cdist-run-remote * Document cdist-code-run-all * Document cdist-object-gencode From e0304fad37c415b35bde122d0061d643c314a8fa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 18 Mar 2011 21:08:18 +0100 Subject: [PATCH 0168/5465] hint on dependencies Signed-off-by: Nico Schottelius --- doc/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index 0aedec10..32d5ac63 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,5 @@ 1.2.0: - * Added dependencies + * Added dependencies (see cdist-type(7)) * New type __removeline (Daniel Roth) * New type __group (Steven Armstrong) * New type __user (Steven Armstrong) From cef58ae85f2cc5fba439e8d65942bab05a687fe7 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 18 Mar 2011 23:37:10 +0100 Subject: [PATCH 0169/5465] handle numeric group id as well as group name for consistency with usermod|groupmod Signed-off-by: Steven Armstrong --- conf/type/__user/explorer/group | 28 ++++++++++++++++++++++++++++ conf/type/__user/gencode | 22 +++++++++++++++++----- 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100755 conf/type/__user/explorer/group diff --git a/conf/type/__user/explorer/group b/conf/type/__user/explorer/group new file mode 100755 index 00000000..9defba14 --- /dev/null +++ b/conf/type/__user/explorer/group @@ -0,0 +1,28 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Get an existing groups group entry. +# + +if [ -f "$__object/parameter/gid" ]; then + gid=$(cat "$__object/parameter/gid") + getent group "$gid" || true +fi + diff --git a/conf/type/__user/gencode b/conf/type/__user/gencode index 5990ac92..c53d8c40 100755 --- a/conf/type/__user/gencode +++ b/conf/type/__user/gencode @@ -35,27 +35,39 @@ fi get_current_value() { local key="$1" + local new_value="$2" + + local explorer="$__object/explorer/passwd" local index case "$key" in password) - cut -d':' -f 2 "$__object/explorer/shadow" - break + explorer="$__object/explorer/shadow" + index=2 ;; uid) index=3;; - gid) index=4;; + gid) + if [[ $new_value =~ ^[0-9]+$ ]]; then + # numeric gid + index=4 + else + # group name + explorer="$__object/explorer/group" + index=1 + fi + ;; comment) index=5;; home) index=6;; shell) index=7;; esac - cut -d':' -f $index "$__object/explorer/passwd" + cut -d':' -f $index "$explorer" } set -- "$@" cd "$__object/parameter" for property in $(ls .); do - current_value=$(get_current_value "$property") new_value="$(cat "$property")" + current_value=$(get_current_value "$property" "$new_value") if [ "$new_value" != "$current_value" ]; then # Shedule changed properties for update set -- "$@" "--$property" \"$new_value\" From 5985fafe86d334f158c0f6c093f53fd58a4c6546 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 02:17:17 +0100 Subject: [PATCH 0170/5465] move whole object Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index a111627f..4f468e2e 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -93,11 +93,8 @@ while [ "$__cdist_new_objects_created" = "y" ]; do # Source of the new object __cdist_new_object_dir="${__cdist_new_objects_dir}/$__cdist_new_object" - mkdir -p "$__cdist_object_dir" - - # Move parameters and source information - mv "${__cdist_new_object_dir}/"* "$__cdist_object_dir" - mv "${__cdist_new_object_dir}/${__cdist_name_object_source}" "$__cdist_object_dir" + # Move object, not only parts + mv "${__cdist_new_object_dir}/" "$__cdist_object_dir" done < "$__cdist_new_objects_list" # Remove listing and objects, otherwise the next type will reuse it... From 30a3514dfe78a377bc9903565a3ca9fd7c51ab91 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 02:23:09 +0100 Subject: [PATCH 0171/5465] create top level hierarchy on mv and move to object to one dir higher Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 4f468e2e..501da620 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -93,8 +93,11 @@ while [ "$__cdist_new_objects_created" = "y" ]; do # Source of the new object __cdist_new_object_dir="${__cdist_new_objects_dir}/$__cdist_new_object" + # Create top directory + __cdist_new_object_top_dir=${__cdist_new_object_dir%/*} + # Move object, not only parts - mv "${__cdist_new_object_dir}/" "$__cdist_object_dir" + mv "${__cdist_new_object_dir}/" "$__cdist_object_top_dir" done < "$__cdist_new_objects_list" # Remove listing and objects, otherwise the next type will reuse it... From 25664d26e955f5aa77d5bab9ea1404f99171812e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 02:24:22 +0100 Subject: [PATCH 0172/5465] +new Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 501da620..059d829f 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -97,7 +97,7 @@ while [ "$__cdist_new_objects_created" = "y" ]; do __cdist_new_object_top_dir=${__cdist_new_object_dir%/*} # Move object, not only parts - mv "${__cdist_new_object_dir}/" "$__cdist_object_top_dir" + mv "${__cdist_new_object_dir}/" "$__cdist_new_object_top_dir" done < "$__cdist_new_objects_list" # Remove listing and objects, otherwise the next type will reuse it... From 3d0cdfb7c3163bacd215946f1de38672c1e28dec Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 02:26:52 +0100 Subject: [PATCH 0173/5465] move to correct top dir, not to itself Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 059d829f..89ec0668 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -90,14 +90,15 @@ while [ "$__cdist_new_objects_created" = "y" ]; do # where to save the newly created object __cdist_object_dir="$__cdist_out_object_dir/$__cdist_new_object" + # Create top directory + __cdist_object_top_dir=${__cdist_object_dir%/*} + mkdir -p "$__cdist_object_top_dir" + # Source of the new object __cdist_new_object_dir="${__cdist_new_objects_dir}/$__cdist_new_object" - # Create top directory - __cdist_new_object_top_dir=${__cdist_new_object_dir%/*} - # Move object, not only parts - mv "${__cdist_new_object_dir}/" "$__cdist_new_object_top_dir" + mv "${__cdist_new_object_dir}/" "$__cdist_object_top_dir" done < "$__cdist_new_objects_list" # Remove listing and objects, otherwise the next type will reuse it... From 7525e82ce4524965f43b11a777627c1bcf40e0dc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 02:52:42 +0100 Subject: [PATCH 0174/5465] clearify what to move Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 89ec0668..050e4850 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -89,16 +89,26 @@ while [ "$__cdist_new_objects_created" = "y" ]; do # where to save the newly created object __cdist_object_dir="$__cdist_out_object_dir/$__cdist_new_object" + mkdir -p "$__cdist_object_dir" - # Create top directory - __cdist_object_top_dir=${__cdist_object_dir%/*} - mkdir -p "$__cdist_object_top_dir" + # Move parts of the object (CANNOT MOVE COMPLETLEY, HIERACHY!) + __cdist_new_object_dir="$__cdist_new_objects_dir/$__cdist_new_object" - # Source of the new object - __cdist_new_object_dir="${__cdist_new_objects_dir}/$__cdist_new_object" + # Source + mv "${__cdist_new_object_dir}/${__cdist_name_object_source}" \ + "$__cdist_object_dir" - # Move object, not only parts - mv "${__cdist_new_object_dir}/" "$__cdist_object_top_dir" + # Parameter + if [ -d "${__cdist_new_object_dir}/${__cdist_name_parameter}" ]; then + mv "${__cdist_new_object_dir}/${__cdist_name_parameter}" \ + "$__cdist_object_dir" + fi + + # Explorer + if [ -d "${__cdist_new_object_dir}/${__cdist_name_explorer}" ]; then + mv "${__cdist_new_object_dir}/${__cdist_name_explorer}" \ + "$__cdist_object_dir" + fi done < "$__cdist_new_objects_list" # Remove listing and objects, otherwise the next type will reuse it... From d4f07749d674539cc90dc0c587fd5343c64dfe45 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 03:00:46 +0100 Subject: [PATCH 0175/5465] postpone some stuff after 1.2 Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 4 ---- doc/dev/todo/post-1.2 | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index f6b8809a..6b456f35 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,5 +1 @@ Cleanup and release 1.2.0 - - cdist-remote-code-run-all - - cdist-remote-explorer-run - - cdist-type-build-emulation - - cdist-type-emulator diff --git a/doc/dev/todo/post-1.2 b/doc/dev/todo/post-1.2 index c5b85d8b..fef6c91e 100644 --- a/doc/dev/todo/post-1.2 +++ b/doc/dev/todo/post-1.2 @@ -22,3 +22,9 @@ Documentation: - Check all references in manpages, ensure all manpages exist - Ensure html output of manpages are published on the web - ensure every file in bin/ has a correspondent manpage + + - cdist-remote-code-run-all + - cdist-remote-explorer-run + - cdist-type-build-emulation + - cdist-type-emulator + From 8d4d5a5c15ece6133ef5384e6556d64480012acf Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 03:05:22 +0100 Subject: [PATCH 0176/5465] switch to cdist 1.2.0 Signed-off-by: Nico Schottelius --- README | 6 +++++- bin/cdist-config | 2 +- doc/changelog | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README b/README index 8b4ae6b5..cadb3e30 100644 --- a/README +++ b/README @@ -129,7 +129,7 @@ may vanish at any point. To select a specific branch use git checkout -b origin/ # Stay on version 1.1 - git checkout -b 1.1 origin/1.1 + git checkout -b 1.2 origin/1.2 ### Mirrors @@ -150,6 +150,10 @@ 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. +### Upgrading from 1.1 to 1.2 + +No incompatiblities. + ### Upgrading from 1.0 to 1.1 In 1.1 the type **\_\_file** was split into **\_\_directory**, **\_\_file** and diff --git a/bin/cdist-config b/bin/cdist-config index 56c49772..ac94efa7 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.1.0" +__cdist_version="1.2.0" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index 32d5ac63..9b664c0b 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.2.0: +1.2.0: 2011-03-19 * Added dependencies (see cdist-type(7)) * New type __removeline (Daniel Roth) * New type __group (Steven Armstrong) From cba3297587a953c1fcb58c3b172e5d68619b7861 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 13:08:03 +0100 Subject: [PATCH 0177/5465] add nexttodo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 6b456f35..2a9df706 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1 +1,6 @@ -Cleanup and release 1.2.0 +Dependency problem: + +Generating code for __file/home/lyni/dos/scorch15/SCORCH.DOC ... +scp: /home/lyni/dos/scorch15/SCORCH.DOC: No such file or directory + +-> explorea cop file t a directory that does not yet exist! From da5e7e52bb8e204469128d437dda665ba4daabff Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 13:25:15 +0100 Subject: [PATCH 0178/5465] and a solution for todo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 2a9df706..f00f6088 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -3,4 +3,21 @@ Dependency problem: Generating code for __file/home/lyni/dos/scorch15/SCORCH.DOC ... scp: /home/lyni/dos/scorch15/SCORCH.DOC: No such file or directory --> explorea cop file t a directory that does not yet exist! +-> Err, gencode does the wrong thing here. + +Gencode is also not very clean, doing stuff that should probably +done later. + +Maybe differentiate between local|remote execution? + -> does not help either if different run + + -> keep dependencies in execute, have local and remote exec? + +-------------------------------------------------------------------------------- +Possible solution: + + - remove gencode + - replace with gen_localcode and gen_remotecode + - run both in the execution stage of the object + + From ea2cbb176a8a56230df9a3847825da06f2a0c6fa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 14:50:11 +0100 Subject: [PATCH 0179/5465] fix generation of manpage for cdist-type__removeline Signed-off-by: Nico Schottelius --- conf/type/__removeline/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__removeline/man.text b/conf/type/__removeline/man.text index 5cf7791f..dba8b625 100644 --- a/conf/type/__removeline/man.text +++ b/conf/type/__removeline/man.text @@ -1,5 +1,5 @@ cdist-type__removeline(7) -============================== +========================= Daniel Roth From 88e20abddbbe966475a9f9d754bd99e810df8812 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 15:11:03 +0100 Subject: [PATCH 0180/5465] remove obsolete call to $@ in bin/cdist-remote-explorer-run Signed-off-by: Nico Schottelius --- bin/cdist-remote-explorer-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-remote-explorer-run b/bin/cdist-remote-explorer-run index 0dae3007..1fdd1467 100755 --- a/bin/cdist-remote-explorer-run +++ b/bin/cdist-remote-explorer-run @@ -62,7 +62,7 @@ for explorer in "$__cdist_explorer_dir/"*; do fi # Execute explorers and save results in remote destination directory - "$explorer" "$@" > "${__cdist_my_out_dir}/$explorer_name" + "$explorer" > "${__cdist_my_out_dir}/$explorer_name" else if [ -e "$explorer" ]; then echo "Explorer \"$explorer\" exists, but is not a file." From c77a6c5901798350500105d73b910ef8a8f65f88 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 15:14:45 +0100 Subject: [PATCH 0181/5465] add changes for 1.2.1 Signed-off-by: Nico Schottelius --- doc/changelog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/changelog b/doc/changelog index 9b664c0b..c5a32b1f 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,8 @@ +1.2.1: + * Bugfix: Remove obsolete $@ call in cdist-remote-explorer-run + * Bugfix: Correct manpage for __removeline (broke manpage generation) + + 1.2.0: 2011-03-19 * Added dependencies (see cdist-type(7)) * New type __removeline (Daniel Roth) From 1af34c74b8bc1be01d64731c13be2dbf8efb6af1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 22:15:54 +0100 Subject: [PATCH 0182/5465] begin to differentiate local and remote object code generation Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 ++ bin/cdist-object-gencode | 3 ++- bin/cdist-object-gencode-all | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index ac94efa7..45792200 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -46,6 +46,8 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_conf_dir:=conf} : ${__cdist_name_explorer:=explorer} : ${__cdist_name_gencode:=gencode} +: ${__cdist_name_gencode_local:=$__cdist_name_gencode-local} +: ${__cdist_name_gencode_remote:=$__cdist_name_gencode-remote} : ${__cdist_name_global:=global} : ${__cdist_name_host:=host} : ${__cdist_name_init:=init} diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index aea1da07..61f85a4d 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -23,11 +23,12 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage "" "" +[ $# -eq 2 ] || __cdist_usage "" "" "" set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift +__cdist_gencode_type="$1"; shift __cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" __cdist_type="$(__cdist_type_from_object "$__cdist_object")" diff --git a/bin/cdist-object-gencode-all b/bin/cdist-object-gencode-all index 90090c8a..3edfe4cc 100755 --- a/bin/cdist-object-gencode-all +++ b/bin/cdist-object-gencode-all @@ -31,7 +31,7 @@ __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" while read object; do code="$(__cdist_object_code "$object")" - echo "Generating code for $object ..." + echo "Generating local code for $object ..." cdist-object-gencode "$__cdist_target_host" "$object" > "${code}" From c5590cb648f60aa8c182267d741c12e43687b7f4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 22:19:44 +0100 Subject: [PATCH 0183/5465] extend cdist-object-gencode* to include remote/local extension Signed-off-by: Nico Schottelius --- bin/cdist-config | 4 ++-- bin/cdist-object-gencode | 2 +- bin/cdist-object-gencode-all | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 45792200..d200e275 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -46,8 +46,8 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_conf_dir:=conf} : ${__cdist_name_explorer:=explorer} : ${__cdist_name_gencode:=gencode} -: ${__cdist_name_gencode_local:=$__cdist_name_gencode-local} -: ${__cdist_name_gencode_remote:=$__cdist_name_gencode-remote} +: ${__cdist_name_gencode_local:=local} +: ${__cdist_name_gencode_remote:=remote} : ${__cdist_name_global:=global} : ${__cdist_name_host:=host} : ${__cdist_name_init:=init} diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index 61f85a4d..7190779d 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -35,7 +35,7 @@ __cdist_type="$(__cdist_type_from_object "$__cdist_object")" __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" # Full path to where the executable of the type should exist, if the type has one -gencode="$(__cdist_type_gencode "$__cdist_type")" +gencode="$(__cdist_type_gencode "$__cdist_type")-${__cdist_gencode_type}" # export variables for gencode export __object_id="$__cdist_object_id" diff --git a/bin/cdist-object-gencode-all b/bin/cdist-object-gencode-all index 3edfe4cc..336ba263 100755 --- a/bin/cdist-object-gencode-all +++ b/bin/cdist-object-gencode-all @@ -31,9 +31,14 @@ __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" while read object; do code="$(__cdist_object_code "$object")" - echo "Generating local code for $object ..." - cdist-object-gencode "$__cdist_target_host" "$object" > "${code}" + echo "Generating local code for $object ..." + cdist-object-gencode "$__cdist_target_host" "$object" \ + "${__cdist_name_gencode_local}" > "${code}" + + echo "Generating remote code for $object ..." + cdist-object-gencode "$__cdist_target_host" "$object" \ + "${__cdist_name_gencode_remote}" > "${code}" chmod u+x "${code}" done < "$__cdist_tmp_file" From c086e7fcc1b5eceaccfd163a12a9570e67e9572c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 22:26:00 +0100 Subject: [PATCH 0184/5465] adjust argument usage in bin/cdist-object-gencode Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index 7190779d..7b8f01b3 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -23,7 +23,7 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage "" "" "" +[ $# -eq 3 ] || __cdist_usage "" "" "" set -eu __cdist_target_host="$1"; shift From 4368e00c57220f3489bac9a68f47da80c8279c96 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 22:33:18 +0100 Subject: [PATCH 0185/5465] save generated code in its own file Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode-all | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/cdist-object-gencode-all b/bin/cdist-object-gencode-all index 336ba263..00ac1664 100755 --- a/bin/cdist-object-gencode-all +++ b/bin/cdist-object-gencode-all @@ -30,15 +30,16 @@ __cdist_target_host="$1"; shift __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" while read object; do - code="$(__cdist_object_code "$object")" + code_local="$(__cdist_object_code "$object")-${__cdist_name_gencode_local}" + code_remote="$(__cdist_object_code "$object")-${__cdist_name_gencode_remote}" echo "Generating local code for $object ..." cdist-object-gencode "$__cdist_target_host" "$object" \ - "${__cdist_name_gencode_local}" > "${code}" + "${__cdist_name_gencode_local}" > "${code_local}" echo "Generating remote code for $object ..." cdist-object-gencode "$__cdist_target_host" "$object" \ - "${__cdist_name_gencode_remote}" > "${code}" + "${__cdist_name_gencode_remote}" > "${code_remote}" - chmod u+x "${code}" + chmod u+x "${code_local}" "${code_remote}" done < "$__cdist_tmp_file" From 3eed0f97cee5827c5af86516b07c26addac8ec74 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 22:38:36 +0100 Subject: [PATCH 0186/5465] begin to migrate __file to new local/remote scheme Signed-off-by: Nico Schottelius --- conf/type/__file/{gencode => gencode-remote} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename conf/type/__file/{gencode => gencode-remote} (100%) diff --git a/conf/type/__file/gencode b/conf/type/__file/gencode-remote similarity index 100% rename from conf/type/__file/gencode rename to conf/type/__file/gencode-remote From 6f79f01206117acf1010806c3601e5cd1109fd45 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:01:35 +0100 Subject: [PATCH 0187/5465] cdist-remote-code-run is now also locally used: name it cdist-code-run Signed-off-by: Nico Schottelius --- bin/{cdist-remote-code-run => cdist-code-run} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bin/{cdist-remote-code-run => cdist-code-run} (100%) diff --git a/bin/cdist-remote-code-run b/bin/cdist-code-run similarity index 100% rename from bin/cdist-remote-code-run rename to bin/cdist-code-run From 1785f5acd07388a1e04e6846e3bcb4b3826cd924 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:12:49 +0100 Subject: [PATCH 0188/5465] add local/remote code run capability Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 009c0743..42b4901d 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -22,30 +22,30 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 3 ] || __cdist_usage " " set -ue # This variable MUST be exactly like this - see __cdist_object_dir __cdist_out_object_dir="$1"; shift object="$1"; shift +__cdist_gencode_type="$1"; shift if [ ! -d "$(__cdist_object_dir "$object")" ]; then __cdist_exit_err "Object $object is missing." fi - finished="$(__cdist_object_code_finished "$object")" -code="$(__cdist_object_code "$object")" require="$(__cdist_object_require "$object")" +code="$(__cdist_object_code "$object")-${__cdist_gencode_type}" # Do nothing if our work has been done if [ -f "$finished" ]; then exit 0 fi -echo "Checking code for $object ..." +echo "Checking code-${__cdist_gencode_type} for $object ..." if [ -f "$require" ]; then while read requirement; do @@ -57,7 +57,7 @@ fi if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then - echo "Executing code for $object ..." + echo "Executing code-${__cdist_gencode_type} for $object ..." "$code" touch "$finished" else From 8b43913366fcba329915c27e29a02bf8e89fff05 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:14:48 +0100 Subject: [PATCH 0189/5465] include local+remote run in bin/cdist-code-run-all Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index 27935ee3..f435006f 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -18,7 +18,7 @@ # along with cdist. If not, see . # # -# Exec code on the remote side +# Exec code locally and remote # . cdist-config @@ -27,5 +27,21 @@ set -e __cdist_target_host="$1"; shift +__cdist_out_object_dir="$1"; shift + +__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" + +while read object; do + # Code local + cdist-code-run "$__cdist_out_object_dir" "$object" "${__cdist_name_gencode_local}" + + # Code remote + cdist-run-remote "$__cdist_target_host" "cdist-code-run" \ + "${__cdist_remote_out_object_base_dir}" "${__cdist_name_gencode_remote}" +done < "$__cdist_tmp_file" + +exit 0 + +# OLD: cdist-run-remote "$__cdist_target_host" \ "cdist-remote-code-run-all" "${__cdist_remote_out_object_base_dir}" From 1099c55c9a10251da76156bb2234c444d47d95ab Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:14:58 +0100 Subject: [PATCH 0190/5465] args==3 Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index 7b8f01b3..1ba1116b 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -23,7 +23,7 @@ # . cdist-config -[ $# -eq 3 ] || __cdist_usage "" "" "" +[ $# -eq 3 ] || __cdist_usage "" "" "" set -eu __cdist_target_host="$1"; shift From 418c3db23e95b4b12b8a37154f8292d78a9a35a2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:15:55 +0100 Subject: [PATCH 0191/5465] remove almost obsolete bin/cdist-remote-code-run-all Signed-off-by: Nico Schottelius --- bin/cdist-remote-code-run-all | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100755 bin/cdist-remote-code-run-all diff --git a/bin/cdist-remote-code-run-all b/bin/cdist-remote-code-run-all deleted file mode 100755 index 1f051258..00000000 --- a/bin/cdist-remote-code-run-all +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# This binary is executed on the remote side to execute code -# - -. cdist-config -[ $# -eq 1 ] || __cdist_usage "" -set -ue - -# Warning: Variable is special, as interpreted by __cdist_object_dir() -__cdist_out_object_dir="$1"; shift - -__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" - -while read object; do - cdist-remote-code-run "$__cdist_out_object_dir" "$object" -done < "$__cdist_tmp_file" From 20e4e73bcd8f7535a176d9067057ec611a97976a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:17:40 +0100 Subject: [PATCH 0192/5465] fixup cdist-code-run-all and remove obsolete code Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index f435006f..070d0e71 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -27,8 +27,6 @@ set -e __cdist_target_host="$1"; shift -__cdist_out_object_dir="$1"; shift - __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" while read object; do @@ -37,11 +35,6 @@ while read object; do # Code remote cdist-run-remote "$__cdist_target_host" "cdist-code-run" \ - "${__cdist_remote_out_object_base_dir}" "${__cdist_name_gencode_remote}" + "${__cdist_remote_out_object_base_dir}" "$object" \ + "${__cdist_name_gencode_remote}" done < "$__cdist_tmp_file" - -exit 0 - -# OLD: -cdist-run-remote "$__cdist_target_host" \ - "cdist-remote-code-run-all" "${__cdist_remote_out_object_base_dir}" From a761a035fe771d5b72d8f9c299eaaf670f762479 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:26:41 +0100 Subject: [PATCH 0193/5465] update __file with gencode-local and gencode-remote Signed-off-by: Nico Schottelius --- conf/type/__file/gencode-local | 44 +++++++++++++++++++++++++++++++++ conf/type/__file/gencode-remote | 22 ++--------------- 2 files changed, 46 insertions(+), 20 deletions(-) create mode 100755 conf/type/__file/gencode-local diff --git a/conf/type/__file/gencode-local b/conf/type/__file/gencode-local new file mode 100755 index 00000000..1168919e --- /dev/null +++ b/conf/type/__file/gencode-local @@ -0,0 +1,44 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# __file is a very basic type, which will probably be reused quite often +# + +destination="/$__object_id" + +if [ -f "$__object/parameter/source" ]; then + source="$(cat "$__object/parameter/source")" + + if [ -f "$source" ]; then + local_cksum="$(cksum < "$source")" + remote_cksum="$(cat "$__object/explorer/cksum")" + + if [ "$local_cksum" != "$remote_cksum" ]; then + # FIXME: The username is ugly and hardcoded, replace after 1.0! + # Probably a better aproach is to have the user configured + # ~/.ssh/config to contain the right username + # Probably describe it in cdist-quickstart... + echo scp "$source" "root@${__target_host}:${destination}" + fi + else + echo "Source \"$source\" does not exist." >&2 + exit 1 + fi +fi diff --git a/conf/type/__file/gencode-remote b/conf/type/__file/gencode-remote index ef8c5501..7c5cf7ce 100755 --- a/conf/type/__file/gencode-remote +++ b/conf/type/__file/gencode-remote @@ -23,31 +23,13 @@ destination="/$__object_id" -if [ -f "$__object/parameter/source" ]; then - source="$(cat "$__object/parameter/source")" - - if [ -f "$source" ]; then - local_cksum="$(cksum < "$source")" - remote_cksum="$(cat "$__object/explorer/cksum")" - - if [ "$local_cksum" != "$remote_cksum" ]; then - # FIXME: The username is ugly and hardcoded, replace after 1.0! - # Probably a better aproach is to have the user configured - # ~/.ssh/config to contain the right username - # Probably describe it in cdist-quickstart... - scp "$source" "root@${__target_host}:${destination}" - fi - else - echo "Source \"$source\" does not exist." >&2 - exit 1 - fi -else +# No source? Create empty file +if [ ! -f "$__object/parameter/source" ]; then if [ no = "$(cat "$__object/explorer/exists")" ]; then echo touch \"$destination\" fi fi - # Mode settings if [ -f "$__object/parameter/mode" ]; then echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" From e57ec326230fd1183fd7a733697330f9dce11f50 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:31:51 +0100 Subject: [PATCH 0194/5465] ++todo > 1.2 Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.2 | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/dev/todo/post-1.2 b/doc/dev/todo/post-1.2 index fef6c91e..eccf78c3 100644 --- a/doc/dev/todo/post-1.2 +++ b/doc/dev/todo/post-1.2 @@ -1,6 +1,7 @@ Core: - write test case: test.sh - probably remove grep -q (solaris does not have it) + - export remote user name -> $__user Types to be written/extended: - __ssh-keys (host/user) From 5472e06cbe485be163faa86299910bd37b16bb21 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:36:58 +0100 Subject: [PATCH 0195/5465] [DOC] add references to gencode-local and gencode-remote Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 5 ++++- doc/man/cdist-type.text | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index f900e35e..8fdd831c 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -89,7 +89,10 @@ conf/type//man.text:: conf/type//manifest:: Used to generate additional objects from a type. -conf/type//gencode:: +conf/type//gencode-local:: + Used to generate code to be executed on the server. + +conf/type//gencode-remote:: Used to generate code to be executed on the client. conf/type//parameters/required:: diff --git a/doc/man/cdist-type.text b/doc/man/cdist-type.text index f8811a16..8d1b9ae4 100644 --- a/doc/man/cdist-type.text +++ b/doc/man/cdist-type.text @@ -155,6 +155,10 @@ fi WRITING THE GENCODE SCRIPT -------------------------- +There are two gencode scripts: gencode-local and gencode-remote. +The output of gencode-local is executed locally, whereas +the output of gencode-remote is executed on the target. + The gencode script can make use of the parameters, the global explorers and the type specific explorers. The output (stdout) of this script is saved by cdist and will be executed on the target. From c6012987604361bf2f4012728e4604f96717e1ef Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:39:01 +0100 Subject: [PATCH 0196/5465] gencode -> gencode-remote in types Signed-off-by: Nico Schottelius --- conf/type/__addifnosuchline/{gencode => gencode-remote} | 0 conf/type/__directory/{gencode => gencode-remote} | 0 conf/type/__group/{gencode => gencode-remote} | 0 conf/type/__link/{gencode => gencode-remote} | 0 conf/type/__package_apt/{gencode => gencode-remote} | 0 conf/type/__package_pacman/{gencode => gencode-remote} | 0 conf/type/__removeline/{gencode => gencode-remote} | 0 conf/type/__user/{gencode => gencode-remote} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename conf/type/__addifnosuchline/{gencode => gencode-remote} (100%) rename conf/type/__directory/{gencode => gencode-remote} (100%) rename conf/type/__group/{gencode => gencode-remote} (100%) rename conf/type/__link/{gencode => gencode-remote} (100%) rename conf/type/__package_apt/{gencode => gencode-remote} (100%) rename conf/type/__package_pacman/{gencode => gencode-remote} (100%) rename conf/type/__removeline/{gencode => gencode-remote} (100%) rename conf/type/__user/{gencode => gencode-remote} (100%) diff --git a/conf/type/__addifnosuchline/gencode b/conf/type/__addifnosuchline/gencode-remote similarity index 100% rename from conf/type/__addifnosuchline/gencode rename to conf/type/__addifnosuchline/gencode-remote diff --git a/conf/type/__directory/gencode b/conf/type/__directory/gencode-remote similarity index 100% rename from conf/type/__directory/gencode rename to conf/type/__directory/gencode-remote diff --git a/conf/type/__group/gencode b/conf/type/__group/gencode-remote similarity index 100% rename from conf/type/__group/gencode rename to conf/type/__group/gencode-remote diff --git a/conf/type/__link/gencode b/conf/type/__link/gencode-remote similarity index 100% rename from conf/type/__link/gencode rename to conf/type/__link/gencode-remote diff --git a/conf/type/__package_apt/gencode b/conf/type/__package_apt/gencode-remote similarity index 100% rename from conf/type/__package_apt/gencode rename to conf/type/__package_apt/gencode-remote diff --git a/conf/type/__package_pacman/gencode b/conf/type/__package_pacman/gencode-remote similarity index 100% rename from conf/type/__package_pacman/gencode rename to conf/type/__package_pacman/gencode-remote diff --git a/conf/type/__removeline/gencode b/conf/type/__removeline/gencode-remote similarity index 100% rename from conf/type/__removeline/gencode rename to conf/type/__removeline/gencode-remote diff --git a/conf/type/__user/gencode b/conf/type/__user/gencode-remote similarity index 100% rename from conf/type/__user/gencode rename to conf/type/__user/gencode-remote From 27fca7613d4e0e16f852401e923bb7a0d80ea799 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:43:11 +0100 Subject: [PATCH 0197/5465] document changes for 1.3.0 Signed-off-by: Nico Schottelius --- doc/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index c5a32b1f..a0a65428 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,5 @@ -1.2.1: +1.3.0: + * Add support for local and remote code generation and execution * Bugfix: Remove obsolete $@ call in cdist-remote-explorer-run * Bugfix: Correct manpage for __removeline (broke manpage generation) From c87ecbe23f3d72fd086b53d5f31b65e39b7509b5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:44:25 +0100 Subject: [PATCH 0198/5465] update comment for __link Signed-off-by: Nico Schottelius --- conf/type/__link/gencode-remote | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/type/__link/gencode-remote b/conf/type/__link/gencode-remote index 2e13755c..07da987c 100755 --- a/conf/type/__link/gencode-remote +++ b/conf/type/__link/gencode-remote @@ -18,8 +18,7 @@ # along with cdist. If not, see . # # -# __file is a very basic type and should be able to be used as an -# example for typewrites later +# Mostly a wrapper for ln # destination="/$__object_id" From 6f480810f34023dd90a6d91d456044727acc509c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 00:02:44 +0100 Subject: [PATCH 0199/5465] Update to 1.3.0 Signed-off-by: Nico Schottelius --- README | 3 ++- bin/cdist-config | 2 +- doc/changelog | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README b/README index cadb3e30..6e46db87 100644 --- a/README +++ b/README @@ -115,12 +115,13 @@ how to use cdist. There are at least the following branches available: * master: the development branch - * 1.2: Current stable: Dependencies supported + * 1.3: Support for local and remote code execution (current stable) Old versions: * 1.0: First official release * 1.1: __file to __file, __directory, __link migration + * 1.2: Dependencies supported Other branches may be available for features or bugfixes, but they may vanish at any point. To select a specific branch use diff --git a/bin/cdist-config b/bin/cdist-config index d200e275..23b24025 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.2.0" +__cdist_version="1.3.0" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index a0a65428..12e3c8f1 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.3.0: +1.3.0: 2011-03-20 * Add support for local and remote code generation and execution * Bugfix: Remove obsolete $@ call in cdist-remote-explorer-run * Bugfix: Correct manpage for __removeline (broke manpage generation) From c8de837c98fe7029d6fd8450ecdd33521dc04e0c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 00:12:47 +0100 Subject: [PATCH 0200/5465] todo after 1.3, 1.2 is old :-) Signed-off-by: Nico Schottelius --- doc/dev/todo/{post-1.2 => post-1.3} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/dev/todo/{post-1.2 => post-1.3} (100%) diff --git a/doc/dev/todo/post-1.2 b/doc/dev/todo/post-1.3 similarity index 100% rename from doc/dev/todo/post-1.2 rename to doc/dev/todo/post-1.3 From faa6267bc95baaf706dfe6f869cf1d892806543d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 00:15:19 +0100 Subject: [PATCH 0201/5465] and new stuff todo for nico Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 24 +----------------------- doc/dev/todo/post-1.3 | 7 ------- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index f00f6088..ce8412de 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,23 +1 @@ -Dependency problem: - -Generating code for __file/home/lyni/dos/scorch15/SCORCH.DOC ... -scp: /home/lyni/dos/scorch15/SCORCH.DOC: No such file or directory - --> Err, gencode does the wrong thing here. - -Gencode is also not very clean, doing stuff that should probably -done later. - -Maybe differentiate between local|remote execution? - -> does not help either if different run - - -> keep dependencies in execute, have local and remote exec? - --------------------------------------------------------------------------------- -Possible solution: - - - remove gencode - - replace with gen_localcode and gen_remotecode - - run both in the execution stage of the object - - +Ensure bin/* is documented diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index eccf78c3..00aca9c7 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -22,10 +22,3 @@ Documentation: - via version control - Check all references in manpages, ensure all manpages exist - Ensure html output of manpages are published on the web - - ensure every file in bin/ has a correspondent manpage - - - cdist-remote-code-run-all - - cdist-remote-explorer-run - - cdist-type-build-emulation - - cdist-type-emulator - From 9aa60b3b1d21ac820127312014a4db6ce5497b02 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 00:30:19 +0100 Subject: [PATCH 0202/5465] Add manpage for cdist-type-build-emulation Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/changelog | 3 +++ doc/dev/todo/niconext | 4 +++ doc/man/cdist-type-build-emulation.text | 33 +++++++++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 doc/man/cdist-type-build-emulation.text diff --git a/Makefile b/Makefile index 6c28a88b..391190ae 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-run-remote.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ + $(MANDIR)/cdist-type-build-emulation.text \ $(MANDIR)/cdist-type-template.text \ diff --git a/doc/changelog b/doc/changelog index 12e3c8f1..a10d9de5 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.3.1: + * Document cdist-type-build-emulation + 1.3.0: 2011-03-20 * Add support for local and remote code generation and execution * Bugfix: Remove obsolete $@ call in cdist-remote-explorer-run diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index ce8412de..a90df593 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1 +1,5 @@ Ensure bin/* is documented + - cdist-remote-code-run-all + - cdist-remote-explorer-run + - cdist-type-emulator + diff --git a/doc/man/cdist-type-build-emulation.text b/doc/man/cdist-type-build-emulation.text new file mode 100644 index 00000000..81c56e7c --- /dev/null +++ b/doc/man/cdist-type-build-emulation.text @@ -0,0 +1,33 @@ +cdist-type-build-emulation(1) +============================= +Nico Schottelius + + +NAME +---- +cdist-type-build-emulation - Build executables for types + + +SYNOPSIS +-------- +cdist-type-build-emulation OUT_DIR + + +DESCRIPTION +----------- +cdist-type-build-emulation creates a link to cdist-type-emulator +for every TYPE. These links are placed in a OUT_DIR, which +is prepended into $PATH. This way the user can use TYPE in the +manifests like any other executable. + + +SEE ALSO +-------- +- cdist(7) +- cdist-type-emulator(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 0d4f2a6c4b9c06d5c42196f8e20ecdee9290ff85 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 00:31:34 +0100 Subject: [PATCH 0203/5465] use __cdist_abs_mydir instead of which Signed-off-by: Nico Schottelius --- bin/cdist-type-build-emulation | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-type-build-emulation b/bin/cdist-type-build-emulation index 9a207e33..51c2f5b4 100755 --- a/bin/cdist-type-build-emulation +++ b/bin/cdist-type-build-emulation @@ -26,7 +26,7 @@ set -eu __cdist_output_dir="$1"; shift -__cdist_type_emulator="$(which cdist-type-emulator)" +__cdist_type_emulator="$__cdist_abs_mydir/cdist-type-emulator" if [ ! -d "${__cdist_type_dir}" ]; then __cdist_exit_err "$__cdist_type_dir must exist and contain available types" From bda2adb22cb30c20efd5e11ba49c35a1fb2c9be7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 00:43:08 +0100 Subject: [PATCH 0204/5465] document cdist-type-emulator Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/changelog | 1 + doc/dev/todo/niconext | 2 -- doc/man/cdist-type-emulator.text | 56 ++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 doc/man/cdist-type-emulator.text diff --git a/Makefile b/Makefile index 391190ae..20f961cd 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ $(MANDIR)/cdist-type-build-emulation.text \ + $(MANDIR)/cdist-type-emulator.text \ $(MANDIR)/cdist-type-template.text \ diff --git a/doc/changelog b/doc/changelog index a10d9de5..054b9f71 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.3.1: * Document cdist-type-build-emulation + * Document cdist-type-emulator 1.3.0: 2011-03-20 * Add support for local and remote code generation and execution diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index a90df593..4e90e2b1 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,5 +1,3 @@ Ensure bin/* is documented - cdist-remote-code-run-all - cdist-remote-explorer-run - - cdist-type-emulator - diff --git a/doc/man/cdist-type-emulator.text b/doc/man/cdist-type-emulator.text new file mode 100644 index 00000000..507c1054 --- /dev/null +++ b/doc/man/cdist-type-emulator.text @@ -0,0 +1,56 @@ +cdist-type-emulator(1) +====================== +Nico Schottelius + + +NAME +---- +cdist-type-emulator - Emulate type and record parameters and dependencies + + +SYNOPSIS +-------- +cdist-type-emulator [TYPE ARGS] + + +DESCRIPTION +----------- +cdist-type-emulator is normally called through a link to it of the +name of a specifc type. It saves the given parameters into +a parameters directory and the requirements into a require file. + +It checks whether the parameters are valid: + +- are required parameter given? +- are all other required parameters specified as optional? + + +EXAMPLES +-------- +Your manifest may contain stuff like this: + + +-------------------------------------------------------------------------------- +__addifnosuchline /tmp/linetest --line "test" + +__motd +-------------------------------------------------------------------------------- + +In both cases, cdist-type-emulator is called instead of a real type. +In the first case, the object id "/tmp/linetest" is recorded and the +parameter "line" stored with the content "test". + +In the second case, __motd must be decleared as a singleton, as the +object id is missing. + + +SEE ALSO +-------- +- cdist(7) +- cdist-type-build-emulation(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 0f60a2387aa57cb30179a78661bee3b6f786afb9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 00:51:45 +0100 Subject: [PATCH 0205/5465] document cdist-remote-explorer-run.text Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/changelog | 1 + doc/dev/todo/niconext | 7 ++++-- doc/man/cdist-remote-explorer-run.text | 33 ++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 doc/man/cdist-remote-explorer-run.text diff --git a/Makefile b/Makefile index 20f961cd..9168fc9f 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-object-gencode.text \ $(MANDIR)/cdist-object-gencode-all.text \ $(MANDIR)/cdist-quickstart.text \ + $(MANDIR)/cdist-remote-explorer-run.text \ $(MANDIR)/cdist-run-remote.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ diff --git a/doc/changelog b/doc/changelog index 054b9f71..a799335d 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.3.1: * Document cdist-type-build-emulation * Document cdist-type-emulator + * Document cdist-remote-explorer-run 1.3.0: 2011-03-20 * Add support for local and remote code generation and execution diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 4e90e2b1..e299766b 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,6 @@ Ensure bin/* is documented - - cdist-remote-code-run-all - - cdist-remote-explorer-run + +[0:43] kr:bin% for a in *; do test -f ../doc/man/${a}.text || echo $a missing ; done +cdist-code-run missing +[0:44] kr:bin% + diff --git a/doc/man/cdist-remote-explorer-run.text b/doc/man/cdist-remote-explorer-run.text new file mode 100644 index 00000000..64951e2c --- /dev/null +++ b/doc/man/cdist-remote-explorer-run.text @@ -0,0 +1,33 @@ +cdist-remote-explorer-run(1) +============================ +Nico Schottelius + + +NAME +---- +cdist-remote-explorer-run - Run explorer remotely + + +SYNOPSIS +-------- +cdist-remote-explorer-run VARIABLE_NAME EXPLORER_DIR OUT_DIR + + +DESCRIPTION +----------- +cdist-remote-explorer-run is executed on the target. +It sets up the variable VARIABLE_NAME to point to the given +EXPLORER_DIR and runs all explorer found in EXPLORER_DIR. +The output of every run explorer is saved into OUT_DIR. + + +SEE ALSO +-------- +- cdist(7) +- cdist-explorer-run-global(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 45e72938402aa19c32d12545094bcdaca2f70441 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 01:08:11 +0100 Subject: [PATCH 0206/5465] document cdist-code-run Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/dev/todo/niconext | 6 ----- doc/man/cdist-code-run.text | 34 +++++++++++++++++++++++++++ doc/man/cdist-object-gencode-all.text | 1 + doc/man/cdist-object-gencode.text | 1 + 5 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 doc/man/cdist-code-run.text diff --git a/Makefile b/Makefile index 9168fc9f..5cc89547 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-code-run-all.text \ + $(MANDIR)/cdist-code-run.text \ $(MANDIR)/cdist-config.text \ $(MANDIR)/cdist-dir.text \ $(MANDIR)/cdist-env.text \ diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index e299766b..e69de29b 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +0,0 @@ -Ensure bin/* is documented - -[0:43] kr:bin% for a in *; do test -f ../doc/man/${a}.text || echo $a missing ; done -cdist-code-run missing -[0:44] kr:bin% - diff --git a/doc/man/cdist-code-run.text b/doc/man/cdist-code-run.text new file mode 100644 index 00000000..f412f6da --- /dev/null +++ b/doc/man/cdist-code-run.text @@ -0,0 +1,34 @@ +cdist-code-run(1) +============================ +Nico Schottelius + + +NAME +---- +cdist-code-run - Run explorer remotely + + +SYNOPSIS +-------- +cdist-code-run OBJECT_DIR OBJECT TYPE + + +DESCRIPTION +----------- +cdist-code-run executes generated code from a given OBJECT. +The OBJECT must be located below OBJECT_DIR. +TYPE must be either local or remote and determines which +code part is to be executed. + + +SEE ALSO +-------- +- cdist(7) +- cdist-object-gencode(1) +- cdist-object-gencode-all(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/doc/man/cdist-object-gencode-all.text b/doc/man/cdist-object-gencode-all.text index 40d4335d..b1c96748 100644 --- a/doc/man/cdist-object-gencode-all.text +++ b/doc/man/cdist-object-gencode-all.text @@ -21,6 +21,7 @@ For every object that exists, the cdist-object-gencode is executed. SEE ALSO -------- - cdist(7) +- cdist-code-run(1) - cdist-deploy-to(1) - cdist-object-gencode(1) diff --git a/doc/man/cdist-object-gencode.text b/doc/man/cdist-object-gencode.text index c6fc8b18..83f4b4c1 100644 --- a/doc/man/cdist-object-gencode.text +++ b/doc/man/cdist-object-gencode.text @@ -22,6 +22,7 @@ executable on stdout will be used by cdist-object-gencode-all(1). SEE ALSO -------- - cdist(7) +- cdist-code-run(1) - cdist-deploy-to(1) - cdist-object-gencode-all(1) From a90cca865872be9b3e78036a1d28d329431a21cb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 01:57:24 +0100 Subject: [PATCH 0207/5465] do not care about solaris until someone needs it Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.3 | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index 00aca9c7..61adacc7 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -1,6 +1,5 @@ Core: - write test case: test.sh - - probably remove grep -q (solaris does not have it) - export remote user name -> $__user Types to be written/extended: From c7ccedd463ee63474090cb52652f5f62ae137df8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:01:02 +0100 Subject: [PATCH 0208/5465] DO NOT DO WHILE READ LOOP WITH SSH Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index 070d0e71..b8a17430 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -29,12 +29,22 @@ __cdist_target_host="$1"; shift __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" +# NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP while read object; do + set -- "$@" "$object" +done < "$__cdist_tmp_file" + +while [ $# -ge 1 ]; do + object="$1"; shift + # Code local - cdist-code-run "$__cdist_out_object_dir" "$object" "${__cdist_name_gencode_local}" + cdist-code-run "$__cdist_out_object_dir" "$object" \ + "${__cdist_name_gencode_local}" \ + || __exit_err "Remote code failed for $object" # Code remote cdist-run-remote "$__cdist_target_host" "cdist-code-run" \ "${__cdist_remote_out_object_base_dir}" "$object" \ - "${__cdist_name_gencode_remote}" + "${__cdist_name_gencode_remote}" \ + || __exit_err "Remote code failed for $object" done < "$__cdist_tmp_file" From 6800bbff10456ce92a1f0c629f3052e4bdd54042 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:01:23 +0100 Subject: [PATCH 0209/5465] call new name in requirement block Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 42b4901d..9528650d 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -23,7 +23,7 @@ . cdist-config [ $# -eq 3 ] || __cdist_usage " " -set -ue +set -uex # This variable MUST be exactly like this - see __cdist_object_dir __cdist_out_object_dir="$1"; shift @@ -50,7 +50,7 @@ echo "Checking code-${__cdist_gencode_type} for $object ..." if [ -f "$require" ]; then while read requirement; do echo "Requiring dependency $requirement for $object ..." - cdist-remote-code-run "$__cdist_out_object_dir" "$requirement" + cdist-code-run "$__cdist_out_object_dir" "$requirement" "$__cdist_gencode_type" done < "$require" fi From 04a07cfaf66db10ad155e56581cb0d28c3cb4ea3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:04:30 +0100 Subject: [PATCH 0210/5465] enhance and fix __issue Signed-off-by: Nico Schottelius --- conf/type/__issue/manifest | 24 +++++++++++++++--------- doc/changelog | 2 ++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/conf/type/__issue/manifest b/conf/type/__issue/manifest index 1fab9a07..eff6b808 100755 --- a/conf/type/__issue/manifest +++ b/conf/type/__issue/manifest @@ -20,15 +20,21 @@ # destination=/etc/issue -source="$(cat "out/explorer/os")" -case "$os" in - archlinux|redhat) - source="$__type/files/$os" - ;; - *) - source="$__type/files/default" - ;; -esac +os="$(cat "$__global/explorer/os")" + +if [ -f "$__object/parameter/source" ]; then + source="$(cat "$__object/parameter/source")" + echo using $source +else + case "$os" in + archlinux|redhat) + source="$__type/files/$os" + ;; + *) + source="$__type/files/default" + ;; + esac +fi __file "$destination" --source "$source" diff --git a/doc/changelog b/doc/changelog index a799335d..f386faf1 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,8 @@ * Document cdist-type-build-emulation * Document cdist-type-emulator * Document cdist-remote-explorer-run + * Fix dependencies in cdist-code-run + * Add --source to __issue and fix os check 1.3.0: 2011-03-20 * Add support for local and remote code generation and execution From a6b4c468e3d347d64386826470125428696e87b8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:04:50 +0100 Subject: [PATCH 0211/5465] and add __issue parameter Signed-off-by: Nico Schottelius --- conf/type/__issue/parameter/optional | 1 + 1 file changed, 1 insertion(+) create mode 100644 conf/type/__issue/parameter/optional diff --git a/conf/type/__issue/parameter/optional b/conf/type/__issue/parameter/optional new file mode 100644 index 00000000..5a18cd2f --- /dev/null +++ b/conf/type/__issue/parameter/optional @@ -0,0 +1 @@ +source From 2830e2e894edc4f3d02dd996d8f376c0156a7ff2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:12:35 +0100 Subject: [PATCH 0212/5465] -very verbose debug Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 9528650d..229d4d1d 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -23,7 +23,7 @@ . cdist-config [ $# -eq 3 ] || __cdist_usage " " -set -uex +set -ue # This variable MUST be exactly like this - see __cdist_object_dir __cdist_out_object_dir="$1"; shift From 69fc63df1e99309111b870a7239abf49cc94ba4c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:44:31 +0100 Subject: [PATCH 0213/5465] export __target_user to non-core Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 ++ bin/cdist-deploy-to | 1 + doc/dev/todo/post-1.3 | 4 ++-- doc/man/cdist-reference.text.sh | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 23b24025..676a743c 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -63,6 +63,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_require:=require} : ${__cdist_name_singleton:=singleton} : ${__cdist_name_target_host:=target_host} +: ${__cdist_name_target_user:=target_user} : ${__cdist_name_type:=type} : ${__cdist_name_type_bin:=type_bin} : ${__cdist_name_type_explorer:=type_explorer} @@ -82,6 +83,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_var_global:=__$__cdist_name_global} : ${__cdist_name_var_manifest:=__$__cdist_name_manifest} : ${__cdist_name_var_target_host:=__$__cdist_name_target_host} +: ${__cdist_name_var_target_user:=__$__cdist_name_target_user} : ${__cdist_name_var_object:=__$__cdist_name_object} : ${__cdist_name_var_object_id:=__$__cdist_name_object_id} : ${__cdist_name_var_type:=__$__cdist_name_type} diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 551575c3..a288b189 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -29,6 +29,7 @@ __cdist_target_host="$1" # Make target host available for non-core export $__cdist_name_var_target_host="$__cdist_target_host" +export $__cdist_name_var_target_user="$__cdist_remote_user" # Export variables for core, which others do not reset export __cdist_local_base_dir diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index 61adacc7..3a23d44d 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -1,9 +1,10 @@ Core: - write test case: test.sh + - doc/man/cdist-reference.text.sh: use static version from cdist-config - export remote user name -> $__user Types to be written/extended: - - __ssh-keys (host/user) + j __ssh-keys (host/user) - __service - __file_edit - regexp replace (can probably cover all?) @@ -19,5 +20,4 @@ Documentation: - cdist-trigger after first run from /var/lib/cdist/out/bin? - Different environments (production, integration, development) - via version control - - Check all references in manpages, ensure all manpages exist - Ensure html output of manpages are published on the web diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 8fdd831c..2c1f03c7 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -169,6 +169,9 @@ __object_id:: __target_host:: The host we are deploying to. Available for: initial manifest, type manifest, type codegen +__target_user:: + User to use for authentication on remote host. + Currently static in core. __type:: Path to the current type. Available for: type manifest From 72da7351c89ca48bea7a6d1c9d52ba63e2f4a3ba Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:48:15 +0100 Subject: [PATCH 0214/5465] remove pull idea until we need it Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.3 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index 3a23d44d..a762737e 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -1,7 +1,5 @@ Core: - write test case: test.sh - - doc/man/cdist-reference.text.sh: use static version from cdist-config - - export remote user name -> $__user Types to be written/extended: j __ssh-keys (host/user) @@ -9,15 +7,12 @@ Types to be written/extended: - __file_edit - regexp replace (can probably cover all?) - __cron - - __issue: add --source Documentation: - Describe Multi master setups - use ssh with master socket? - saves connection delay for new connections: -M - hint: http://protempore.net/~calvins/howto/ssh-connection-sharing/ - - Describe pull architecture and requirements - - cdist-trigger after first run from /var/lib/cdist/out/bin? - Different environments (production, integration, development) - via version control - Ensure html output of manpages are published on the web From 4c5b6077a774643f24b02338b71f775025cb0c31 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 02:57:49 +0100 Subject: [PATCH 0215/5465] remove version information from the reference (redundant) Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 2c1f03c7..f6840880 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -40,7 +40,7 @@ Nico Schottelius NAME ---- -cdist-reference - Variable, path and type reference for cdist $(git describe) +cdist-reference - Variable, path and type reference for cdist DESCRIPTION From 14d6fccd0581592c2f81cb0eef929329896f1315 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 03:23:13 +0100 Subject: [PATCH 0216/5465] begin html generation of manpages Signed-off-by: Nico Schottelius --- .gitignore | 6 ++++++ Makefile | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index d7c6f7c2..fdf9184f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,10 @@ doc/man/*.[1-9] doc/man/.marker doc/man/man*/ + +doc/html + conf/type/*/*.7 +conf/type/*/man.html + + diff --git a/Makefile b/Makefile index 5cc89547..c06adfc4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,11 @@ PREFIX=/usr BINDIR=$(PREFIX)/bin MANDIR=$(PREFIX)/share/man -A2X=a2x -f manpage --no-xmllint + +# Manpage and HTML +A2XM=a2x -f manpage --no-xmllint +# A2XH=a2x -f xhtml --no-xmllint +A2XH=asciidoc -b xhtml11 # Developer only WEBDIR=$$HOME/niconetz @@ -60,11 +64,11 @@ doc/man/.marker: $(MANDIR)/cdist-reference.text # Manual from core mancore: $(MANSRC) - for mansrc in $^; do $(A2X) $$mansrc; done + for mansrc in $^; do $(A2XM) $$mansrc; $(A2XH) $$mansrc; done # Manuals from types mantype: - for man in conf/type/*/man.text; do $(A2X) $$man; done + for man in conf/type/*/man.text; do $(A2XM) $$man; $(A2XH) $$man; done # Move into manpath directories manmove: mantype mancore @@ -74,16 +78,21 @@ manmove: mantype mancore mkdir -p $$mandir; \ mv $$manpage $$mandir; \ done + mkdir -p doc/html + mv doc/man/*.html doc/html + mv conf/type/*/man # Reference depends on conf/type/*/man.text - HOWTO with posix make? $(MANDIR)/cdist-reference.text: manmove $(MANDIR)/cdist-reference.text.sh $(MANDIR)/cdist-reference.text.sh - $(A2X) $(MANDIR)/cdist-reference.text + $(A2XM) $(MANDIR)/cdist-reference.text + $(A2XH) $(MANDIR)/cdist-reference.text # Move us to the destination as well make manmove clean: rm -rf doc/man/*.html doc/man/*.[1-9] doc/man/man[1-9] $(MANGENERATED) + rm -f conf/type/*/man.html conf/type/*/docbook-xsl.css ################################################################################ # Developer targets From bd939567ad4b88bd7c81c74dad79f6eddf620321 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 03:25:46 +0100 Subject: [PATCH 0217/5465] fix manpage cdist-code-run Signed-off-by: Nico Schottelius --- doc/man/cdist-code-run.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/cdist-code-run.text b/doc/man/cdist-code-run.text index f412f6da..e5d8c976 100644 --- a/doc/man/cdist-code-run.text +++ b/doc/man/cdist-code-run.text @@ -1,5 +1,5 @@ cdist-code-run(1) -============================ +================= Nico Schottelius From 8722c03c1246e48c5f2884954d9f049bc20b5b82 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 22:41:22 +0100 Subject: [PATCH 0218/5465] work on html output of manpages Signed-off-by: Nico Schottelius --- Makefile | 8 ++++++-- doc/dev/todo/niconext | 1 + doc/dev/todo/post-1.3 | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c06adfc4..6f1b08a7 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,11 @@ manmove: mantype mancore done mkdir -p doc/html mv doc/man/*.html doc/html - mv conf/type/*/man + + for mantype in conf/type/*/man.html; do \ + mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\ + mv $$mantype doc/html/$$mannew; \ + done # Reference depends on conf/type/*/man.text - HOWTO with posix make? $(MANDIR)/cdist-reference.text: manmove $(MANDIR)/cdist-reference.text.sh @@ -92,7 +96,7 @@ $(MANDIR)/cdist-reference.text: manmove $(MANDIR)/cdist-reference.text.sh clean: rm -rf doc/man/*.html doc/man/*.[1-9] doc/man/man[1-9] $(MANGENERATED) - rm -f conf/type/*/man.html conf/type/*/docbook-xsl.css + rm -f conf/type/*/man.html ################################################################################ # Developer targets diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index e69de29b..107023dd 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -0,0 +1 @@ + - Ensure html output of manpages are published on the web diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index a762737e..4988504b 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -15,4 +15,3 @@ Documentation: - hint: http://protempore.net/~calvins/howto/ssh-connection-sharing/ - Different environments (production, integration, development) - via version control - - Ensure html output of manpages are published on the web From be3080b24766f7a956f5eb35bc222244e278b584 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 20 Mar 2011 22:42:00 +0100 Subject: [PATCH 0219/5465] __cdist_exit_err, not __exit_err Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index b8a17430..3a360715 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -40,11 +40,11 @@ while [ $# -ge 1 ]; do # Code local cdist-code-run "$__cdist_out_object_dir" "$object" \ "${__cdist_name_gencode_local}" \ - || __exit_err "Remote code failed for $object" + || __cdist_exit_err "Remote code failed for $object" # Code remote cdist-run-remote "$__cdist_target_host" "cdist-code-run" \ "${__cdist_remote_out_object_base_dir}" "$object" \ "${__cdist_name_gencode_remote}" \ - || __exit_err "Remote code failed for $object" + || __cdist_exit_err "Remote code failed for $object" done < "$__cdist_tmp_file" From 5c9f85fd269cb47a826eae3e0be1548f0dab3e74 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 08:30:25 +0100 Subject: [PATCH 0220/5465] more todo Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.3 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index 4988504b..bf65d2cf 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -1,5 +1,6 @@ Core: - - write test case: test.sh + - think about using .cdist for meta information? + - otherwise: parameter, gencode-local, etc. are not valid object id stuff Types to be written/extended: j __ssh-keys (host/user) From 0d39da6a2bec856a0c9413b47d0ff9390d9d803e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 08:31:32 +0100 Subject: [PATCH 0221/5465] output dependencies to the user Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index fcfbe60f..063afd92 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -110,4 +110,5 @@ fi set +u for requirement in $require; do echo $requirement >> "$(__cdist_object_require "$__cdist_object")" + echo Recording: $__cdist_object requires $requirement done From 0f2eeda8387b6424c1963684d167d4cdaf4d27a8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 08:35:25 +0100 Subject: [PATCH 0222/5465] include move of requirements and make move a loop Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 050e4850..80cd47be 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -98,17 +98,18 @@ while [ "$__cdist_new_objects_created" = "y" ]; do mv "${__cdist_new_object_dir}/${__cdist_name_object_source}" \ "$__cdist_object_dir" - # Parameter - if [ -d "${__cdist_new_object_dir}/${__cdist_name_parameter}" ]; then - mv "${__cdist_new_object_dir}/${__cdist_name_parameter}" \ - "$__cdist_object_dir" - fi - - # Explorer - if [ -d "${__cdist_new_object_dir}/${__cdist_name_explorer}" ]; then - mv "${__cdist_new_object_dir}/${__cdist_name_explorer}" \ - "$__cdist_object_dir" - fi + # Explorer, Parameter, Require + for __cdist_object_file in \ + ${__cdist_name_explorer} \ + ${__cdist_name_parameter} \ + ${__cdist_name_require} \ + ; do + + if [ -e "${__cdist_new_object_dir}/${__cdist_name_parameter}" ]; then + mv "${__cdist_new_object_dir}/${__cdist_object_file}" \ + "$__cdist_object_dir" + fi + done done < "$__cdist_new_objects_list" # Remove listing and objects, otherwise the next type will reuse it... From 6f02112aeb8985d9486731c4f71c9a67357c37b9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 08:46:54 +0100 Subject: [PATCH 0223/5465] check for correct entry on move, not parameter ;-) Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 80cd47be..884f46ee 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -105,7 +105,7 @@ while [ "$__cdist_new_objects_created" = "y" ]; do ${__cdist_name_require} \ ; do - if [ -e "${__cdist_new_object_dir}/${__cdist_name_parameter}" ]; then + if [ -e "${__cdist_new_object_dir}/${__cdist_object_file}" ]; then mv "${__cdist_new_object_dir}/${__cdist_object_file}" \ "$__cdist_object_dir" fi From c0705c1efd62323894c18cbecb5f3c897431f312 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 08:54:12 +0100 Subject: [PATCH 0224/5465] update documentation for __issue Signed-off-by: Nico Schottelius --- conf/type/__issue/man.text | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conf/type/__issue/man.text b/conf/type/__issue/man.text index 18d88947..40ed920e 100644 --- a/conf/type/__issue/man.text +++ b/conf/type/__issue/man.text @@ -20,13 +20,19 @@ None. OPTIONAL PARAMETERS ------------------- -None +source:: + If supplied, use this file as /etc/issue instead of default. + + EXAMPLES -------- -------------------------------------------------------------------------------- __issue + +# When called from another type +__issue --source "$__type/files/myfancyissue" -------------------------------------------------------------------------------- From c0e21136436b94065b8199ef8deabc3cdedf764e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 08:59:04 +0100 Subject: [PATCH 0225/5465] update files for 1.3.1 Signed-off-by: Nico Schottelius --- README | 4 ++-- bin/cdist-config | 2 +- doc/changelog | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README b/README index 6e46db87..c0ecbbbf 100644 --- a/README +++ b/README @@ -129,8 +129,8 @@ may vanish at any point. To select a specific branch use # Generic code git checkout -b origin/ - # Stay on version 1.1 - git checkout -b 1.2 origin/1.2 + # Stay on a specific version + git checkout -b 1.3 origin/1.3 ### Mirrors diff --git a/bin/cdist-config b/bin/cdist-config index 676a743c..6a2c1d90 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.3.0" +__cdist_version="1.3.1" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index f386faf1..df18aa43 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,8 +1,9 @@ -1.3.1: +1.3.1: 2011-03-21 * Document cdist-type-build-emulation * Document cdist-type-emulator * Document cdist-remote-explorer-run * Fix dependencies in cdist-code-run + * Fix dependencies in cdist-manifest-run-all * Add --source to __issue and fix os check 1.3.0: 2011-03-20 From 240b4aebbc5ff01c4fdc10aed5c33ca0e433d320 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 09:14:42 +0100 Subject: [PATCH 0226/5465] begin to add --preseed to __package_apt Signed-off-by: Nico Schottelius --- conf/type/__package_apt/parameter/optional | 1 + doc/dev/todo/niconext | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/type/__package_apt/parameter/optional b/conf/type/__package_apt/parameter/optional index a52167d3..2dae648e 100644 --- a/conf/type/__package_apt/parameter/optional +++ b/conf/type/__package_apt/parameter/optional @@ -1,2 +1,3 @@ name +preseed version diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 107023dd..4751c54a 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1 +1,2 @@ - - Ensure html output of manpages are published on the web +- add --preseed to __package_apt +- Ensure html output of manpages are published on the web From 1a4fd4854ca8094dbfb890211cfef1c92b5681bc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 09:30:42 +0100 Subject: [PATCH 0227/5465] __motd now supports --source as well Signed-off-by: Nico Schottelius --- conf/type/__motd/manifest | 2 +- conf/type/__motd/parameter/optional | 1 + doc/changelog | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 conf/type/__motd/parameter/optional diff --git a/conf/type/__motd/manifest b/conf/type/__motd/manifest index 4716f530..286d1ff3 100755 --- a/conf/type/__motd/manifest +++ b/conf/type/__motd/manifest @@ -26,7 +26,7 @@ else source="$__type/files/motd" fi -os=$(cat $__global/explorer/os) +os=$(cat "$__global/explorer/os") case "$os" in diff --git a/conf/type/__motd/parameter/optional b/conf/type/__motd/parameter/optional new file mode 100644 index 00000000..5a18cd2f --- /dev/null +++ b/conf/type/__motd/parameter/optional @@ -0,0 +1 @@ +source diff --git a/doc/changelog b/doc/changelog index df18aa43..2c2aec57 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.3.2: + * Add --source to __motd + 1.3.1: 2011-03-21 * Document cdist-type-build-emulation * Document cdist-type-emulator From 3927da66b64688ad7b25245853d1012c2b8fce80 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 09:44:14 +0100 Subject: [PATCH 0228/5465] update __directory documentation Signed-off-by: Nico Schottelius --- conf/type/__directory/man.text | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/type/__directory/man.text b/conf/type/__directory/man.text index f7272df9..02a41754 100644 --- a/conf/type/__directory/man.text +++ b/conf/type/__directory/man.text @@ -30,7 +30,7 @@ owner:: User to chown to. parents:: - Whether to create parents as well (mkdir -p behaviour) + Whether to create parents as well (mkdir -p behaviour). Must be yes or no. EXAMPLES @@ -41,7 +41,10 @@ EXAMPLES __directory /tmp/foobar # Ensure /etc exists correctly -__file /etc --owner root --group root --mode 0755 +__directory /etc --owner root --group root --mode 0755 + +# Create nfs service directory, including parents +__directory /home/services/nfs --parents yes -------------------------------------------------------------------------------- From 4ff794b11ab4085df262312ca54e6bfd0ddc1d13 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 10:07:38 +0100 Subject: [PATCH 0229/5465] __file now supports --preseed (including the documentation) Signed-off-by: Nico Schottelius --- conf/type/__package_apt/gencode-remote | 8 +++++++- conf/type/__package_apt/man.text | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/conf/type/__package_apt/gencode-remote b/conf/type/__package_apt/gencode-remote index 370f0102..b2c7179d 100755 --- a/conf/type/__package_apt/gencode-remote +++ b/conf/type/__package_apt/gencode-remote @@ -27,8 +27,14 @@ else name="$__object_id" fi -state="$(cat "$__object/parameter/state")" +# Check for preseeding and add preseed as here document +if [ -f "$__object/parameter/preseed" ]; then + echo "debconf-set-selections << __file-eof" + cat "$(cat "$__object/parameter/preseed")" + echo "__file-eof" +fi +state="$(cat "$__object/parameter/state")" is_installed="$(grep "^Status: install ok installed" "$__object/explorer/pkg_status" || true)" case "$state" in diff --git a/conf/type/__package_apt/man.text b/conf/type/__package_apt/man.text index 0780124d..8b7476b4 100644 --- a/conf/type/__package_apt/man.text +++ b/conf/type/__package_apt/man.text @@ -25,6 +25,9 @@ OPTIONAL PARAMETERS name:: If supplied, use the name and not the object id as the package name. +preseed:: + If supplied, use the given filename as input for debconf-set-selections(1) + EXAMPLES -------- @@ -36,6 +39,9 @@ __package_apt zsh --state installed # In case you only want *a* webserver, but don't care which one __package_apt webserver --state installed --name nginx +# Install package with defaults (from a type) +__package_apt postfix --state installed --preseed "$__type/files/postfix-seed" + # Remove obsolete package __package_apt puppet --state deinstalled -------------------------------------------------------------------------------- From 3f39c809b0cd7be1481ac4ad9197c996cb632042 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 10:08:15 +0100 Subject: [PATCH 0230/5465] more stuff for 1.3.2 Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 2c2aec57..6f7db0bf 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.3.2: * Add --source to __motd + * Add --preseed to __package_apt 1.3.1: 2011-03-21 * Document cdist-type-build-emulation From 30c2b017d42c868582e70bb0af2af84b7d4ac65f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 12:24:42 +0100 Subject: [PATCH 0231/5465] also name source of object when running type manifests Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 8 ++++++-- doc/changelog | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 884f46ee..fe8263ea 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -78,8 +78,12 @@ while [ "$__cdist_new_objects_created" = "y" ]; do # Verify no conflicting objects have been created while read __cdist_new_object; do - grep -q "^$__cdist_new_object\$" "$__cdist_objects_list" && \ - __cdist_exit_err "${__cdist_manifest}: Tried to recreate ${__cdist_new_object}" + __cdist_object_found=$(grep "^$__cdist_new_object\$" "$__cdist_objects_list" || true) + + if [ "$__cdist_object_found" ]; then + __cdist_object_source="$(cat "$(__cdist_object_dir "$__cdist_new_object")/${__cdist_name_object_source}")" + __cdist_exit_err "${__cdist_manifest}: ${__cdist_new_object} already exists (source: $__cdist_object_source)" + fi done < "$__cdist_new_objects_list" # Safe harbour: We can merge all objects into main tree diff --git a/doc/changelog b/doc/changelog index 6f7db0bf..4b985c30 100644 --- a/doc/changelog +++ b/doc/changelog @@ -15,7 +15,6 @@ * Bugfix: Remove obsolete $@ call in cdist-remote-explorer-run * Bugfix: Correct manpage for __removeline (broke manpage generation) - 1.2.0: 2011-03-19 * Added dependencies (see cdist-type(7)) * New type __removeline (Daniel Roth) From 87cc5c2bbf289001a064d71a2ab25821f878db00 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 13:31:00 +0100 Subject: [PATCH 0232/5465] claenup cdist-quickstart Signed-off-by: Nico Schottelius --- doc/man/cdist-quickstart.text | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/doc/man/cdist-quickstart.text b/doc/man/cdist-quickstart.text index ddcbbccc..087fd2d5 100644 --- a/doc/man/cdist-quickstart.text +++ b/doc/man/cdist-quickstart.text @@ -20,10 +20,8 @@ of the first tools you use when you begin with cdist. EXAMPLES -------- - -To use cdist-quickstart, add the bin directory to your PATH, -execute cdist-quickstart and enjoy cdist: - +To use cdist-quickstart, add the bin directory to your PATH, execute +cdist-quickstart and enjoy cdist: -------------------------------------------------------------------------------- # Bourne shell example @@ -37,7 +35,6 @@ cdist-quickstart -------------------------------------------------------------------------------- - SEE ALSO -------- - cdist(7) @@ -48,4 +45,3 @@ COPYING ------- Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). -## How to use cdist? From 4553333ddbec68bb8c4c5f65438485ea918235f6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 13:48:40 +0100 Subject: [PATCH 0233/5465] Begin to include html version of manpages Signed-off-by: Nico Schottelius --- Makefile | 14 +++++++++----- README | 9 +++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6f1b08a7..7f975c92 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,8 @@ A2XM=a2x -f manpage --no-xmllint A2XH=asciidoc -b xhtml11 # Developer only -WEBDIR=$$HOME/niconetz -WEBPAGE=software/cdist.mdwn +WEBPAGEBASE=$$HOME/niconetz/software/cdist +WEBPAGE=$(WEBPAGEBASE).mdwn # Documentation MANDIR=doc/man @@ -52,7 +52,7 @@ all: @echo '' @echo 'Here are the possible targets:' @echo '' - @echo ' man: Build manpages (requires Asciidoc (a2x binary))' + @echo ' man: Build manpages (requires Asciidoc)' @echo ' clean: Remove build stuff' @echo '' @echo '' @@ -97,6 +97,7 @@ $(MANDIR)/cdist-reference.text: manmove $(MANDIR)/cdist-reference.text.sh clean: rm -rf doc/man/*.html doc/man/*.[1-9] doc/man/man[1-9] $(MANGENERATED) rm -f conf/type/*/man.html + rm -rf doc/html ################################################################################ # Developer targets @@ -110,9 +111,12 @@ test: # gentoo .rsync nicosc@ru3.inf.ethz.ch:cdist +#web: manmove web: - cp README $(WEBDIR)/$(WEBPAGE) - cd $(WEBDIR) && git commit -m "cdist update" $(WEBPAGE) + cp README $(WEBPAGE) + cp -r doc/html/* $(WEBPAGEBASE)/man + exit 1 + cd $(WEBDIR) && git commit -m "cdist update" $(WEBPAGEBASE) cd $(WEBDIR) && make pub pub: diff --git a/README b/README index c0ecbbbf..2aab45c1 100644 --- a/README +++ b/README @@ -37,6 +37,11 @@ it ticks differently: * cdist is written in POSIX shell * No special requirements like high level interpreters needed on server or target +### Documentation + +The cdist documentation is included as manpages in the distribution. +You can [browse them online](man) as well. + ### Architecture * Push mode (server pushes configuration) @@ -151,6 +156,10 @@ 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. +### Upgrading from 1.2 to 1.3 + +Rename **gencode** of every type to **gencode-remote**. + ### Upgrading from 1.1 to 1.2 No incompatiblities. From b36f2fb28253ee15de90db81fc2427b1f11f4b4b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 13:48:58 +0100 Subject: [PATCH 0234/5465] -exit(1) Signed-off-by: Nico Schottelius --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 7f975c92..853feea1 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,6 @@ test: web: cp README $(WEBPAGE) cp -r doc/html/* $(WEBPAGEBASE)/man - exit 1 cd $(WEBDIR) && git commit -m "cdist update" $(WEBPAGEBASE) cd $(WEBDIR) && make pub From f4dc8b28af97a15ec21a74ebfc02e0d1addecd6f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:00:00 +0100 Subject: [PATCH 0235/5465] fix webbpage copy Signed-off-by: Nico Schottelius --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 853feea1..45407702 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,10 @@ A2XM=a2x -f manpage --no-xmllint A2XH=asciidoc -b xhtml11 # Developer only -WEBPAGEBASE=$$HOME/niconetz/software/cdist -WEBPAGE=$(WEBPAGEBASE).mdwn +WEBDIR=$$HOME/niconetz +WEBBASE=software/cdist +WEBPAGE=$(WEBBASE).mdwn + # Documentation MANDIR=doc/man @@ -113,9 +115,9 @@ test: #web: manmove web: - cp README $(WEBPAGE) - cp -r doc/html/* $(WEBPAGEBASE)/man - cd $(WEBDIR) && git commit -m "cdist update" $(WEBPAGEBASE) + cp README $(WEBDIR)/$(WEBPAGE) + cp -r doc/html/* $(WEBDIR)/$(WEBBASE)/man + cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE) cd $(WEBDIR) && make pub pub: From 556cb574ca8a94beaf9440736c6ad49158132177 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:04:26 +0100 Subject: [PATCH 0236/5465] update todos Signed-off-by: Nico Schottelius --- doc/changelog | 1 + doc/dev/todo/post-1.3 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/changelog b/doc/changelog index 4b985c30..6f7cac71 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.3.2: * Add --source to __motd * Add --preseed to __package_apt + * Include HTML documentation of manpages 1.3.1: 2011-03-21 * Document cdist-type-build-emulation diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index bf65d2cf..a798114a 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -3,13 +3,13 @@ Core: - otherwise: parameter, gencode-local, etc. are not valid object id stuff Types to be written/extended: - j __ssh-keys (host/user) + - __ssh-keys (host/user) - __service - __file_edit - regexp replace (can probably cover all?) - __cron -Documentation: +Further Documentation: (probably cdist-best-practises?) - Describe Multi master setups - use ssh with master socket? - saves connection delay for new connections: -M From bbf762a4d95f0f48cdd79b2c861552647f8ee955 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:05:17 +0100 Subject: [PATCH 0237/5465] more todo for nico Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 9 +++++++-- doc/dev/todo/post-1.3 | 8 -------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 4751c54a..fd604139 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,2 +1,7 @@ -- add --preseed to __package_apt -- Ensure html output of manpages are published on the web +Further Documentation: (probably cdist-best-practises?) + - Describe Multi master setups + - use ssh with master socket? + - saves connection delay for new connections: -M + - hint: http://protempore.net/~calvins/howto/ssh-connection-sharing/ + - Different environments (production, integration, development) + - via version control diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index a798114a..284b56b4 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -8,11 +8,3 @@ Types to be written/extended: - __file_edit - regexp replace (can probably cover all?) - __cron - -Further Documentation: (probably cdist-best-practises?) - - Describe Multi master setups - - use ssh with master socket? - - saves connection delay for new connections: -M - - hint: http://protempore.net/~calvins/howto/ssh-connection-sharing/ - - Different environments (production, integration, development) - - via version control From cccd9b32837d43da2557e43c9b9932d52c9f825b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:07:17 +0100 Subject: [PATCH 0238/5465] add hint on html documentation version Signed-off-by: Nico Schottelius --- README | 2 +- doc/changelog | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index 2aab45c1..211f1073 100644 --- a/README +++ b/README @@ -40,7 +40,7 @@ it ticks differently: ### Documentation The cdist documentation is included as manpages in the distribution. -You can [browse them online](man) as well. +You can [browse the documentation for the latest version online](man) as well. ### Architecture diff --git a/doc/changelog b/doc/changelog index 6f7cac71..5b6b03a9 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,7 +1,7 @@ -1.3.2: +1.3.2: 2011-03-21 * Add --source to __motd * Add --preseed to __package_apt - * Include HTML documentation of manpages + * Include HTML documentation of manpages and publish them 1.3.1: 2011-03-21 * Document cdist-type-build-emulation From b41c1f764928d1b0b8212266a891865cb877a7b4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:11:24 +0100 Subject: [PATCH 0239/5465] upgrade to 1.3.2 Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 6a2c1d90..946c88b4 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.3.1" +__cdist_version="1.3.2" # Fail if something bogus is going on set -u From e163a2baec715faf0abb1c70e6d232a71a8b2436 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:19:07 +0100 Subject: [PATCH 0240/5465] begin to write cdist-best-practise Signed-off-by: Nico Schottelius --- Makefile | 5 +++-- doc/dev/todo/niconext | 6 +++--- doc/man/cdist-best-practise.text | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 doc/man/cdist-best-practise.text diff --git a/Makefile b/Makefile index 45407702..29d86c67 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,9 @@ MANDIR=doc/man MANGENERATED=$(MANDIR)/cdist-reference.text MANSRC=$(MANDIR)/cdist.text \ - $(MANDIR)/cdist-code-run-all.text \ + $(MANDIR)/cdist-best-practise.text \ $(MANDIR)/cdist-code-run.text \ + $(MANDIR)/cdist-code-run-all.text \ $(MANDIR)/cdist-config.text \ $(MANDIR)/cdist-dir.text \ $(MANDIR)/cdist-env.text \ @@ -29,8 +30,8 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-explorer.text \ $(MANDIR)/cdist-manifest.text \ $(MANDIR)/cdist-manifest-run.text \ - $(MANDIR)/cdist-manifest-run-init.text \ $(MANDIR)/cdist-manifest-run-all.text \ + $(MANDIR)/cdist-manifest-run-init.text \ $(MANDIR)/cdist-object-explorer-all.text \ $(MANDIR)/cdist-object-gencode.text \ $(MANDIR)/cdist-object-gencode-all.text \ diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index fd604139..fe7125b5 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +1,6 @@ -Further Documentation: (probably cdist-best-practises?) - - Describe Multi master setups - - use ssh with master socket? +Write cdist-best-practise: + - Multi master setups + - ssh with master socket? - saves connection delay for new connections: -M - hint: http://protempore.net/~calvins/howto/ssh-connection-sharing/ - Different environments (production, integration, development) diff --git a/doc/man/cdist-best-practise.text b/doc/man/cdist-best-practise.text new file mode 100644 index 00000000..159da51d --- /dev/null +++ b/doc/man/cdist-best-practise.text @@ -0,0 +1,23 @@ +cdist-best-practise(1) +====================== +Nico Schottelius + +NAME +---- +cdist-best-practise - Practises used in real environments + + +TOPIC1 +------ + + + +SEE ALSO +-------- +- cdist(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 3599eeb42ba1bbd2627caaba1eed7542620bccbb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:27:23 +0100 Subject: [PATCH 0241/5465] add link and some content to cdist-best-practise Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 3 --- doc/man/cdist-best-practise.text | 26 +++++++++++++++++++++++--- doc/man/cdist.text | 1 + 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index fe7125b5..d4fe1ae4 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,7 +1,4 @@ Write cdist-best-practise: - Multi master setups - - ssh with master socket? - - saves connection delay for new connections: -M - - hint: http://protempore.net/~calvins/howto/ssh-connection-sharing/ - Different environments (production, integration, development) - via version control diff --git a/doc/man/cdist-best-practise.text b/doc/man/cdist-best-practise.text index 159da51d..4d4b8edb 100644 --- a/doc/man/cdist-best-practise.text +++ b/doc/man/cdist-best-practise.text @@ -1,4 +1,4 @@ -cdist-best-practise(1) +cdist-best-practise(7) ====================== Nico Schottelius @@ -7,8 +7,28 @@ NAME cdist-best-practise - Practises used in real environments -TOPIC1 ------- +PASSWORDLESS CONNECTIONS +------------------------ +It is recommended to run cdist with public key authentication. +This requires a private/public key pair and the entry +"PermitRootLogin without-password" in the sshd server. +See sshd_config(5) and ssh-keygen(1). + + +SPEEDING UP SSH CONNECTIONS +--------------------------- +When connecting to a new host, the initial delay with ssh connections +is pretty big. You can work around this by +"sharing of multiple sessions over a single network connection" +(quote from ssh_config(5)). The following code is suitable for +inclusion into your ~/.ssh/config: + +-------------------------------------------------------------------------------- +Host * + ControlPath ~/.ssh/master-%l-%r@%h:%p + ControlMaster auto + ControlPersist 10 +-------------------------------------------------------------------------------- diff --git a/doc/man/cdist.text b/doc/man/cdist.text index 570b6b95..957e7cb4 100644 --- a/doc/man/cdist.text +++ b/doc/man/cdist.text @@ -30,6 +30,7 @@ pull mechanism (client requests configuration). SEE ALSO -------- - Website: http://www.nico.schottelius.org/cdist/[] +- cdist-best-practise(7) - cdist-deploy-to(1) - cdist-manifest(7) - cdist-quickstart(1) From 70f2d1040fc6d3bc286cbc06a8bfd733217d09cd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:38:53 +0100 Subject: [PATCH 0242/5465] document multi-master and multi-environment workflow Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 4 ---- doc/man/cdist-best-practise.text | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index d4fe1ae4..e69de29b 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,4 +0,0 @@ -Write cdist-best-practise: - - Multi master setups - - Different environments (production, integration, development) - - via version control diff --git a/doc/man/cdist-best-practise.text b/doc/man/cdist-best-practise.text index 4d4b8edb..af06084e 100644 --- a/doc/man/cdist-best-practise.text +++ b/doc/man/cdist-best-practise.text @@ -31,6 +31,36 @@ Host * -------------------------------------------------------------------------------- +MULTI MASTER OR ENVIRONMENT SETUPS +---------------------------------- +If you plan to distribute cdist among servers or use different +environments, you can do so easily with the included version +control git. For instance if you plan to use the typical three +environments production, integration and development, you can +realise this with git branches: + +-------------------------------------------------------------------------------- +# Go to cdist checkout +cd /path/to/cdist + +# Create branches +git branch development +git branch integration +git branch production + +# Make use of a branch, for instance production +git checkout production +-------------------------------------------------------------------------------- + +Similar if you want to have cdist checked out at multiple machines, +you can clone it multiple times: + +-------------------------------------------------------------------------------- +machine-a % git clone git://your-git-server/cdist +machine-b % git clone git://your-git-server/cdist +-------------------------------------------------------------------------------- + + SEE ALSO -------- From 9ae1026dc497a4b0cab6bcf8628bc21bafdf7437 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 14:46:15 +0100 Subject: [PATCH 0243/5465] update todos - WARNING: TODO IS almost EMPTY Signed-off-by: Nico Schottelius --- doc/dev/todo/cache | 18 ------------------ doc/dev/todo/daninext | 0 doc/dev/todo/niconext | 2 ++ doc/dev/todo/post-1.3 | 22 +++++++++++++++++++--- 4 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 doc/dev/todo/cache delete mode 100644 doc/dev/todo/daninext diff --git a/doc/dev/todo/cache b/doc/dev/todo/cache deleted file mode 100644 index b513e340..00000000 --- a/doc/dev/todo/cache +++ /dev/null @@ -1,18 +0,0 @@ -Assume you want to configure stuff one host ("monitor node"), -depending on the configuration of other hosts ("cluster nodes"). - -For instance, the monitor host would like to know, -which hosts are configured with the provider -"apache" and option --start true. - -This requires the monitor node to be able to -query all other configured nodes. It can't -ask for all hosts, because cdist does not -know which hosts are configured or may exist. - -Example implementation - -If cdist keeps ("caches") the configuration of every -node it configures, each new node can query the -cache for existing nodes that acquired the given -configuration. diff --git a/doc/dev/todo/daninext b/doc/dev/todo/daninext deleted file mode 100644 index e69de29b..00000000 diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index e69de29b..6179c017 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -0,0 +1,2 @@ +- think about using .cdist for meta information? + - otherwise: parameter, gencode-local, etc. are not valid object id stuff diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index 284b56b4..82a6dd3d 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -1,6 +1,22 @@ -Core: - - think about using .cdist for meta information? - - otherwise: parameter, gencode-local, etc. are not valid object id stuff +Cache: + Assume you want to configure stuff one host ("monitor node"), + depending on the configuration of other hosts ("cluster nodes"). + + For instance, the monitor host would like to know, + which hosts are configured with the provider + "apache" and option --start true. + + This requires the monitor node to be able to + query all other configured nodes. It can't + ask for all hosts, because cdist does not + know which hosts are configured or may exist. + + Example implementation + + If cdist keeps ("caches") the configuration of every + node it configures, each new node can query the + cache for existing nodes that acquired the given + configuration. Types to be written/extended: - __ssh-keys (host/user) From 7f3e22239f2464ac831f0247e212496470789d0c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 21 Mar 2011 16:18:04 +0100 Subject: [PATCH 0244/5465] add dot-cdist to cdist-config Signed-off-by: Nico Schottelius --- bin/cdist-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 946c88b4..a5eb9485 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -44,6 +44,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_code:=code} : ${__cdist_name_code_finished:=.codedone} : ${__cdist_name_conf_dir:=conf} +: ${__cdist_name_dot_cdist:=.cdist} : ${__cdist_name_explorer:=explorer} : ${__cdist_name_gencode:=gencode} : ${__cdist_name_gencode_local:=local} @@ -231,7 +232,7 @@ __cdist_object_id_from_object() __cdist_object_dir() { - __cdist_object_dir="${__cdist_out_object_dir}/$1" + __cdist_object_dir="${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" echo "$__cdist_object_dir" } From 2007fc17ccb2d960483903a3cf6432bc8529e4c6 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 21 Mar 2011 17:24:09 +0100 Subject: [PATCH 0245/5465] README: users++ Signed-off-by: Steven Armstrong --- README | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README b/README index 211f1073..b637c50f 100644 --- a/README +++ b/README @@ -214,3 +214,9 @@ Yes, I'm actually eating my own dogfood and currently managing with cdist on a total of **5** production machines of the [Systems Group](http://www.systems.ethz.ch) at the [ETH Zurich](http://www.ethz.ch). + +### Steven Armstrong, CBRG ETH Zurich + +The CBRG is managing most of their compute clusters with cdist. + + From 29edf58809d0b2e7ce3c3542005236da3bc05cd2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 00:43:44 +0100 Subject: [PATCH 0246/5465] +commercial support Signed-off-by: Nico Schottelius --- README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README b/README index b637c50f..f5345fde 100644 --- a/README +++ b/README @@ -187,6 +187,11 @@ You can join the development ***IRC channel*** Bug reports, questions, patches, etc. should be send to the [cdist mailing list](http://l.schottelius.org/mailman/listinfo/cdist). +## Commercial support + +You can request commercial support for cdist from +[my company](http://firma.schottelius.org/english/). + ## Used by If you're using cdist, feel free to send a report to the mailing list. From 8a76143e33f46dfabbbd359583a8f4daa3169bbb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 08:29:59 +0100 Subject: [PATCH 0247/5465] shrink cdist env and make it usable for . ./bin/cdist-env (in sh) Signed-off-by: Nico Schottelius --- bin/cdist-env | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/bin/cdist-env b/bin/cdist-env index 3a477e85..2aac5e6b 100755 --- a/bin/cdist-env +++ b/bin/cdist-env @@ -21,23 +21,13 @@ # Setup environment for use with cdist - must be standalone! # -__cdist_pwd="$(pwd -P)" -__cdist_mydir="${0%/*}"; -__cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" -__cdist_myname=${0##*/}; -__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" +export PATH="$(cd "${0%/*}" && pwd -P):$PATH" +export MANPATH="$(cd "${0%/*}/../doc/man" && pwd -P):$MANPATH" -shell_binary=${SHELL##*/} - -NEWPATH="$__cdist_abs_mydir:$PATH" -cd "$__cdist_abs_mydir/../doc/man" -NEWMANPATH="$(pwd -P):$MANPATH" - -# Match csh, tcsh to handle differently -if [ "$(echo $shell_binary | grep 'csh$')" ]; then - echo setenv PATH $NEWPATH \; - echo setenv MANPATH $NEWMANPATH +if [ "$(echo ${SHELL##*/} | grep 'csh$')" ]; then + echo setenv PATH $PATH \; + echo setenv MANPATH $MANPATH else - echo export PATH=$NEWPATH - echo export MANPATH=$NEWMANPATH + echo export PATH=$PATH + echo export MANPATH=$MANPATH fi From e921986e32f9fb049a4b22f4de925eedfb797a73 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 08:57:19 +0100 Subject: [PATCH 0248/5465] remove double slash in __cdist_object in bin/cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 063afd92..9f272569 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -40,7 +40,13 @@ fi echo "$__cdist_object_id" | grep -q "^${__cdist_sane_regexp}\$" || \ __cdist_usage "Insane object id, ${__cdist_object_id}." -__cdist_object="${__cdist_type}/${__cdist_object_id}" +# Remove double slash if id begins with / +if [ "$(echo $__cdist_object_id | grep "^/")" ]; then + __cdist_object="${__cdist_type}${__cdist_object_id}" +else + __cdist_object="${__cdist_type}/${__cdist_object_id}" +fi + __cdist_ddir="$(__cdist_object_dir "$__cdist_object")" __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" From e4190c3d0a9d44faef0f4fc17cbc787cf5b4c64a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 09:59:41 +0100 Subject: [PATCH 0249/5465] add --recursive to __directory (man, gencode, parameter, changelog) Signed-off-by: Nico Schottelius --- conf/type/__directory/gencode-remote | 10 ++++++++-- conf/type/__directory/man.text | 8 ++++++++ conf/type/__directory/parameter/optional | 1 + doc/changelog | 3 +++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/conf/type/__directory/gencode-remote b/conf/type/__directory/gencode-remote index 6d226aae..a5458b4b 100755 --- a/conf/type/__directory/gencode-remote +++ b/conf/type/__directory/gencode-remote @@ -36,6 +36,12 @@ if [ -f "$__object/parameter/parents" ]; then fi fi +if [ -f "$__object/parameter/recursive" ]; then + if [ yes = "$(cat "$__object/parameter/recursive")" ]; then + recursive="-R" + fi +fi + # Only create if not already existent if [ no = "$(cat "$__object/explorer/exists")" ]; then echo mkdir $mkdiropt \"$destination\" @@ -48,10 +54,10 @@ fi # Group if [ -f "$__object/parameter/group" ]; then - echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" + echo chgrp $recursive \"$(cat "$__object/parameter/group")\" \"$destination\" fi # Owner if [ -f "$__object/parameter/owner" ]; then - echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" + echo chown $recursive \"$(cat "$__object/parameter/owner")\" \"$destination\" fi diff --git a/conf/type/__directory/man.text b/conf/type/__directory/man.text index 02a41754..8e1484de 100644 --- a/conf/type/__directory/man.text +++ b/conf/type/__directory/man.text @@ -32,6 +32,11 @@ owner:: parents:: Whether to create parents as well (mkdir -p behaviour). Must be yes or no. +recursive:: + If supplied the chgrp and chown call will run recursively. + This does *not* influence the behaviour of chmod. + Must be yes or no. + EXAMPLES -------- @@ -45,6 +50,9 @@ __directory /etc --owner root --group root --mode 0755 # Create nfs service directory, including parents __directory /home/services/nfs --parents yes + +# Change permissions recursively +__directory /home/services --recursive yes --owner root --group root -------------------------------------------------------------------------------- diff --git a/conf/type/__directory/parameter/optional b/conf/type/__directory/parameter/optional index 752c3989..247e2f64 100644 --- a/conf/type/__directory/parameter/optional +++ b/conf/type/__directory/parameter/optional @@ -2,3 +2,4 @@ group mode owner parents +recursive diff --git a/doc/changelog b/doc/changelog index 5b6b03a9..f120e47d 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.3.3: + * Add --recursive to __directory + 1.3.2: 2011-03-21 * Add --source to __motd * Add --preseed to __package_apt From 6a0a5fb09c98e00c462cb6a2ea581d129b81d0ad Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 12:37:32 +0100 Subject: [PATCH 0250/5465] +private Signed-off-by: Nico Schottelius --- README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index f5345fde..e7345a78 100644 --- a/README +++ b/README @@ -202,7 +202,7 @@ Interesting information are for instance * What are the pros/cons you see in cdist? * General comments/critics -### Nico Schottelius, Systems Group ETH Zurich +### Nico Schottelius, Systems Group ETH Zurich and privately Yes, I'm actually eating my own dogfood and currently managing @@ -216,9 +216,9 @@ Yes, I'm actually eating my own dogfood and currently managing * [xfce](http://www.xfce.org/) (lightweight desktop environment) * [slim](http://slim.berlios.de/) (graphical login manager for X11) -with cdist on a total of **5** production machines of the +with cdist on a total of **9** production machines of the [Systems Group](http://www.systems.ethz.ch) at the -[ETH Zurich](http://www.ethz.ch). +[ETH Zurich](http://www.ethz.ch) as well at home. ### Steven Armstrong, CBRG ETH Zurich From 221e0341ae2456cb7457718cf5ab7241113b8ceb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 12:37:40 +0100 Subject: [PATCH 0251/5465] +todo Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.3 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index 82a6dd3d..301dfdb2 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -1,3 +1,9 @@ +Core: + - allow redefine object, if everything same + - support $__self = relative_type/object_id + - .cdist + - cache + Cache: Assume you want to configure stuff one host ("monitor node"), depending on the configuration of other hosts ("cluster nodes"). @@ -23,4 +29,5 @@ Types to be written/extended: - __service - __file_edit - regexp replace (can probably cover all?) + -> aka sed. - __cron From 0c593f5c5beada213ee7cbe7e106e495ca76bab6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 16:48:02 +0100 Subject: [PATCH 0252/5465] -created in text Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index a288b189..9a2fd303 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -53,7 +53,7 @@ cdist-manifest-run-all "$__cdist_target_host" cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" -echo "Transferring created objects to $__cdist_target_host ..." +echo "Transferring objects to $__cdist_target_host ..." cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ "${__cdist_remote_out_object_base_dir}" From 0c8432fd4806cc161214bfa0767215dba2d130f8 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 08:11:56 +0100 Subject: [PATCH 0253/5465] add ideas about dependecies Signed-off-by: Steven Armstrong --- doc/dev/logs/2011-03-23.autorequire | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/dev/logs/2011-03-23.autorequire diff --git a/doc/dev/logs/2011-03-23.autorequire b/doc/dev/logs/2011-03-23.autorequire new file mode 100644 index 00000000..6660d0eb --- /dev/null +++ b/doc/dev/logs/2011-03-23.autorequire @@ -0,0 +1,32 @@ + +Ziel: type __gugus soll abhaengig von type __foo sein + + +-------------------------------------------------------------------------------- + +__foo/manifest + + __file /nice/file --source /some/where + __file /nice/other/file --source /some/where/else + __package gurk --state installed + +-------------------------------------------------------------------------------- + +a) ohne autorequire + +__gugus/manifest + + require="__file/nice/file __file/nice/other/file __package/gurk" __file /whatever + +-------------------------------------------------------------------------------- + +b) mit autorequire + +__gugus/manifest + + require="__foo/someid" __file /whatever + +-------------------------------------------------------------------------------- + +Behauptung: __gugus sollte nicht ueber die internas von __foo bescheid wissen muessen + From ab7635512827f82993b97ae9795f8273361900d0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 09:29:41 +0100 Subject: [PATCH 0254/5465] add hint to . ./bin/cdist-env Signed-off-by: Nico Schottelius --- doc/man/cdist-env.text | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/man/cdist-env.text b/doc/man/cdist-env.text index 8d10aa85..cf54d363 100644 --- a/doc/man/cdist-env.text +++ b/doc/man/cdist-env.text @@ -32,7 +32,10 @@ in csh variants (csh, tcsh): eval `./bin/cdist-env` -------------------------------------------------------------------------------- -Replace "./" with the checkout directory of cdist. +For bourne shell, the is also a shorter version: +-------------------------------------------------------------------------------- +. ./bin/cdist-env +-------------------------------------------------------------------------------- SEE ALSO From 1924e0cc6374bb872d89c92c9579a5f97e00e723 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 10:32:20 +0100 Subject: [PATCH 0255/5465] +log: should a type manifest be able to use type explorer values? Signed-off-by: Steven Armstrong --- doc/dev/logs/2011-03-23.manifest_use_explorer | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/dev/logs/2011-03-23.manifest_use_explorer diff --git a/doc/dev/logs/2011-03-23.manifest_use_explorer b/doc/dev/logs/2011-03-23.manifest_use_explorer new file mode 100644 index 00000000..26571027 --- /dev/null +++ b/doc/dev/logs/2011-03-23.manifest_use_explorer @@ -0,0 +1,22 @@ +== Henne/Ei Problem == +manifest will explorer benutzen der noch gar nicht existiert, +weil explorer ja auch object benutzen kann/soll/will welches erst von manifest +erzuegt wird. + + +-------------------------------------------------------------------------------- + +__foo/manifest + + state_should="$(cat "$__object/parameter/state")" + state_is="$(cat "$__object/explorer/state")" + # BANG -> $__object/explorer/state does not exist at this point + + if [ "$state_should" != "$state_is" ]; then + __file /some/file --source /some/source + fi + + + + + From 0a028785c315c5cf32a470d19022057046b9b286 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 10:39:45 +0100 Subject: [PATCH 0256/5465] remove check whether object already exists Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 9f272569..0b9a10ed 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -53,10 +53,10 @@ __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" # Append id for error messages __cdist_myname="$__cdist_myname ($__cdist_object_id)" -if [ -e "${__cdist_ddir}" ]; then - source="$(__cdist_object_source "${__cdist_ddir}")" - __cdist_exit_err "${__cdist_object} already exists (source: $source)" -fi +# if [ -e "${__cdist_ddir}" ]; then +# source="$(__cdist_object_source "${__cdist_ddir}")" +# __cdist_exit_err "${__cdist_object} already exists (source: $source)" +# fi mkdir -p "${__cdist_ddir}" mkdir -p "${__cdist_parameter_dir}" From 19e6ea9c801704d40dfe33df6c978d33b4e19c53 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 10:47:13 +0100 Subject: [PATCH 0257/5465] begin restructure, use name __cdist_object_self for type/object_id combination Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 0b9a10ed..17b6cae6 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -27,26 +27,39 @@ . cdist-config set -eu +################################################################################ +# Prepare object and type +# + __cdist_type="$__cdist_myname" # Find out whether type is a singleton or regular type if [ -f "$(__cdist_type_singleton "$__cdist_type")" ]; then - __cdist_object_id="singleton" + __cdist_object_id="$__cdist_name_singleton" else [ $# -ge 1 ] || __cdist_usage " " __cdist_object_id="$1"; shift fi -echo "$__cdist_object_id" | grep -q "^${__cdist_sane_regexp}\$" || \ +# Verify object id +__cdist_object_id_sane=$(echo "$__cdist_object_id" | grep "^${__cdist_sane_regexp}\$") +if [ -z "$__cdist_object_id_sane" ]; then __cdist_usage "Insane object id, ${__cdist_object_id}." - -# Remove double slash if id begins with / -if [ "$(echo $__cdist_object_id | grep "^/")" ]; then - __cdist_object="${__cdist_type}${__cdist_object_id}" -else - __cdist_object="${__cdist_type}/${__cdist_object_id}" fi +# Prevent double slash if id begins with / +if [ "$(echo $__cdist_object_id | grep "^/")" ]; then + __cdist_object_self="${__cdist_type}${__cdist_object_id}" +else + __cdist_object_self="${__cdist_type}/${__cdist_object_id}" +fi + +################################################################################ +# Verify object +# + + + __cdist_ddir="$(__cdist_object_dir "$__cdist_object")" __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" From 117232ce9d599ab1929e5261a8c5d20b9e170701 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:05:02 +0100 Subject: [PATCH 0258/5465] begin rewrite of cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 17b6cae6..8be6e819 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -55,28 +55,41 @@ else fi ################################################################################ -# Verify object +# Internal quirks # - - -__cdist_ddir="$(__cdist_object_dir "$__cdist_object")" -__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" - # Append id for error messages __cdist_myname="$__cdist_myname ($__cdist_object_id)" -# if [ -e "${__cdist_ddir}" ]; then -# source="$(__cdist_object_source "${__cdist_ddir}")" +################################################################################ +# Create object in tmpdir +# + +__cdist_new_object_dir="$__cdist_tmp_dir/$__cdist_object_self" +mkdir -p "${__cdist_new_object_dir}" + +# Record source +echo "${__cdist_manifest}" > "${__cdist_new_object_dir}/${__cdist_name_object_source}" + + + +################################################################################ +# Try to merge object into global object directory +# + +# +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" + +__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" + +# if [ -e "${__cdist_new_object_dir}" ]; then +# source="$(__cdist_object_source "${__cdist_new_object_dir}")" # __cdist_exit_err "${__cdist_object} already exists (source: $source)" # fi -mkdir -p "${__cdist_ddir}" mkdir -p "${__cdist_parameter_dir}" -# Record (correct ;-) source -echo "${__cdist_manifest}" > "${__cdist_ddir}/${__cdist_name_object_source}" - # Record parameters to tmpdir tempparameter="${__cdist_tmp_dir}/${__cdist_name_parameter}" mkdir -p "$tempparameter" From 359e252ef7b840e7348aa0f8ae2361b6e02b3033 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:12:39 +0100 Subject: [PATCH 0259/5465] begin to sort cdist-config by alphabet Signed-off-by: Nico Schottelius --- bin/cdist-config | 216 +++++++++++++++++++++++++---------------------- 1 file changed, 114 insertions(+), 102 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index a5eb9485..9a7cea91 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -134,7 +134,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") : ${__cdist_remote_out_object_base_dir:=$__cdist_remote_out_dir/$__cdist_name_object} ################################################################################ -# Function list +# Internal functions # __cdist_debug_echo() { @@ -143,6 +143,12 @@ __cdist_debug_echo() fi } +__cdist_exec_fail_on_error() +{ + sh -e "$@" + [ "$?" -eq 0 ] || __cdist_exit_err "Error: $1 exited non-zero." +} + __cdist_exit_err() { echo "$@" >&2 @@ -170,76 +176,9 @@ __cdist_init_deploy() ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir" } -__cdist_type_has_explorer() -{ - # We only create output, if there's at least one explorer - # and can thus be used as a boolean ;-) - if [ -d "$(__cdist_type_explorer_dir "$1")" ]; then - ls -1 "$(__cdist_type_explorer_dir "$1")" - fi -} - -__cdist_type_dir() -{ - echo "${__cdist_type_dir}/$1" -} - -__cdist_type_explorer_dir() -{ - echo "${__cdist_type_dir}/$1/${__cdist_name_explorer}" -} - -__cdist_remote_type_explorer_dir() -{ - echo "${__cdist_remote_type_dir}/$1/${__cdist_name_explorer}" -} - -__cdist_type_gencode() -{ - echo "${__cdist_type_dir}/$1/${__cdist_name_gencode}" -} - -__cdist_type_singleton() -{ - echo "${__cdist_type_dir}/$1/${__cdist_name_singleton}" -} - -__cdist_type_parameter_dir() -{ - echo "$(__cdist_type_dir "$1")/${__cdist_name_parameter}" -} - -# Shorthand for required and optional -__cdist_type_parameter_required() -{ - echo "$(__cdist_type_parameter_dir "$1")/$__cdist_name_parameter_required" -} - -__cdist_type_parameter_optional() -{ - echo "$(__cdist_type_parameter_dir "$1")/$__cdist_name_parameter_optional" -} - -__cdist_type_from_object() -{ - echo "${1%%/*}" -} - -__cdist_object_id_from_object() -{ - echo "${1#*/}" -} - -__cdist_object_dir() -{ - __cdist_object_dir="${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" - echo "$__cdist_object_dir" -} - -__cdist_remote_object_dir() -{ - echo "${__cdist_remote_out_object_base_dir}/$1" -} +################################################################################ +# Object +# __cdist_object_code() { @@ -251,31 +190,6 @@ __cdist_object_code_finished() echo "$(__cdist_object_dir "$1")/${__cdist_name_code_finished}" } -__cdist_object_parameter_dir() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}" -} - -__cdist_remote_object_parameter_dir() -{ - echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}" -} - -__cdist_object_require() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_require}" -} - -__cdist_object_type_explorer_dir() -{ - echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" -} - -__cdist_remote_object_type_explorer_dir() -{ - echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_explorer}" -} - # Find objects, remove ./ and /MARKER __cdist_object_list() { @@ -298,19 +212,117 @@ __cdist_object_source() cat "${object_dir}/${__cdist_name_object_source}" } -__cdist_exec_fail_on_error() +__cdist_object_parameter_dir() { - sh -e "$@" - [ "$?" -eq 0 ] || __cdist_exit_err "Error: $1 exited non-zero." + echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}" +} + +__cdist_remote_object_parameter_dir() +{ + echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}" +} + +__cdist_object_require() +{ + echo "$(__cdist_object_dir "$1")/${__cdist_name_require}" +} + +__cdist_object_type_explorer_dir() +{ + echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" +} + +__cdist_object_id_from_object() +{ + echo "${1#*/}" +} + +__cdist_object_dir() +{ + __cdist_object_dir="${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" + echo "$__cdist_object_dir" +} + +################################################################################ +# Remote +# + +__cdist_remote_object_dir() +{ + echo "${__cdist_remote_out_object_base_dir}/$1" +} + +__cdist_remote_object_type_explorer_dir() +{ + echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_explorer}" } +__cdist_remote_type_explorer_dir() +{ + echo "${__cdist_remote_type_dir}/$1/${__cdist_name_explorer}" +} + + +################################################################################ +# Temp clenup +# __cdist_tmp_removal() { rm -rf "${__cdist_tmp_dir}" } -################################################################################ -# Trap for tmp removal -# trap __cdist_tmp_removal EXIT + + +################################################################################ +# Type +# +__cdist_type_dir() +{ + echo "${__cdist_type_dir}/$1" +} + +__cdist_type_explorer_dir() +{ + echo "${__cdist_type_dir}/$1/${__cdist_name_explorer}" +} + +__cdist_type_from_object() +{ + echo "${1%%/*}" +} + +__cdist_type_has_explorer() +{ + # We only create output, if there's at least one explorer + # and can thus be used as a boolean ;-) + if [ -d "$(__cdist_type_explorer_dir "$1")" ]; then + ls -1 "$(__cdist_type_explorer_dir "$1")" + fi +} + +__cdist_type_gencode() +{ + echo "${__cdist_type_dir}/$1/${__cdist_name_gencode}" +} + +__cdist_type_parameter_dir() +{ + echo "$(__cdist_type_dir "$1")/${__cdist_name_parameter}" +} + +__cdist_type_parameter_optional() +{ + echo "$(__cdist_type_parameter_dir "$1")/$__cdist_name_parameter_optional" +} + +__cdist_type_parameter_required() +{ + echo "$(__cdist_type_parameter_dir "$1")/$__cdist_name_parameter_required" +} + +__cdist_type_singleton() +{ + echo "${__cdist_type_dir}/$1/${__cdist_name_singleton}" +} From 6f67911a0b9c5e06a274e38fb0c12c1e8d5d392d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:19:05 +0100 Subject: [PATCH 0260/5465] sort object area in cdist-config Signed-off-by: Nico Schottelius --- bin/cdist-config | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 9a7cea91..3f7d7c3c 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -190,6 +190,18 @@ __cdist_object_code_finished() echo "$(__cdist_object_dir "$1")/${__cdist_name_code_finished}" } +__cdist_object_dir() +{ + __cdist_object_dir="${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" + echo "$__cdist_object_dir" +} + + +__cdist_object_id_from_object() +{ + echo "${1#*/}" +} + # Find objects, remove ./ and /MARKER __cdist_object_list() { @@ -205,44 +217,26 @@ __cdist_object_list() } -__cdist_object_source() -{ - local object_dir="$1"; shift - - cat "${object_dir}/${__cdist_name_object_source}" -} - __cdist_object_parameter_dir() { echo "$(__cdist_object_dir "$1")/${__cdist_name_parameter}" } -__cdist_remote_object_parameter_dir() -{ - echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}" -} - __cdist_object_require() { echo "$(__cdist_object_dir "$1")/${__cdist_name_require}" } +__cdist_object_source() +{ + cat "$1/${__cdist_name_object_source}" +} + __cdist_object_type_explorer_dir() { echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" } -__cdist_object_id_from_object() -{ - echo "${1#*/}" -} - -__cdist_object_dir() -{ - __cdist_object_dir="${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" - echo "$__cdist_object_dir" -} - ################################################################################ # Remote # @@ -252,6 +246,11 @@ __cdist_remote_object_dir() echo "${__cdist_remote_out_object_base_dir}/$1" } +__cdist_remote_object_parameter_dir() +{ + echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_parameter}" +} + __cdist_remote_object_type_explorer_dir() { echo "$(__cdist_remote_object_dir "$1")/${__cdist_name_explorer}" From ab02adf01a67b71dc191f6f95215628022224cd8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:27:38 +0100 Subject: [PATCH 0261/5465] abort after manifest-run-init to verify new methods Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 9a2fd303..34662081 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -49,6 +49,9 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" + +exit 1 + cdist-manifest-run-all "$__cdist_target_host" cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" From 69453feaa51ac322451bad26be9bbb01ba073f35 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:30:22 +0100 Subject: [PATCH 0262/5465] add __cdist_object_source_add Signed-off-by: Nico Schottelius --- bin/cdist-config | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 3f7d7c3c..71bc3672 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -227,9 +227,19 @@ __cdist_object_require() echo "$(__cdist_object_dir "$1")/${__cdist_name_require}" } +__cdist_object_source_name() +{ + echo "$1/${__cdist_name_object_source}" +} + __cdist_object_source() { - cat "$1/${__cdist_name_object_source}" + cat "$(__cdist_object_source_name "$1")" +} + +__cdist_object_source_add() +{ + echo "$__cdist_manifest" >> "$(__cdist_object_source_name "$1")" } __cdist_object_type_explorer_dir() From a6702cc8045d3d3d3d2cf3455e5f1d31e80ef116 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:32:22 +0100 Subject: [PATCH 0263/5465] do not setup variables in cdist-config Signed-off-by: Nico Schottelius --- bin/cdist-config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 71bc3672..531e4384 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -192,8 +192,7 @@ __cdist_object_code_finished() __cdist_object_dir() { - __cdist_object_dir="${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" - echo "$__cdist_object_dir" + echo "${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" } From b46850cd12398ca5cf1392d53e3b9696e559b159 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:39:17 +0100 Subject: [PATCH 0264/5465] begin to reintegrate parameter recording Signed-off-by: Nico Schottelius --- bin/cdist-config | 1 - bin/cdist-type-emulator | 52 +++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 531e4384..fbdbe719 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -213,7 +213,6 @@ __cdist_object_list() find . -name "$__cdist_name_object_source" | \ sed -e 's;^./;;' -e "s;/${__cdist_name_object_source}\$;;" ) - } __cdist_object_parameter_dir() diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 8be6e819..06369895 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -62,38 +62,28 @@ fi __cdist_myname="$__cdist_myname ($__cdist_object_id)" ################################################################################ -# Create object in tmpdir +# Create object in tmpdir first # -__cdist_new_object_dir="$__cdist_tmp_dir/$__cdist_object_self" -mkdir -p "${__cdist_new_object_dir}" +# Save original destination +__cdist_out_object_dir_orig="$__cdist_out_object_dir" + +# Store to tmp now +__cdist_out_object_dir="$__cdist_tmp_dir" + +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" + +set -x # Record source -echo "${__cdist_manifest}" > "${__cdist_new_object_dir}/${__cdist_name_object_source}" +mkdir -p "${__cdist_object_dir}" +__cdist_object_source_add "${__cdist_object_dir}" - -################################################################################ -# Try to merge object into global object directory -# - -# -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" - +# Record parameter __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" - -# if [ -e "${__cdist_new_object_dir}" ]; then -# source="$(__cdist_object_source "${__cdist_new_object_dir}")" -# __cdist_exit_err "${__cdist_object} already exists (source: $source)" -# fi - mkdir -p "${__cdist_parameter_dir}" -# Record parameters to tmpdir -tempparameter="${__cdist_tmp_dir}/${__cdist_name_parameter}" -mkdir -p "$tempparameter" - while [ $# -gt 0 ]; do opt="$1"; shift @@ -109,6 +99,14 @@ while [ $# -gt 0 ]; do echo "${value}" > "${tempparameter}/${opt_file}" done +exit 1 + + +################################################################################ +# Try to merge object into global object directory +# + + # Ensure required parameters are given if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then while read required; do @@ -144,3 +142,11 @@ for requirement in $require; do echo $requirement >> "$(__cdist_object_require "$__cdist_object")" echo Recording: $__cdist_object requires $requirement done + + +# old stuff +# if [ -e "${__cdist_new_object_dir}" ]; then +# source="$(__cdist_object_source "${__cdist_new_object_dir}")" +# __cdist_exit_err "${__cdist_object} already exists (source: $source)" +# fi + From fa0a3af2a0d2e5fd0e14c753ca76a4fbef084b28 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:44:33 +0100 Subject: [PATCH 0265/5465] correctly record parameter, remove sed (not required) Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 06369895..18171233 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -73,15 +73,15 @@ __cdist_out_object_dir="$__cdist_tmp_dir" __cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" -set -x - # Record source mkdir -p "${__cdist_object_dir}" __cdist_object_source_add "${__cdist_object_dir}" # Record parameter -__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")" +set -x + +__cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object_self")" mkdir -p "${__cdist_parameter_dir}" while [ $# -gt 0 ]; do @@ -90,15 +90,17 @@ while [ $# -gt 0 ]; do echo "$opt" | grep -q "^--${__cdist_sane_regexp}\$" || \ __cdist_usage "Provide sane options" - opt_file="$(echo $opt | sed 's/^--//')" + opt_file="${opt#--}" [ $# -ge 1 ] || __cdist_usage "Missing value for $opt" value="$1"; shift - echo "${value}" > "${tempparameter}/${opt_file}" + echo "${value}" > "${__cdist_parameter_dir}/${opt_file}" done +find $__cdist_object_dir + exit 1 From d8f7ebc73f352734018b6552ff72231903c47296 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:45:50 +0100 Subject: [PATCH 0266/5465] move .dotfiles to .cdist/dotfiles (without dot) Signed-off-by: Nico Schottelius --- bin/cdist-config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index fbdbe719..21b797bb 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -42,7 +42,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_bin:=bin} : ${__cdist_name_code:=code} -: ${__cdist_name_code_finished:=.codedone} +: ${__cdist_name_code_finished:=codedone} : ${__cdist_name_conf_dir:=conf} : ${__cdist_name_dot_cdist:=.cdist} : ${__cdist_name_explorer:=explorer} @@ -54,9 +54,9 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_init:=init} : ${__cdist_name_manifest:=manifest} : ${__cdist_name_object:=object} -: ${__cdist_name_object_finished:=.done} +: ${__cdist_name_object_finished:=done} : ${__cdist_name_object_id:=object_id} -: ${__cdist_name_object_source:=.source} +: ${__cdist_name_object_source:=source} : ${__cdist_name_out_dir:=out} : ${__cdist_name_parameter:=parameter} : ${__cdist_name_parameter_required:=required} From 6e5ed1c8e80e1afb184b2bc498ea080ad5feca12 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 11:56:19 +0100 Subject: [PATCH 0267/5465] re-include requirement recording Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 18171233..7cb8e450 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -99,16 +99,20 @@ while [ $# -gt 0 ]; do echo "${value}" > "${__cdist_parameter_dir}/${opt_file}" done -find $__cdist_object_dir +# Record requirements +# it's fine, if it's not set +set +u +for requirement in $require; do + echo $requirement >> "$(__cdist_object_require "$__cdist_object_self")" + echo Object $__cdist_object_self requires $requirement +done + exit 1 - - ################################################################################ -# Try to merge object into global object directory +# Check newly created object # - # Ensure required parameters are given if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then while read required; do @@ -133,17 +137,12 @@ fi cd "${tempparameter}" other="$(ls)" +exit 1 + if [ "$other" ]; then __cdist_usage "Unsupported parameter: $other" fi -# Record requirements -# it's fine, if it's not set -set +u -for requirement in $require; do - echo $requirement >> "$(__cdist_object_require "$__cdist_object")" - echo Recording: $__cdist_object requires $requirement -done # old stuff From 34b5e44091576579d4d74f55bdeba71a22205a1d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 12:12:03 +0100 Subject: [PATCH 0268/5465] re-include parameter check Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 53 ++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 7cb8e450..10e0534d 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -79,8 +79,6 @@ __cdist_object_source_add "${__cdist_object_dir}" # Record parameter -set -x - __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object_self")" mkdir -p "${__cdist_parameter_dir}" @@ -106,44 +104,55 @@ for requirement in $require; do echo $requirement >> "$(__cdist_object_require "$__cdist_object_self")" echo Object $__cdist_object_self requires $requirement done +set -u - -exit 1 ################################################################################ # Check newly created object # +set -x + +# # Ensure required parameters are given +# if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then while read required; do - if [ ! -f "${tempparameter}/${required}" ]; then + if [ ! -f "${__cdist_parameter_dir}/${required}" ]; then __cdist_usage "Missing required parameter $required" fi - - mv "${tempparameter}/${required}" "${__cdist_parameter_dir}" done < "$(__cdist_type_parameter_required "$__cdist_type")" fi -# Allow optional parameters -if [ -f "$(__cdist_type_parameter_optional "$__cdist_type")" ]; then - while read optional; do - if [ -f "${tempparameter}/${optional}" ]; then - mv "${tempparameter}/${optional}" "${__cdist_parameter_dir}" - fi - done < "$(__cdist_type_parameter_optional "$__cdist_type")" -fi +# +# Ensure that only optional or required parameters are given +# -# Error out on other paramaters -cd "${tempparameter}" -other="$(ls)" +if [ -f "$(__cdist_type_parameter_optional "$__cdist_type")" ]; then + cat "$(__cdist_type_parameter_optional "$__cdist_type")" > \ + "$__cdist_tmp_file" +fi + +if [ -f "$(__cdist_type_parameter_required "$__cdist_type")" ]; then + cat "$(__cdist_type_parameter_required "$__cdist_type")" >> \ + "$__cdist_tmp_file" +fi + +cd "$__cdist_parameter_dir" +for parameter in $(ls -1); do + is_valid=$(grep "^$parameter\$" "$__cdist_tmp_file") + + [ "$is_valid" ] || "Unknown parameter $parameter" +done exit 1 -if [ "$other" ]; then - __cdist_usage "Unsupported parameter: $other" -fi - +################################################################################ +# Merge object +# +# +# Ensure that only optional or required parameters are given +# # old stuff # if [ -e "${__cdist_new_object_dir}" ]; then From 2ef17f9bf20ae743908fb90d361bddb4dc00c8ef Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 12:15:00 +0100 Subject: [PATCH 0269/5465] begin merge section in cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 10e0534d..0b709a13 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -149,14 +149,18 @@ exit 1 ################################################################################ # Merge object # +# Save original destination +__cdist_out_object_dir="$__cdist_out_object_dir_orig" + +__cdist_object_destination_dir="$(__cdist_object_dir "$__cdist_object_self")" # -# Ensure that only optional or required parameters are given +# If the object already exists and is exactly the same, merge it. Otherwise fail. # +if [ -e "${__cdist_new_object_dir}" ]; then + source="$(__cdist_object_source "${__cdist_new_object_dir}")" + __cdist_exit_err "${__cdist_object} already exists (source: $source)" -# old stuff -# if [ -e "${__cdist_new_object_dir}" ]; then -# source="$(__cdist_object_source "${__cdist_new_object_dir}")" -# __cdist_exit_err "${__cdist_object} already exists (source: $source)" -# fi + +fi From 92860706b2d643d5b142db5e82134e9e1066ed7d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 12:20:09 +0100 Subject: [PATCH 0270/5465] import merge code from cdist-manifest-run-all into cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 53 +++++++++++++++++++++++++++++++++++++++++ doc/dev/todo/niconext | 3 +++ 2 files changed, 56 insertions(+) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 0b709a13..8451ec9d 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -164,3 +164,56 @@ if [ -e "${__cdist_new_object_dir}" ]; then fi + + +# -------------------------------------------------------------------------------- + + # Verify no conflicting objects have been created + while read __cdist_new_object; do + __cdist_object_found=$(grep "^$__cdist_new_object\$" "$__cdist_objects_list" || true) + + if [ "$__cdist_object_found" ]; then + __cdist_object_source="$(cat "$(__cdist_object_dir "$__cdist_new_object")/${__cdist_name_object_source}")" + __cdist_exit_err "${__cdist_manifest}: ${__cdist_new_object} already exists (source: $__cdist_object_source)" + fi + done < "$__cdist_new_objects_list" + + # Safe harbour: We can merge all objects into main tree + # Merge = mkdir + mv parameters and source information + while read __cdist_new_object; do + [ "$__cdist_new_objects_created" = "n" ] && __cdist_new_objects_created="y" + + # where to save the newly created object + __cdist_object_dir="$__cdist_out_object_dir/$__cdist_new_object" + mkdir -p "$__cdist_object_dir" + + # Move parts of the object (CANNOT MOVE COMPLETLEY, HIERACHY!) + __cdist_new_object_dir="$__cdist_new_objects_dir/$__cdist_new_object" + + # Source + mv "${__cdist_new_object_dir}/${__cdist_name_object_source}" \ + "$__cdist_object_dir" + + # Explorer, Parameter, Require + for __cdist_object_file in \ + ${__cdist_name_explorer} \ + ${__cdist_name_parameter} \ + ${__cdist_name_require} \ + ; do + + if [ -e "${__cdist_new_object_dir}/${__cdist_object_file}" ]; then + mv "${__cdist_new_object_dir}/${__cdist_object_file}" \ + "$__cdist_object_dir" + fi + done + done < "$__cdist_new_objects_list" + + # Remove listing and objects, otherwise the next type will reuse it... + rm -rf "$__cdist_new_objects_dir" "$__cdist_new_objects_list" + else + # Be nice, warn user if manifests exists, but is not executable + if [ -f "${__cdist_manifest}" ]; then + echo "Warning ${__cdist_manifest} exists, but is not executable." >&2 + fi + fi + fi diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 6179c017..75790fb8 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,2 +1,5 @@ - think about using .cdist for meta information? - otherwise: parameter, gencode-local, etc. are not valid object id stuff + +- check cdist-manifest-run-all whether -x -f to manifest shouldn't be better + in cdist-manifest-run From 08a53cb130b63a6a4f9d4263387060e39e9e3dcf Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 13:18:13 +0100 Subject: [PATCH 0271/5465] new type: __apt_ppa Signed-off-by: Steven Armstrong --- conf/type/__apt_ppa/explorer/state | 28 +++++++++++ .../type/__apt_ppa/files/check-apt-repository | 42 +++++++++++++++++ .../__apt_ppa/files/remove-apt-repository | 42 +++++++++++++++++ conf/type/__apt_ppa/gencode-remote | 35 ++++++++++++++ conf/type/__apt_ppa/man.text | 47 +++++++++++++++++++ conf/type/__apt_ppa/manifest | 33 +++++++++++++ conf/type/__apt_ppa/parameter/required | 1 + 7 files changed, 228 insertions(+) create mode 100755 conf/type/__apt_ppa/explorer/state create mode 100755 conf/type/__apt_ppa/files/check-apt-repository create mode 100755 conf/type/__apt_ppa/files/remove-apt-repository create mode 100755 conf/type/__apt_ppa/gencode-remote create mode 100644 conf/type/__apt_ppa/man.text create mode 100755 conf/type/__apt_ppa/manifest create mode 100644 conf/type/__apt_ppa/parameter/required diff --git a/conf/type/__apt_ppa/explorer/state b/conf/type/__apt_ppa/explorer/state new file mode 100755 index 00000000..c50af3f0 --- /dev/null +++ b/conf/type/__apt_ppa/explorer/state @@ -0,0 +1,28 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Get the current state of the ppa. +# + +name="$__object_id" + +# FIXME: on first run check-apt-repository may not be installed +check-apt-repository "$name" && echo enabled || echo disabled + diff --git a/conf/type/__apt_ppa/files/check-apt-repository b/conf/type/__apt_ppa/files/check-apt-repository new file mode 100755 index 00000000..4f4252c1 --- /dev/null +++ b/conf/type/__apt_ppa/files/check-apt-repository @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# +# Check if the given apt repository is installed or not. +# Exit with: +# 0: if it is installed +# 1: if not +# 2: on error +# + +import sys +from aptsources import distro, sourceslist +from softwareproperties import ppa + + +def is_repository_installed(repository): + #print 'repository:', repository + codename = distro.get_distro().codename + #print 'codename:', codename + (line, file) = ppa.expand_ppa_line(repository.strip(), codename) + #print 'line:', line + #print 'file:', file + sources_list = sourceslist.SourcesList() + source_entry = sourceslist.SourceEntry(line, file) + + if source_entry in sources_list: + #print 'yes' + return True + else: + #print 'no' + return False + +if __name__ == '__main__': + if (len(sys.argv) != 2): + print 'Error: need a repository as argument' + sys.exit(2) + #repository = 'ppa:freenx-team' + repository = sys.argv[1] + if is_repository_installed(repository): + sys.exit(0) + else: + sys.exit(1) + diff --git a/conf/type/__apt_ppa/files/remove-apt-repository b/conf/type/__apt_ppa/files/remove-apt-repository new file mode 100755 index 00000000..b57a07f6 --- /dev/null +++ b/conf/type/__apt_ppa/files/remove-apt-repository @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# +# Remove the given apt repository. +# +# Exit with: +# 0: if it worked +# 1: if not +# 2: on other error + + +import sys +from aptsources import distro, sourceslist +from softwareproperties import ppa +from softwareproperties.SoftwareProperties import SoftwareProperties + + +def remove_repository(repository): + #print 'repository:', repository + codename = distro.get_distro().codename + #print 'codename:', codename + (line, file) = ppa.expand_ppa_line(repository.strip(), codename) + #print 'line:', line + #print 'file:', file + source_entry = sourceslist.SourceEntry(line, file) + + try: + sp = SoftwareProperties() + sp.remove_source(source_entry) + return True + except ValueError: + print >> sys.stderr, "Error: '%s' doesn't exists in a sourcelist file" % line + return False + +if __name__ == '__main__': + if (len(sys.argv) != 2): + print >> sys.stderr, 'Error: need a repository as argument' + sys.exit(2) + repository = sys.argv[1] + if remove_repository(repository): + sys.exit(0) + else: + sys.exit(1) diff --git a/conf/type/__apt_ppa/gencode-remote b/conf/type/__apt_ppa/gencode-remote new file mode 100755 index 00000000..0e7fe163 --- /dev/null +++ b/conf/type/__apt_ppa/gencode-remote @@ -0,0 +1,35 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + +name="$__object_id" +state_should="$(cat "$__object/parameter/state")" +state_is="$(cat "$__object/explorer/state")" + +if [ "$state_should" != "$state_is" ]; then + case "$state_should" in + enabled) + echo add-apt-repository \"$name\" + ;; + disabled) + echo remove-apt-repository \"$name\" + ;; + esac +fi + diff --git a/conf/type/__apt_ppa/man.text b/conf/type/__apt_ppa/man.text new file mode 100644 index 00000000..73fabc7f --- /dev/null +++ b/conf/type/__apt_ppa/man.text @@ -0,0 +1,47 @@ +cdist-type__apt_ppa(7) +========================== +Steven Armstrong + + +NAME +---- +cdist-type__apt_ppa - Manage ppa repositories + + +DESCRIPTION +----------- +This cdist type allows manage ubuntu ppa repositories. + + +REQUIRED PARAMETERS +------------------- +state:: + The state the ppa should be in, either "enabled" or "disabled". + + +OPTIONAL PARAMETERS +------------------- +None. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Enable a ppa repository +__apt_ppa ppa:sans-intern/missing-bits --state enabled + +# Disable a ppa repository +__apt_ppa ppa:sans-intern/missing-bits --state disabled +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__apt_ppa/manifest b/conf/type/__apt_ppa/manifest new file mode 100755 index 00000000..a97ced75 --- /dev/null +++ b/conf/type/__apt_ppa/manifest @@ -0,0 +1,33 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + + +__package python-software-properties --state installed + +require="__package/python-software-properties" \ + __file /usr/local/bin/check-apt-repository \ + --source "$__type/files/check-apt-repository" \ + --mode 0755 + +require="__package/python-software-properties" \ + __file /usr/local/bin/remove-apt-repository \ + --source "$__type/files/remove-apt-repository" \ + --mode 0755 + diff --git a/conf/type/__apt_ppa/parameter/required b/conf/type/__apt_ppa/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__apt_ppa/parameter/required @@ -0,0 +1 @@ +state From 8d32e00114b7c01f7ae06334c6b498f877174e10 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 13:21:18 +0100 Subject: [PATCH 0272/5465] add more todo Signed-off-by: Nico Schottelius --- doc/dev/todo/post-1.3 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index 301dfdb2..ec186d3a 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -3,6 +3,7 @@ Core: - support $__self = relative_type/object_id - .cdist - cache + - display changes if object cannot be merged to user Cache: Assume you want to configure stuff one host ("monitor node"), @@ -31,3 +32,4 @@ Types to be written/extended: - regexp replace (can probably cover all?) -> aka sed. - __cron + From 175660872092958b9e0a30c2de0dd06e8ce440c9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 13:33:26 +0100 Subject: [PATCH 0273/5465] in theory finish new algorithm to allow same objects Signed-off-by: Nico Schottelius --- bin/cdist-config | 7 ++++++- bin/cdist-type-emulator | 33 ++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 21b797bb..e5dc46c0 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -192,7 +192,12 @@ __cdist_object_code_finished() __cdist_object_dir() { - echo "${__cdist_out_object_dir}/$1/${__cdist_name_dot_cdist}" + echo "$(__cdist_object_dir_base "$1")/${__cdist_name_dot_cdist}" +} + +__cdist_object_dir_base() +{ + echo "${__cdist_out_object_dir}/$1" } diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 8451ec9d..cf2bc418 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -77,7 +77,6 @@ __cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" mkdir -p "${__cdist_object_dir}" __cdist_object_source_add "${__cdist_object_dir}" - # Record parameter __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object_self")" mkdir -p "${__cdist_parameter_dir}" @@ -152,19 +151,43 @@ exit 1 # Save original destination __cdist_out_object_dir="$__cdist_out_object_dir_orig" -__cdist_object_destination_dir="$(__cdist_object_dir "$__cdist_object_self")" +__cdist_new_object_dir="$(__cdist_object_dir "$__cdist_object_self")" # # If the object already exists and is exactly the same, merge it. Otherwise fail. # if [ -e "${__cdist_new_object_dir}" ]; then - source="$(__cdist_object_source "${__cdist_new_object_dir}")" - __cdist_exit_err "${__cdist_object} already exists (source: $source)" - + # Allow diff to fail + set +e + diff -ru "${__cdist_object_dir}" "${__cdist_new_object_dir}" \ + > "$__cdist_tmp_file"; ret=$? + set -e + + if [ "$ret" != 0 ]; then + # Go to standard error + exec >&2 + echo "${__cdist_object_self} already exists differently." + echo "Recorded source(s):" + __cdist_object_source "${__cdist_new_object_dir}" + echo "Differences:" + cat "$__cdist_tmp_file" + __cdist_exit_err "Aborting due to object conflict." + fi + # Add ourselves, if we're compatible + __cdist_object_source_add "${__cdist_new_object_dir}" +else + # + # Move object into tree: + # Create full path minus .cdist and move .cdist + # + __cdist_new_object_base_dir="$(__cdist_object_base_dir "$__cdist_object_self")" + mkdir -p "$__cdist_new_object_base_dir" + mv "$__cdist_object_dir" "$__cdist_new_object_base_dir" fi +exit 0 # -------------------------------------------------------------------------------- From d7b765e498f7df4eca15f355223d7547083d8089 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 13:38:14 +0100 Subject: [PATCH 0274/5465] base_dir not dir_base Signed-off-by: Nico Schottelius --- bin/cdist-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index e5dc46c0..653d993f 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -192,10 +192,10 @@ __cdist_object_code_finished() __cdist_object_dir() { - echo "$(__cdist_object_dir_base "$1")/${__cdist_name_dot_cdist}" + echo "$(__cdist_object_base_dir "$1")/${__cdist_name_dot_cdist}" } -__cdist_object_dir_base() +__cdist_object_base_dir() { echo "${__cdist_out_object_dir}/$1" } From 9ba61ac0442dd038c7552ce68c956fb9c7afebb1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 13:41:56 +0100 Subject: [PATCH 0275/5465] remove debug Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 61 +---------------------------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index cf2bc418..18069b44 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -109,8 +109,6 @@ set -u # Check newly created object # -set -x - # # Ensure required parameters are given # @@ -143,12 +141,10 @@ for parameter in $(ls -1); do [ "$is_valid" ] || "Unknown parameter $parameter" done -exit 1 - ################################################################################ # Merge object # -# Save original destination +# Restore original destination __cdist_out_object_dir="$__cdist_out_object_dir_orig" __cdist_new_object_dir="$(__cdist_object_dir "$__cdist_object_self")" @@ -185,58 +181,3 @@ else mkdir -p "$__cdist_new_object_base_dir" mv "$__cdist_object_dir" "$__cdist_new_object_base_dir" fi - - -exit 0 - -# -------------------------------------------------------------------------------- - - # Verify no conflicting objects have been created - while read __cdist_new_object; do - __cdist_object_found=$(grep "^$__cdist_new_object\$" "$__cdist_objects_list" || true) - - if [ "$__cdist_object_found" ]; then - __cdist_object_source="$(cat "$(__cdist_object_dir "$__cdist_new_object")/${__cdist_name_object_source}")" - __cdist_exit_err "${__cdist_manifest}: ${__cdist_new_object} already exists (source: $__cdist_object_source)" - fi - done < "$__cdist_new_objects_list" - - # Safe harbour: We can merge all objects into main tree - # Merge = mkdir + mv parameters and source information - while read __cdist_new_object; do - [ "$__cdist_new_objects_created" = "n" ] && __cdist_new_objects_created="y" - - # where to save the newly created object - __cdist_object_dir="$__cdist_out_object_dir/$__cdist_new_object" - mkdir -p "$__cdist_object_dir" - - # Move parts of the object (CANNOT MOVE COMPLETLEY, HIERACHY!) - __cdist_new_object_dir="$__cdist_new_objects_dir/$__cdist_new_object" - - # Source - mv "${__cdist_new_object_dir}/${__cdist_name_object_source}" \ - "$__cdist_object_dir" - - # Explorer, Parameter, Require - for __cdist_object_file in \ - ${__cdist_name_explorer} \ - ${__cdist_name_parameter} \ - ${__cdist_name_require} \ - ; do - - if [ -e "${__cdist_new_object_dir}/${__cdist_object_file}" ]; then - mv "${__cdist_new_object_dir}/${__cdist_object_file}" \ - "$__cdist_object_dir" - fi - done - done < "$__cdist_new_objects_list" - - # Remove listing and objects, otherwise the next type will reuse it... - rm -rf "$__cdist_new_objects_dir" "$__cdist_new_objects_list" - else - # Be nice, warn user if manifests exists, but is not executable - if [ -f "${__cdist_manifest}" ]; then - echo "Warning ${__cdist_manifest} exists, but is not executable." >&2 - fi - fi - fi From 2d00e9d869601bf5ef454dc27762dc5d375a7b56 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 13:45:38 +0100 Subject: [PATCH 0276/5465] remove obsolete output from cdist-manifest-run Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/bin/cdist-manifest-run b/bin/cdist-manifest-run index 892f27cf..ae568c2a 100755 --- a/bin/cdist-manifest-run +++ b/bin/cdist-manifest-run @@ -23,7 +23,7 @@ # . cdist-config -[ $# -eq 3 ] || __cdist_usage " " +[ $# -eq 2 ] || __cdist_usage " " set -u __cdist_target_host="$1"; shift @@ -33,10 +33,6 @@ __cdist_manifest="$1"; shift # Export information for cdist-type-emulator or manifest # -# This is a special variable, as being used by __cdist_object_dir -# We need to adjust it, so cdist-type-emulator writes to the right location -export __cdist_out_object_dir="$1"; shift - # Config dir should not get reset - FIXME: why did I do this? export __cdist_conf_dir @@ -62,7 +58,5 @@ export PATH="${__cdist_out_type_bin_dir}:$PATH" || __cdist_exit_err "Missing manifest ${__cdist_manifest}" [ -x "${__cdist_manifest}" ] \ || __cdist_exit_err "${__cdist_manifest} needs to be executable." -mkdir -p "${__cdist_out_object_dir}" \ - || __cdist_exit_err "Cannot create output dir ${__cdist_out_object_dir}" __cdist_exec_fail_on_error "${__cdist_manifest}" From d7819b1922d63f1100f254d8fe1bf0d68b3c1be0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 13:46:24 +0100 Subject: [PATCH 0277/5465] do not use output dir in cdist-manifest-run-init Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-manifest-run-init b/bin/cdist-manifest-run-init index f895bafa..9f10c12c 100755 --- a/bin/cdist-manifest-run-init +++ b/bin/cdist-manifest-run-init @@ -31,4 +31,4 @@ __cdist_target_host="$1"; shift eval export $__cdist_name_var_manifest=\"\$__cdist_manifest_dir\" echo "Running initial manifest for $__cdist_target_host ..." -cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" "$__cdist_out_object_dir" +cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" From 1dacf779e635155a10d9d28e329e66462e419d46 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 16:33:16 +0100 Subject: [PATCH 0278/5465] HUGE cleanup of cdist-manifest-run-all Signed-off-by: Nico Schottelius --- bin/cdist-config | 5 +++ bin/cdist-manifest-run-all | 88 ++++++-------------------------------- doc/dev/todo/niconext | 3 +- 3 files changed, 20 insertions(+), 76 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 653d993f..51d68f77 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -319,6 +319,11 @@ __cdist_type_gencode() echo "${__cdist_type_dir}/$1/${__cdist_name_gencode}" } +__cdist_type_manifest() +{ + echo "${__cdist_type_dir}/$1/${__cdist_name_manifest}" +} + __cdist_type_parameter_dir() { echo "$(__cdist_type_dir "$1")/${__cdist_name_parameter}" diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index fe8263ea..f20171a7 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -17,14 +17,7 @@ # You should have received a copy of the GNU General Public License # along with cdist. If not, see . # -# -# For each created object -# run the manifest of the type (with object id), -# try to merge back newly created objects (otherwise fail), -# mark the object as being run -# and iterate until all objects are marked being run. -# -# +# Run all manifests # . cdist-config @@ -35,8 +28,6 @@ __cdist_target_host="$1"; shift __cdist_objects_list="${__cdist_tmp_dir}/objects_file" __cdist_new_objects_list="${__cdist_tmp_dir}/new_objects_file" -__cdist_new_objects_dir="${__cdist_tmp_dir}/new_objects_dir" - # Loop until we do not create new objects anymore # which is equal to all objects have been run @@ -48,82 +39,29 @@ while [ "$__cdist_new_objects_created" = "y" ]; do __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects_list" # Check every object, if we need to run it - while read __cdist_object; do + while read __cdist_object_self; do # Full path to current object - __cdist_cur_object_dir="$__cdist_out_object_dir/$__cdist_object" + __cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object_self")" + # Only the id - __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" + __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then echo "Checking manifest for ${__cdist_object} ..." - __cdist_type="$(__cdist_type_from_object "$__cdist_object")" - __cdist_manifest="$__cdist_type_dir/${__cdist_type}/${__cdist_name_manifest}" + __cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" + __cdist_manifest="$(__cdist_type_manifest "${__cdist_type}")" # Make __cdist_manifest available for cdist-type-emulator export __cdist_manifest - if [ -x "${__cdist_manifest}" ]; then - echo "Executing manifest ${__cdist_manifest} ..." + echo "Executing manifest ${__cdist_manifest} ..." + # Make variables available to non-core - FIXME: beatify + export $__cdist_name_var_object="$__cdist_cur_object_dir" + export $__cdist_name_var_object_id="$__cdist_object_id" + export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" - # Make variables available to non-core - export $__cdist_name_var_object="$__cdist_cur_object_dir" - export $__cdist_name_var_object_id="$__cdist_object_id" - export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" - - cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" \ - "$__cdist_new_objects_dir" - - __cdist_object_list "${__cdist_new_objects_dir}" > "$__cdist_new_objects_list" - - # Verify no conflicting objects have been created - while read __cdist_new_object; do - __cdist_object_found=$(grep "^$__cdist_new_object\$" "$__cdist_objects_list" || true) - - if [ "$__cdist_object_found" ]; then - __cdist_object_source="$(cat "$(__cdist_object_dir "$__cdist_new_object")/${__cdist_name_object_source}")" - __cdist_exit_err "${__cdist_manifest}: ${__cdist_new_object} already exists (source: $__cdist_object_source)" - fi - done < "$__cdist_new_objects_list" - - # Safe harbour: We can merge all objects into main tree - # Merge = mkdir + mv parameters and source information - while read __cdist_new_object; do - [ "$__cdist_new_objects_created" = "n" ] && __cdist_new_objects_created="y" - - # where to save the newly created object - __cdist_object_dir="$__cdist_out_object_dir/$__cdist_new_object" - mkdir -p "$__cdist_object_dir" - - # Move parts of the object (CANNOT MOVE COMPLETLEY, HIERACHY!) - __cdist_new_object_dir="$__cdist_new_objects_dir/$__cdist_new_object" - - # Source - mv "${__cdist_new_object_dir}/${__cdist_name_object_source}" \ - "$__cdist_object_dir" - - # Explorer, Parameter, Require - for __cdist_object_file in \ - ${__cdist_name_explorer} \ - ${__cdist_name_parameter} \ - ${__cdist_name_require} \ - ; do - - if [ -e "${__cdist_new_object_dir}/${__cdist_object_file}" ]; then - mv "${__cdist_new_object_dir}/${__cdist_object_file}" \ - "$__cdist_object_dir" - fi - done - done < "$__cdist_new_objects_list" - - # Remove listing and objects, otherwise the next type will reuse it... - rm -rf "$__cdist_new_objects_dir" "$__cdist_new_objects_list" - else - # Be nice, warn user if manifests exists, but is not executable - if [ -f "${__cdist_manifest}" ]; then - echo "Warning ${__cdist_manifest} exists, but is not executable." >&2 - fi - fi + cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" fi # done with this object diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 75790fb8..37c1884d 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,5 +1,6 @@ - think about using .cdist for meta information? - - otherwise: parameter, gencode-local, etc. are not valid object id stuff + - cleanup cdist-manifest-run-all +later - check cdist-manifest-run-all whether -x -f to manifest shouldn't be better in cdist-manifest-run From 65763a1b4d18ae26bb371b8ae2aa459b9ad29eae Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 16:39:06 +0100 Subject: [PATCH 0279/5465] search for .cdist not source Signed-off-by: Nico Schottelius --- bin/cdist-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 51d68f77..4cad1924 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -215,8 +215,8 @@ __cdist_object_list() ( cd "${basedir}" - find . -name "$__cdist_name_object_source" | \ - sed -e 's;^./;;' -e "s;/${__cdist_name_object_source}\$;;" + find . -name "$__cdist_name_dot_cdist" | \ + sed -e 's;^./;;' -e "s;/${__cdist_name_dot_cdist}\$;;" ) } From a40974e28612b0d61129faaff7d2229d5e618216 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 16:45:00 +0100 Subject: [PATCH 0280/5465] check for existence and executable in manifest-run-all, because it's correct for manifest-run to fail if something is broken as it's used for init Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 3 +-- bin/cdist-manifest-run | 6 ------ bin/cdist-manifest-run-all | 24 +++++++++++++++--------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 34662081..df14931b 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -49,10 +49,9 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" +cdist-manifest-run-all "$__cdist_target_host" exit 1 - -cdist-manifest-run-all "$__cdist_target_host" cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" diff --git a/bin/cdist-manifest-run b/bin/cdist-manifest-run index ae568c2a..d4ea18bb 100755 --- a/bin/cdist-manifest-run +++ b/bin/cdist-manifest-run @@ -53,10 +53,4 @@ cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ # prepend our path, so all cdist tools come before other tools export PATH="${__cdist_out_type_bin_dir}:$PATH" -# Sanity checks -[ -f "${__cdist_manifest}" ] \ - || __cdist_exit_err "Missing manifest ${__cdist_manifest}" -[ -x "${__cdist_manifest}" ] \ - || __cdist_exit_err "${__cdist_manifest} needs to be executable." - __cdist_exec_fail_on_error "${__cdist_manifest}" diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index f20171a7..ee15273c 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -47,21 +47,27 @@ while [ "$__cdist_new_objects_created" = "y" ]; do __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then - echo "Checking manifest for ${__cdist_object} ..." + echo "Checking manifest for ${__cdist_object_self} ..." __cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" __cdist_manifest="$(__cdist_type_manifest "${__cdist_type}")" - # Make __cdist_manifest available for cdist-type-emulator - export __cdist_manifest + if [ -f "$__cdist_manifest" ]; then + if [ -x "$__cdist_manifest" ]; then + # Make __cdist_manifest available for cdist-type-emulator + export __cdist_manifest - echo "Executing manifest ${__cdist_manifest} ..." - # Make variables available to non-core - FIXME: beatify - export $__cdist_name_var_object="$__cdist_cur_object_dir" - export $__cdist_name_var_object_id="$__cdist_object_id" - export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" + echo "Executing manifest ${__cdist_manifest} ..." + # Make variables available to non-core - FIXME: beatify + export $__cdist_name_var_object="$__cdist_cur_object_dir" + export $__cdist_name_var_object_id="$__cdist_object_id" + export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" - cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" + cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" + else + __cdist_exit_err "${__cdist_manifest} needs to be executable." + fi + fi fi # done with this object From c527e1a9c4d5eb1431c7c1c26e6c372ba6d08852 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 16:48:36 +0100 Subject: [PATCH 0281/5465] cleanup and make cdist-deploy-to run all stages again Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 2 -- bin/cdist-object-explorer-all | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index df14931b..9a2fd303 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -50,8 +50,6 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" cdist-manifest-run-all "$__cdist_target_host" - -exit 1 cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" diff --git a/bin/cdist-object-explorer-all b/bin/cdist-object-explorer-all index 8654b03f..692a79bb 100755 --- a/bin/cdist-object-explorer-all +++ b/bin/cdist-object-explorer-all @@ -87,7 +87,7 @@ while [ $# -gt 0 ]; do # Execute explorers cdist-run-remote "$__cdist_target_host" \ - "__object=\"$(__cdist_remote_object_dir "$__object")\"" \ + "__object=\"$(__cdist_remote_object_dir "$__object")\"" \ "__object_id=\"$__object_id\"" \ cdist-remote-explorer-run \ "$__cdist_name_var_type_explorer" \ From 0d465400ea5317b56785ae78be2e2f92c6c52f8a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 16:51:20 +0100 Subject: [PATCH 0282/5465] less todo for nico Signed-off-by: Nico Schottelius --- doc/changelog | 4 +++- doc/dev/todo/niconext | 9 +++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/changelog b/doc/changelog index f120e47d..25459951 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,7 @@ -1.3.3: +1.4: * Add --recursive to __directory + * Move cdist generated stuff to .cdist of object + * Allow objects to be redefined 1.3.2: 2011-03-21 * Add --source to __motd diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 37c1884d..bf13881e 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +1,3 @@ -- think about using .cdist for meta information? - - cleanup cdist-manifest-run-all - -later -- check cdist-manifest-run-all whether -x -f to manifest shouldn't be better - in cdist-manifest-run +Document redefine behaviour +release cdist 1.4.0 + perhaps include __self From ec7e836b1de12d24d507abcac88dae2b4f4c74b4 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 17:16:43 +0100 Subject: [PATCH 0283/5465] doc: object-redefine Signed-off-by: Steven Armstrong --- doc/man/cdist-manifest.text | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/man/cdist-manifest.text b/doc/man/cdist-manifest.text index 7da90f71..701c8b98 100644 --- a/doc/man/cdist-manifest.text +++ b/doc/man/cdist-manifest.text @@ -15,8 +15,12 @@ host as well as to define which configurations should be applied within a type. Manifests are executed locally and the resulting objects are stored in an internal database. +The same object can be redefined in multiple different manifests as long as it is +exactly the same, that is, all its parameters are equal. + In general, manifests are used to define which types are used depending -on given conditions +on given conditions. + EXAMPLE ------- From 5e5334dee12d96ebd67960d852eb8837ea471497 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 17:24:21 +0100 Subject: [PATCH 0284/5465] prepare release 1.4.0 Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- doc/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 4cad1924..00872438 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.3.2" +__cdist_version="1.4.0" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index 25459951..f7241150 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.4: +1.4.0: * Add --recursive to __directory * Move cdist generated stuff to .cdist of object * Allow objects to be redefined From f375b5cb91a8c7d2ef49873c6fb8ea8786f1c649 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 17:24:48 +0100 Subject: [PATCH 0285/5465] submit $__cdist_out_object_dir to cdist-code-run on target host Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index 3a360715..607929ce 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -43,8 +43,9 @@ while [ $# -ge 1 ]; do || __cdist_exit_err "Remote code failed for $object" # Code remote - cdist-run-remote "$__cdist_target_host" "cdist-code-run" \ - "${__cdist_remote_out_object_base_dir}" "$object" \ - "${__cdist_name_gencode_remote}" \ + cdist-run-remote "$__cdist_target_host" \ + "__cdist_out_object_dir=\"$__cdist_remote_out_object_base_dir\" \ + "cdist-code-run" "${__cdist_remote_out_object_base_dir}" "$object" \ + "${__cdist_name_gencode_remote}" \ || __cdist_exit_err "Remote code failed for $object" done < "$__cdist_tmp_file" From a48e5ca8a1ce8d6dfbd3d1d3ca5c05e5b291771a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 17:25:42 +0100 Subject: [PATCH 0286/5465] +" Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index 607929ce..90ef6443 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -44,7 +44,7 @@ while [ $# -ge 1 ]; do # Code remote cdist-run-remote "$__cdist_target_host" \ - "__cdist_out_object_dir=\"$__cdist_remote_out_object_base_dir\" \ + "__cdist_out_object_dir=\"$__cdist_remote_out_object_base_dir\"" \ "cdist-code-run" "${__cdist_remote_out_object_base_dir}" "$object" \ "${__cdist_name_gencode_remote}" \ || __cdist_exit_err "Remote code failed for $object" From 44ecd1f056a498d0ffb3d6216d1c75f6653eda7a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 17:27:27 +0100 Subject: [PATCH 0287/5465] i'm tired, doing stuff that's already in the lines Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index 90ef6443..49af7b3b 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -44,7 +44,6 @@ while [ $# -ge 1 ]; do # Code remote cdist-run-remote "$__cdist_target_host" \ - "__cdist_out_object_dir=\"$__cdist_remote_out_object_base_dir\"" \ "cdist-code-run" "${__cdist_remote_out_object_base_dir}" "$object" \ "${__cdist_name_gencode_remote}" \ || __cdist_exit_err "Remote code failed for $object" From 2bab4ed93b95c6c2cfb6f478131dceaef784ca71 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 17:38:28 +0100 Subject: [PATCH 0288/5465] dont use python in type explorer Signed-off-by: Steven Armstrong --- conf/type/__apt_ppa/explorer/state | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/type/__apt_ppa/explorer/state b/conf/type/__apt_ppa/explorer/state index c50af3f0..69af1937 100755 --- a/conf/type/__apt_ppa/explorer/state +++ b/conf/type/__apt_ppa/explorer/state @@ -23,6 +23,10 @@ name="$__object_id" -# FIXME: on first run check-apt-repository may not be installed -check-apt-repository "$name" && echo enabled || echo disabled +. /etc/lsb-release + +repo_name="${name#ppa:}" +repo_file_name="$(echo "$repo_name" | sed "s:\/:\-:")-${DISTRIB_CODENAME}.list" + +[ -f "/etc/apt/sources.list.d/${repo_file_name}" ] && echo enabled || echo disabled From f46b2a9a5a2434430506e93e1aec41aaef87beb2 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 17:39:28 +0100 Subject: [PATCH 0289/5465] no longer need check-apt-repository Signed-off-by: Steven Armstrong --- .../type/__apt_ppa/files/check-apt-repository | 42 ------------------- conf/type/__apt_ppa/manifest | 6 +-- 2 files changed, 1 insertion(+), 47 deletions(-) delete mode 100755 conf/type/__apt_ppa/files/check-apt-repository diff --git a/conf/type/__apt_ppa/files/check-apt-repository b/conf/type/__apt_ppa/files/check-apt-repository deleted file mode 100755 index 4f4252c1..00000000 --- a/conf/type/__apt_ppa/files/check-apt-repository +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -# -# Check if the given apt repository is installed or not. -# Exit with: -# 0: if it is installed -# 1: if not -# 2: on error -# - -import sys -from aptsources import distro, sourceslist -from softwareproperties import ppa - - -def is_repository_installed(repository): - #print 'repository:', repository - codename = distro.get_distro().codename - #print 'codename:', codename - (line, file) = ppa.expand_ppa_line(repository.strip(), codename) - #print 'line:', line - #print 'file:', file - sources_list = sourceslist.SourcesList() - source_entry = sourceslist.SourceEntry(line, file) - - if source_entry in sources_list: - #print 'yes' - return True - else: - #print 'no' - return False - -if __name__ == '__main__': - if (len(sys.argv) != 2): - print 'Error: need a repository as argument' - sys.exit(2) - #repository = 'ppa:freenx-team' - repository = sys.argv[1] - if is_repository_installed(repository): - sys.exit(0) - else: - sys.exit(1) - diff --git a/conf/type/__apt_ppa/manifest b/conf/type/__apt_ppa/manifest index a97ced75..d5df9e23 100755 --- a/conf/type/__apt_ppa/manifest +++ b/conf/type/__apt_ppa/manifest @@ -18,14 +18,10 @@ # along with cdist. If not, see . # +name="$__object_id" __package python-software-properties --state installed -require="__package/python-software-properties" \ - __file /usr/local/bin/check-apt-repository \ - --source "$__type/files/check-apt-repository" \ - --mode 0755 - require="__package/python-software-properties" \ __file /usr/local/bin/remove-apt-repository \ --source "$__type/files/remove-apt-repository" \ From 0356d2eeff9f35ac6e33c926d41ad9cbca8a9103 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 17:45:03 +0100 Subject: [PATCH 0290/5465] also check if sources file is not empty Signed-off-by: Steven Armstrong --- conf/type/__apt_ppa/explorer/state | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/type/__apt_ppa/explorer/state b/conf/type/__apt_ppa/explorer/state index 69af1937..86c401a4 100755 --- a/conf/type/__apt_ppa/explorer/state +++ b/conf/type/__apt_ppa/explorer/state @@ -28,5 +28,7 @@ name="$__object_id" repo_name="${name#ppa:}" repo_file_name="$(echo "$repo_name" | sed "s:\/:\-:")-${DISTRIB_CODENAME}.list" -[ -f "/etc/apt/sources.list.d/${repo_file_name}" ] && echo enabled || echo disabled +[ -f "/etc/apt/sources.list.d/${repo_file_name}" -a \ + -s "/etc/apt/sources.list.d/${repo_file_name}" ] \ + && echo enabled || echo disabled From e829fe65cd92cc66856d98908c1e445b1020d1e2 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 23 Mar 2011 21:14:17 +0100 Subject: [PATCH 0291/5465] checking for filesize already includes check for file existence Signed-off-by: Steven Armstrong --- conf/type/__apt_ppa/explorer/state | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conf/type/__apt_ppa/explorer/state b/conf/type/__apt_ppa/explorer/state index 86c401a4..8a5638b2 100755 --- a/conf/type/__apt_ppa/explorer/state +++ b/conf/type/__apt_ppa/explorer/state @@ -28,7 +28,6 @@ name="$__object_id" repo_name="${name#ppa:}" repo_file_name="$(echo "$repo_name" | sed "s:\/:\-:")-${DISTRIB_CODENAME}.list" -[ -f "/etc/apt/sources.list.d/${repo_file_name}" -a \ - -s "/etc/apt/sources.list.d/${repo_file_name}" ] \ +[ -s "/etc/apt/sources.list.d/${repo_file_name}" ] \ && echo enabled || echo disabled From 1e66bc43803a5be74e36346944fc00acf847c24f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 23:54:13 +0100 Subject: [PATCH 0292/5465] exchange new and object dir (good idea, steven) Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 18069b44..088286e9 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -71,11 +71,11 @@ __cdist_out_object_dir_orig="$__cdist_out_object_dir" # Store to tmp now __cdist_out_object_dir="$__cdist_tmp_dir" -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" +__cdist_new_object_dir="$(__cdist_object_dir "$__cdist_object_self")" # Record source -mkdir -p "${__cdist_object_dir}" -__cdist_object_source_add "${__cdist_object_dir}" +mkdir -p "${__cdist_new_object_dir}" +__cdist_object_source_add "${__cdist_new_object_dir}" # Record parameter __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object_self")" @@ -147,15 +147,15 @@ done # Restore original destination __cdist_out_object_dir="$__cdist_out_object_dir_orig" -__cdist_new_object_dir="$(__cdist_object_dir "$__cdist_object_self")" +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" # # If the object already exists and is exactly the same, merge it. Otherwise fail. # -if [ -e "${__cdist_new_object_dir}" ]; then +if [ -e "${__cdist_object_dir}" ]; then # Allow diff to fail set +e - diff -ru "${__cdist_object_dir}" "${__cdist_new_object_dir}" \ + diff -ru "${__cdist_new_object_dir}" "${__cdist_object_dir}" \ > "$__cdist_tmp_file"; ret=$? set -e @@ -164,14 +164,14 @@ if [ -e "${__cdist_new_object_dir}" ]; then exec >&2 echo "${__cdist_object_self} already exists differently." echo "Recorded source(s):" - __cdist_object_source "${__cdist_new_object_dir}" + __cdist_object_source "${__cdist_object_dir}" echo "Differences:" cat "$__cdist_tmp_file" __cdist_exit_err "Aborting due to object conflict." fi # Add ourselves, if we're compatible - __cdist_object_source_add "${__cdist_new_object_dir}" + __cdist_object_source_add "${__cdist_object_dir}" else # # Move object into tree: @@ -179,5 +179,5 @@ else # __cdist_new_object_base_dir="$(__cdist_object_base_dir "$__cdist_object_self")" mkdir -p "$__cdist_new_object_base_dir" - mv "$__cdist_object_dir" "$__cdist_new_object_base_dir" + mv "$__cdist_new_object_dir" "$__cdist_new_object_base_dir" fi From b44734e70a47a71dffc269aecdb0862fcfc1063f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 00:27:40 +0100 Subject: [PATCH 0293/5465] local != remote Signed-off-by: Nico Schottelius --- bin/cdist-code-run-all | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index 49af7b3b..f301864b 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -40,7 +40,7 @@ while [ $# -ge 1 ]; do # Code local cdist-code-run "$__cdist_out_object_dir" "$object" \ "${__cdist_name_gencode_local}" \ - || __cdist_exit_err "Remote code failed for $object" + || __cdist_exit_err "Local code failed for $object" # Code remote cdist-run-remote "$__cdist_target_host" \ From 9094f50b035421e2d773f08ce54bbb0a477262fd Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 24 Mar 2011 08:30:51 +0100 Subject: [PATCH 0294/5465] new type: __apt_update_index Signed-off-by: Steven Armstrong --- conf/type/__apt_update_index/gencode-remote | 35 ++++++++++++++++ conf/type/__apt_update_index/man.text | 44 +++++++++++++++++++++ conf/type/__apt_update_index/singleton | 0 3 files changed, 79 insertions(+) create mode 100755 conf/type/__apt_update_index/gencode-remote create mode 100644 conf/type/__apt_update_index/man.text create mode 100644 conf/type/__apt_update_index/singleton diff --git a/conf/type/__apt_update_index/gencode-remote b/conf/type/__apt_update_index/gencode-remote new file mode 100755 index 00000000..ad2296df --- /dev/null +++ b/conf/type/__apt_update_index/gencode-remote @@ -0,0 +1,35 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + +# BIG FAT FIXME: there must be a better way to do this! +tmpdir=$(mktemp -d) +cleanup() { + rm -rf "$tmpdir" +} +trap cleanup EXIT + +should="$tmpdir/should" +is="$tmpdir/is" + +find "$__global/object/__apt_ppa" -path "*.cdist/parameter/state" | xargs cat > "$should" +find "$__global/object/__apt_ppa" -path "*.cdist/explorer/state" | xargs cat > "$is" + +diff -ru "$is" "$should" || echo apt-get update + diff --git a/conf/type/__apt_update_index/man.text b/conf/type/__apt_update_index/man.text new file mode 100644 index 00000000..dffba372 --- /dev/null +++ b/conf/type/__apt_update_index/man.text @@ -0,0 +1,44 @@ +cdist-type__apt_update_index(7) +========================== +Steven Armstrong + + +NAME +---- +cdist-type__apt_update_index - resynchronize the apt package index + + +DESCRIPTION +----------- +This cdist type allows you to resynchronize the package index files from their +sources. In other words, it runs `apt-get update`. + +FIXME: currently hard coded to work together with the __apt_ppa type + + +REQUIRED PARAMETERS +------------------- +None. + +OPTIONAL PARAMETERS +------------------- +None. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +__apt_update_index +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__apt_update_index/singleton b/conf/type/__apt_update_index/singleton new file mode 100644 index 00000000..e69de29b From 15b1bdab7791033a6154a75d0000ee4069fe8fa0 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 24 Mar 2011 08:31:23 +0100 Subject: [PATCH 0295/5465] use __apt_update_index Signed-off-by: Steven Armstrong --- conf/type/__apt_ppa/manifest | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/type/__apt_ppa/manifest b/conf/type/__apt_ppa/manifest index d5df9e23..ad6ee614 100755 --- a/conf/type/__apt_ppa/manifest +++ b/conf/type/__apt_ppa/manifest @@ -27,3 +27,8 @@ require="__package/python-software-properties" \ --source "$__type/files/remove-apt-repository" \ --mode 0755 +# FIXME: rewrite to use $__self once that exists +# FIXME: only run if something changed. currently working arround this in +# __apt_update_index/gencode-remote +require="__apt_ppa/$__object_id" __apt_update_index + From 7a294bf41d165eaeac22f3698db4dc2697c95107 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 10:13:52 +0100 Subject: [PATCH 0296/5465] always setup __cdist_out_object_dir, which needs to be done anyway Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 7 ++----- bin/cdist-code-run-all | 10 +++++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 229d4d1d..a6a9137f 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -22,12 +22,9 @@ # . cdist-config -[ $# -eq 3 ] || __cdist_usage " " +[ $# -eq 2 ] || __cdist_usage " " set -ue -# This variable MUST be exactly like this - see __cdist_object_dir -__cdist_out_object_dir="$1"; shift - object="$1"; shift __cdist_gencode_type="$1"; shift @@ -50,7 +47,7 @@ echo "Checking code-${__cdist_gencode_type} for $object ..." if [ -f "$require" ]; then while read requirement; do echo "Requiring dependency $requirement for $object ..." - cdist-code-run "$__cdist_out_object_dir" "$requirement" "$__cdist_gencode_type" + cdist-code-run "$requirement" "$__cdist_gencode_type" done < "$require" fi diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index f301864b..1486cc46 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -38,13 +38,13 @@ while [ $# -ge 1 ]; do object="$1"; shift # Code local - cdist-code-run "$__cdist_out_object_dir" "$object" \ - "${__cdist_name_gencode_local}" \ + export __cdist_out_object_dir="$__cdist_out_object_dir" + cdist-code-run "$object" "${__cdist_name_gencode_local}" \ || __cdist_exit_err "Local code failed for $object" # Code remote - cdist-run-remote "$__cdist_target_host" \ - "cdist-code-run" "${__cdist_remote_out_object_base_dir}" "$object" \ - "${__cdist_name_gencode_remote}" \ + cdist-run-remote "$__cdist_target_host" \ + "export __cdist_out_object_dir=\"$__cdist_remote_out_object_base_dir\";" \ + "cdist-code-run" "$object" "${__cdist_name_gencode_remote}" \ || __cdist_exit_err "Remote code failed for $object" done < "$__cdist_tmp_file" From 79eec9bd236febbb3cbace6a93f5820deed47e7f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 10:17:43 +0100 Subject: [PATCH 0297/5465] make PATH setting independent of further code Signed-off-by: Nico Schottelius --- bin/cdist-run-remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-run-remote b/bin/cdist-run-remote index 87af8459..93cf9062 100755 --- a/bin/cdist-run-remote +++ b/bin/cdist-run-remote @@ -28,4 +28,4 @@ set -ue __cdist_target_host="$1"; shift ssh "${__cdist_remote_user}@${__cdist_target_host}" \ - "PATH=\"${__cdist_remote_bin_dir}:\$PATH\"" "$@" + "export PATH=\"${__cdist_remote_bin_dir}:\$PATH\";" "$@" From 762c0b493525a4318cea35ec252e64269ee1a647 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 10:24:51 +0100 Subject: [PATCH 0298/5465] BUGFIX: marker reset got lost during migration to cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index ee15273c..a431576d 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -64,6 +64,7 @@ while [ "$__cdist_new_objects_created" = "y" ]; do export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" + __cdist_new_objects_created=y else __cdist_exit_err "${__cdist_manifest} needs to be executable." fi From 914ec3104ea1b2c1e4a7b524189615c84949a1f7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 10:27:05 +0100 Subject: [PATCH 0299/5465] only append source in final tree, otherwise we always conflict Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 088286e9..32f3ccb2 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -73,9 +73,8 @@ __cdist_out_object_dir="$__cdist_tmp_dir" __cdist_new_object_dir="$(__cdist_object_dir "$__cdist_object_self")" -# Record source +# Initialise object mkdir -p "${__cdist_new_object_dir}" -__cdist_object_source_add "${__cdist_new_object_dir}" # Record parameter __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object_self")" From 4d2e03b96613dd10fb3573c547d5166ee596f5b7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 10:28:50 +0100 Subject: [PATCH 0300/5465] always add source, even if everything went successful... Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 32f3ccb2..46ba3a57 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -168,9 +168,6 @@ if [ -e "${__cdist_object_dir}" ]; then cat "$__cdist_tmp_file" __cdist_exit_err "Aborting due to object conflict." fi - - # Add ourselves, if we're compatible - __cdist_object_source_add "${__cdist_object_dir}" else # # Move object into tree: @@ -180,3 +177,6 @@ else mkdir -p "$__cdist_new_object_base_dir" mv "$__cdist_new_object_dir" "$__cdist_new_object_base_dir" fi + +# Add "I was here message" +__cdist_object_source_add "${__cdist_object_dir}" From b20a50899a7bb9d5a0a89b6e4afbb1bec55c9743 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 10:35:29 +0100 Subject: [PATCH 0301/5465] only diff parameters ? Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 46ba3a57..6294870a 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -154,7 +154,8 @@ __cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" if [ -e "${__cdist_object_dir}" ]; then # Allow diff to fail set +e - diff -ru "${__cdist_new_object_dir}" "${__cdist_object_dir}" \ + diff -ru "${__cdist_new_object_dir}/${__cdist_name_parameter}" \ + "${__cdist_object_dir}/${__cdist_name_parameter}" \ > "$__cdist_tmp_file"; ret=$? set -e From 0b1957f5dfecd74f487bc9b925a369a05c601ba6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 13:27:22 +0100 Subject: [PATCH 0302/5465] clearify parameters Signed-off-by: Nico Schottelius --- doc/man/cdist-manifest.text | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/man/cdist-manifest.text b/doc/man/cdist-manifest.text index 701c8b98..04f1c56c 100644 --- a/doc/man/cdist-manifest.text +++ b/doc/man/cdist-manifest.text @@ -15,8 +15,8 @@ host as well as to define which configurations should be applied within a type. Manifests are executed locally and the resulting objects are stored in an internal database. -The same object can be redefined in multiple different manifests as long as it is -exactly the same, that is, all its parameters are equal. +The same object can be redefined in multiple different manifests as long as +the parameters are exactly the same. In general, manifests are used to define which types are used depending on given conditions. From 84bc0511fbe730dbc1e17338b9db85003adda0c9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 13:28:35 +0100 Subject: [PATCH 0303/5465] update to 1.4.0 Signed-off-by: Nico Schottelius --- doc/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/changelog b/doc/changelog index f7241150..f78b1660 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,6 @@ -1.4.0: +1.4.0: 2011-03-24 * Add --recursive to __directory - * Move cdist generated stuff to .cdist of object + * Move cdist generated stuff to .cdist of an object * Allow objects to be redefined 1.3.2: 2011-03-21 From b02141eedab7639ad1eef020232d00bd7b04f4c8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 13:30:08 +0100 Subject: [PATCH 0304/5465] update website to reference 1.4 branch Signed-off-by: Nico Schottelius --- README | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README b/README index e7345a78..feca4bc4 100644 --- a/README +++ b/README @@ -120,13 +120,14 @@ how to use cdist. There are at least the following branches available: * master: the development branch - * 1.3: Support for local and remote code execution (current stable) + * 1.4: Support for redefiniton of objects (if equal) Old versions: - * 1.0: First official release - * 1.1: __file to __file, __directory, __link migration + * 1.3: Support for local and remote code execution (current stable) * 1.2: Dependencies supported + * 1.1: __file to __file, __directory, __link migration + * 1.0: First official release Other branches may be available for features or bugfixes, but they may vanish at any point. To select a specific branch use @@ -156,6 +157,10 @@ 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. +### Upgrading from 1.3 to 1.4 + +No incompatiblities. + ### Upgrading from 1.2 to 1.3 Rename **gencode** of every type to **gencode-remote**. From c7ef2210fc34f39d5d73a526af4810d4e46dd4cc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 13:32:09 +0100 Subject: [PATCH 0305/5465] update manpage for __apt_ppa Signed-off-by: Nico Schottelius --- conf/type/__apt_ppa/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__apt_ppa/man.text b/conf/type/__apt_ppa/man.text index 73fabc7f..5423a1a2 100644 --- a/conf/type/__apt_ppa/man.text +++ b/conf/type/__apt_ppa/man.text @@ -1,5 +1,5 @@ cdist-type__apt_ppa(7) -========================== +====================== Steven Armstrong From 17c6a650ff4a8124634d6eba41c1556749f05c87 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:06:56 +0100 Subject: [PATCH 0306/5465] change workflow proposal Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 9a2fd303..7a63f5ca 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -50,6 +50,8 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" cdist-manifest-run-all "$__cdist_target_host" + +# Change workflow here: cdist-object-{apply, run, foo} cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" @@ -59,4 +61,6 @@ cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ cdist-code-run-all "$__cdist_target_host" +# Stop change here + echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" From 33552e5930b0958c1d0930cfa5f92ac7abe7532e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:26:06 +0100 Subject: [PATCH 0307/5465] [DOC] include hackers manpage Signed-off-by: Nico Schottelius --- Makefile | 1 + doc/man/cdist-hacker.text | 65 +++++++++++++++++++++++++++++++++++++++ doc/man/cdist.text | 1 + 3 files changed, 67 insertions(+) create mode 100644 doc/man/cdist-hacker.text diff --git a/Makefile b/Makefile index 29d86c67..fea5a8ea 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-explorer-run-global.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ + $(MANDIR)/cdist-hacker.text \ $(MANDIR)/cdist-manifest.text \ $(MANDIR)/cdist-manifest-run.text \ $(MANDIR)/cdist-manifest-run-all.text \ diff --git a/doc/man/cdist-hacker.text b/doc/man/cdist-hacker.text new file mode 100644 index 00000000..093eaf61 --- /dev/null +++ b/doc/man/cdist-hacker.text @@ -0,0 +1,65 @@ +cdist-hacker(7) +=============== +Nico Schottelius + + +NAME +---- +cdist-hacker - How to get (stuff) into cdist + + +WELCOME +------- +Welcome dear hacker! I invite you to a tour of pointers to +get into the usable configuration mangament system, cdist. + +The first thing to know is probably that cdist is brought to +you by people who care about how code looks like and who think +twice before merging or implementing a feature: Less features +with good usability are far better than the opposite. + + +UNDERSTANDING CDIST INTERNALS +----------------------------- +IF you are interested in how cdist internally works, you can open +bin/cdist-config and bin/cdist-deploy-to in your favorite editor and +read the scripts bin/cdist-deploy-to calls. The magnificent HACKERS_README +may be of great help as well. + + +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. + +There are though some requirements to ensure your changes don't break others +work nor kill the authors brain: + +- Code submission must be done via git +- Code to be included should be branched of the upstream "master" branch + - Exception: Bugfixes to a version branch +- Code submissions must be in your master branch + - Exception: If you only want a comment on your code, but not an inclusion. + +As soon as your work meets these requirements, you can contact me +(IRC, Mailinglist, Phone, RFC 1149) and I'll check your code before +including it. + + +HOW TO SUBMIT A NEW TYPE +------------------------ +Submitting a type works as described above, with the additional requirement +that a corresponding manpage named man.text in asciidoc format with +the manpage-name "cdist-type__NAME" is included in the type directory +AND asciidoc is able to compile it. + + +SEE ALSO +-------- +- cdist(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/doc/man/cdist.text b/doc/man/cdist.text index 957e7cb4..44be52b1 100644 --- a/doc/man/cdist.text +++ b/doc/man/cdist.text @@ -32,6 +32,7 @@ SEE ALSO - Website: http://www.nico.schottelius.org/cdist/[] - cdist-best-practise(7) - cdist-deploy-to(1) +- cdist-hacker(7) - cdist-manifest(7) - cdist-quickstart(1) - cdist-type(7) From c9680285962c33fa3f5f936ca3f79da831ffa552 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:28:07 +0100 Subject: [PATCH 0308/5465] Revert "use __apt_update_index" (until it works) This reverts commit 15b1bdab7791033a6154a75d0000ee4069fe8fa0. --- conf/type/__apt_ppa/manifest | 5 ----- 1 file changed, 5 deletions(-) diff --git a/conf/type/__apt_ppa/manifest b/conf/type/__apt_ppa/manifest index ad6ee614..d5df9e23 100755 --- a/conf/type/__apt_ppa/manifest +++ b/conf/type/__apt_ppa/manifest @@ -27,8 +27,3 @@ require="__package/python-software-properties" \ --source "$__type/files/remove-apt-repository" \ --mode 0755 -# FIXME: rewrite to use $__self once that exists -# FIXME: only run if something changed. currently working arround this in -# __apt_update_index/gencode-remote -require="__apt_ppa/$__object_id" __apt_update_index - From 0961e003be1a8dfbba0529cd12f25fdcbae837ac Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:28:20 +0100 Subject: [PATCH 0309/5465] Revert "new type: __apt_update_index" (until it works) This reverts commit 9094f50b035421e2d773f08ce54bbb0a477262fd. --- conf/type/__apt_update_index/gencode-remote | 35 ---------------- conf/type/__apt_update_index/man.text | 44 --------------------- conf/type/__apt_update_index/singleton | 0 3 files changed, 79 deletions(-) delete mode 100755 conf/type/__apt_update_index/gencode-remote delete mode 100644 conf/type/__apt_update_index/man.text delete mode 100644 conf/type/__apt_update_index/singleton diff --git a/conf/type/__apt_update_index/gencode-remote b/conf/type/__apt_update_index/gencode-remote deleted file mode 100755 index ad2296df..00000000 --- a/conf/type/__apt_update_index/gencode-remote +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# - -# BIG FAT FIXME: there must be a better way to do this! -tmpdir=$(mktemp -d) -cleanup() { - rm -rf "$tmpdir" -} -trap cleanup EXIT - -should="$tmpdir/should" -is="$tmpdir/is" - -find "$__global/object/__apt_ppa" -path "*.cdist/parameter/state" | xargs cat > "$should" -find "$__global/object/__apt_ppa" -path "*.cdist/explorer/state" | xargs cat > "$is" - -diff -ru "$is" "$should" || echo apt-get update - diff --git a/conf/type/__apt_update_index/man.text b/conf/type/__apt_update_index/man.text deleted file mode 100644 index dffba372..00000000 --- a/conf/type/__apt_update_index/man.text +++ /dev/null @@ -1,44 +0,0 @@ -cdist-type__apt_update_index(7) -========================== -Steven Armstrong - - -NAME ----- -cdist-type__apt_update_index - resynchronize the apt package index - - -DESCRIPTION ------------ -This cdist type allows you to resynchronize the package index files from their -sources. In other words, it runs `apt-get update`. - -FIXME: currently hard coded to work together with the __apt_ppa type - - -REQUIRED PARAMETERS -------------------- -None. - -OPTIONAL PARAMETERS -------------------- -None. - - -EXAMPLES --------- - --------------------------------------------------------------------------------- -__apt_update_index --------------------------------------------------------------------------------- - - -SEE ALSO --------- -- cdist-type(7) - - -COPYING -------- -Copyright \(C) 2011 Steven Armstrong. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__apt_update_index/singleton b/conf/type/__apt_update_index/singleton deleted file mode 100644 index e69de29b..00000000 From b34a40b9e83895c00659ecdbbb8421208cc69c43 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:37:16 +0100 Subject: [PATCH 0310/5465] update makefile Signed-off-by: Nico Schottelius --- Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index fea5a8ea..a545b749 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,8 @@ all: man: doc/man/.marker -doc/man/.marker: $(MANDIR)/cdist-reference.text +# FIXME: also depends on conf/type/*/man.text! +doc/man/.marker: manmove touch $@ # Manual from core @@ -75,7 +76,7 @@ mantype: for man in conf/type/*/man.text; do $(A2XM) $$man; $(A2XH) $$man; done # Move into manpath directories -manmove: mantype mancore +manmove: mantype mancore $(MANGENERATED) for manpage in $(MANDIR)/*.[1-9] conf/type/*/*.7; do \ cat=$${manpage##*.}; \ mandir=$(MANDIR)/man$$cat; \ @@ -91,15 +92,13 @@ manmove: mantype mancore done # Reference depends on conf/type/*/man.text - HOWTO with posix make? -$(MANDIR)/cdist-reference.text: manmove $(MANDIR)/cdist-reference.text.sh +$(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh $(MANDIR)/cdist-reference.text.sh $(A2XM) $(MANDIR)/cdist-reference.text $(A2XH) $(MANDIR)/cdist-reference.text - # Move us to the destination as well - make manmove clean: - rm -rf doc/man/*.html doc/man/*.[1-9] doc/man/man[1-9] $(MANGENERATED) + rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9] $(MANGENERATED) rm -f conf/type/*/man.html rm -rf doc/html @@ -115,8 +114,7 @@ test: # gentoo .rsync nicosc@ru3.inf.ethz.ch:cdist -#web: manmove -web: +web: man cp README $(WEBDIR)/$(WEBPAGE) cp -r doc/html/* $(WEBDIR)/$(WEBBASE)/man cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE) From 6d4f702eacd0b82d9daf8b5ff7cdfe063fb6d2b5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:39:26 +0100 Subject: [PATCH 0311/5465] shrink hackers_readme in favor for the manpage Signed-off-by: Nico Schottelius --- HACKERS_README | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/HACKERS_README b/HACKERS_README index 0ae1bdcd..66103acc 100755 --- a/HACKERS_README +++ b/HACKERS_README @@ -3,21 +3,12 @@ cat << eof Hey hackers, this README is for you, for those who want to dig into cdist, hack it or try -to get a deeper understanding. - -A lot of documentation is still missing, but running cdist-quickstart should -give you an impression of how cdist works. +to get a deeper understanding. Please read doc/man/cdist-hacker.text. I hope you have a lot of fun with cdist, because it was also a lot of fun to develop it! - -- Nico, 20110304 - - -## Conventions - -- All variables exported by cdist are prefixed with a double underscore (__) -- All cdist-internal variables are prefixed with __cdist_ and are generally not exported. + -- Nico, 20110324 ## Running cdist when developing From fa2f49e847942d07b86e167c3ae4e40c5e4945a6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:42:06 +0100 Subject: [PATCH 0312/5465] also git add html pages Signed-off-by: Nico Schottelius --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index a545b749..d7706926 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,7 @@ test: web: man cp README $(WEBDIR)/$(WEBPAGE) cp -r doc/html/* $(WEBDIR)/$(WEBBASE)/man + cd $(WEBDIR) && git add $(WEBBASE)/man cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE) cd $(WEBDIR) && make pub From b14f7a431c8e68b2edf7e685ee3cc31404b10f05 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:45:31 +0100 Subject: [PATCH 0313/5465] rm mandir on webpage before copying (removes old manpages) Signed-off-by: Nico Schottelius --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index d7706926..1023d541 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,7 @@ test: web: man cp README $(WEBDIR)/$(WEBPAGE) + rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man cp -r doc/html/* $(WEBDIR)/$(WEBBASE)/man cd $(WEBDIR) && git add $(WEBBASE)/man cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE) From e685df7aa193938c8f392d8f5bdb456242812be0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:49:22 +0100 Subject: [PATCH 0314/5465] -typo Signed-off-by: Nico Schottelius --- doc/man/cdist-env.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/cdist-env.text b/doc/man/cdist-env.text index cf54d363..9a736133 100644 --- a/doc/man/cdist-env.text +++ b/doc/man/cdist-env.text @@ -32,7 +32,7 @@ in csh variants (csh, tcsh): eval `./bin/cdist-env` -------------------------------------------------------------------------------- -For bourne shell, the is also a shorter version: +For bourne shell, there is also a shorter version: -------------------------------------------------------------------------------- . ./bin/cdist-env -------------------------------------------------------------------------------- From c72833ce748b8be5d763bb7006af1ed3b8f02630 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:58:47 +0100 Subject: [PATCH 0315/5465] comment about conf/manifest/init in cdist-hacker Signed-off-by: Nico Schottelius --- doc/man/cdist-hacker.text | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/man/cdist-hacker.text b/doc/man/cdist-hacker.text index 093eaf61..d55f1c2f 100644 --- a/doc/man/cdist-hacker.text +++ b/doc/man/cdist-hacker.text @@ -27,6 +27,12 @@ read the scripts bin/cdist-deploy-to calls. The magnificent HACKERS_README may be of great help as well. +CODING CONVENTIONS (CORE) +------------------------- +- All variables exported by cdist are prefixed with a double underscore (__) +- All cdist-internal variables are prefixed with __cdist_ and are generally not exported. + + HOW TO SUBMIT STUFF FOR INCLUSION INTO UPSTREAM CDIST ----------------------------------------------------- If you did some cool changes to cdist, which you value as a benefit for @@ -40,6 +46,8 @@ work nor kill the authors brain: - Exception: Bugfixes to a version branch - Code submissions must be in your master branch - Exception: If you only want a comment on your code, but not an inclusion. +- Do not add conf/manifest/init - This file should only be touched in your + private branch! As soon as your work meets these requirements, you can contact me (IRC, Mailinglist, Phone, RFC 1149) and I'll check your code before From de81a2e80e6117243a7e1257a34b7701c87bb0dd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 16:00:46 +0100 Subject: [PATCH 0316/5465] change todos Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 26 +++++++++++++++++++++++--- doc/dev/todo/post-1.3 | 27 --------------------------- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index bf13881e..3556f371 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,23 @@ -Document redefine behaviour -release cdist 1.4.0 - perhaps include __self +Core: + - support $__self = relative_type/object_id + - cache + +Cache: + Assume you want to configure stuff one host ("monitor node"), + depending on the configuration of other hosts ("cluster nodes"). + + For instance, the monitor host would like to know, + which hosts are configured with the provider + "apache" and option --start true. + + This requires the monitor node to be able to + query all other configured nodes. It can't + ask for all hosts, because cdist does not + know which hosts are configured or may exist. + + Example implementation + + If cdist keeps ("caches") the configuration of every + node it configures, each new node can query the + cache for existing nodes that acquired the given + configuration. diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/post-1.3 index ec186d3a..c73a623b 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/post-1.3 @@ -1,30 +1,3 @@ -Core: - - allow redefine object, if everything same - - support $__self = relative_type/object_id - - .cdist - - cache - - display changes if object cannot be merged to user - -Cache: - Assume you want to configure stuff one host ("monitor node"), - depending on the configuration of other hosts ("cluster nodes"). - - For instance, the monitor host would like to know, - which hosts are configured with the provider - "apache" and option --start true. - - This requires the monitor node to be able to - query all other configured nodes. It can't - ask for all hosts, because cdist does not - know which hosts are configured or may exist. - - Example implementation - - If cdist keeps ("caches") the configuration of every - node it configures, each new node can query the - cache for existing nodes that acquired the given - configuration. - Types to be written/extended: - __ssh-keys (host/user) - __service From cd8ab7664a1f6a11b420f003d717a17f1914f627 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 16:02:15 +0100 Subject: [PATCH 0317/5465] rename post-1.3 todo Signed-off-by: Nico Schottelius --- doc/dev/todo/{post-1.3 => TAKEME} | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) rename doc/dev/todo/{post-1.3 => TAKEME} (54%) diff --git a/doc/dev/todo/post-1.3 b/doc/dev/todo/TAKEME similarity index 54% rename from doc/dev/todo/post-1.3 rename to doc/dev/todo/TAKEME index c73a623b..9fa083cc 100644 --- a/doc/dev/todo/post-1.3 +++ b/doc/dev/todo/TAKEME @@ -1,6 +1,10 @@ +The following list of todos has not been assigned to any developer. + +Feel free to pick one: + Types to be written/extended: - __ssh-keys (host/user) - - __service + - Think about __service - necessary? - __file_edit - regexp replace (can probably cover all?) -> aka sed. From f02254915a01640976368abedfc756f02bb99eb0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 17:41:20 +0100 Subject: [PATCH 0318/5465] begin to cleanup manpage generation Signed-off-by: Nico Schottelius --- Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 1023d541..93faa58a 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,8 @@ WEBPAGE=$(WEBBASE).mdwn # Documentation MANDIR=doc/man -MANGENERATED=$(MANDIR)/cdist-reference.text -MANSRC=$(MANDIR)/cdist.text \ - $(MANDIR)/cdist-best-practise.text \ +MAN1SRC= \ $(MANDIR)/cdist-code-run.text \ $(MANDIR)/cdist-code-run-all.text \ $(MANDIR)/cdist-config.text \ @@ -28,23 +26,29 @@ MANSRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-explorer-run-global.text \ $(MANDIR)/cdist-deploy-to.text \ $(MANDIR)/cdist-explorer.text \ - $(MANDIR)/cdist-hacker.text \ $(MANDIR)/cdist-manifest.text \ $(MANDIR)/cdist-manifest-run.text \ - $(MANDIR)/cdist-manifest-run-all.text \ $(MANDIR)/cdist-manifest-run-init.text \ + $(MANDIR)/cdist-manifest-run-all.text \ $(MANDIR)/cdist-object-explorer-all.text \ $(MANDIR)/cdist-object-gencode.text \ $(MANDIR)/cdist-object-gencode-all.text \ - $(MANDIR)/cdist-quickstart.text \ $(MANDIR)/cdist-remote-explorer-run.text \ $(MANDIR)/cdist-run-remote.text \ - $(MANDIR)/cdist-stages.text \ - $(MANDIR)/cdist-type.text \ $(MANDIR)/cdist-type-build-emulation.text \ $(MANDIR)/cdist-type-emulator.text \ $(MANDIR)/cdist-type-template.text \ +MAN7SRC=$(MANDIR)/cdist.text \ + $(MANDIR)/cdist-best-practise.text \ + $(MANDIR)/cdist-hacker.text \ + $(MANDIR)/cdist-quickstart.text \ + $(MANDIR)/cdist-reference.text \ + $(MANDIR)/cdist-stages.text \ + $(MANDIR)/cdist-type.text \ + +MAN1DST=$(MAN1SRC:.text=.1) +MAN7DST=$(MAN1SRC:.text=.7) ################################################################################ # User targets From 3dc37c17a33dccac168d26e7eace09e46f94ae9f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 18:32:53 +0100 Subject: [PATCH 0319/5465] require gnu make for manpages Signed-off-by: Nico Schottelius --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index feca4bc4..389470a0 100644 --- a/README +++ b/README @@ -107,7 +107,7 @@ To install cdist, execute the following commands: cd cdist export PATH=$PATH:$(pwd -P)/bin - # If you want the manpages (requires asciidoc to be installed) + # If you want the manpages (requires gmake and asciidoc to be installed) make man export MANPATH=$MANPATH:$(pwd -P)/doc/man @@ -136,7 +136,7 @@ may vanish at any point. To select a specific branch use git checkout -b origin/ # Stay on a specific version - git checkout -b 1.3 origin/1.3 + git checkout -b 1.4 origin/1.4 ### Mirrors From 0370412757d3ead117c54bcf434c17ed1f328ede Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 18:43:08 +0100 Subject: [PATCH 0320/5465] manpage generation cleaup Signed-off-by: Nico Schottelius --- Makefile | 41 ++++++++++++++++++++++------------------- doc/changelog | 3 +++ 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 93faa58a..e43876b3 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ WEBPAGE=$(WEBBASE).mdwn # Documentation MANDIR=doc/man +HTMLDIR=$(MANDIR)/html MAN1SRC= \ $(MANDIR)/cdist-code-run.text \ @@ -46,9 +47,11 @@ MAN7SRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-reference.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ + $(shell ls conf/type/*/man.text) MAN1DST=$(MAN1SRC:.text=.1) -MAN7DST=$(MAN1SRC:.text=.7) +MAN7DST=$(MAN7SRC:.text=.7) +MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html) ################################################################################ # User targets @@ -65,34 +68,34 @@ all: @echo '' @echo '' -man: doc/man/.marker -# FIXME: also depends on conf/type/*/man.text! -doc/man/.marker: manmove - touch $@ +%.1 %.7: %.text + $(A2XM) $*.text -# Manual from core -mancore: $(MANSRC) - for mansrc in $^; do $(A2XM) $$mansrc; $(A2XH) $$mansrc; done +%.html: %.text + $(A2XH) $*.text -# Manuals from types -mantype: - for man in conf/type/*/man.text; do $(A2XM) $$man; $(A2XH) $$man; done +man: $(MAN1DST) $(MAN7DST) + +html: $(MANHTML) + +# man: doc/man/.marker # Move into manpath directories -manmove: mantype mancore $(MANGENERATED) +manmove: $(MAN1DST) $(MAN7DST) $(MANHTML) for manpage in $(MANDIR)/*.[1-9] conf/type/*/*.7; do \ cat=$${manpage##*.}; \ mandir=$(MANDIR)/man$$cat; \ mkdir -p $$mandir; \ mv $$manpage $$mandir; \ done - mkdir -p doc/html - mv doc/man/*.html doc/html + # HTML + mkdir -p $(HTMLDIR) + mv doc/man/*.html $(HTMLDIR) for mantype in conf/type/*/man.html; do \ - mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\ - mv $$mantype doc/html/$$mannew; \ + mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\ + mv $$mantype doc/html/$$mannew; \ done # Reference depends on conf/type/*/man.text - HOWTO with posix make? @@ -102,9 +105,9 @@ $(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh $(A2XH) $(MANDIR)/cdist-reference.text clean: - rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9] $(MANGENERATED) - rm -f conf/type/*/man.html - rm -rf doc/html + rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9] + rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text + rm -rf $(HTMLDIR) ################################################################################ # Developer targets diff --git a/doc/changelog b/doc/changelog index f78b1660..6e119393 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.4.1: + * Manpage generation cleanup + 1.4.0: 2011-03-24 * Add --recursive to __directory * Move cdist generated stuff to .cdist of an object From e27501218f5629b281b86f2dbea988c3d39bebaf Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 24 Mar 2011 23:16:25 +0100 Subject: [PATCH 0321/5465] new type __key_value Signed-off-by: Steven Armstrong --- conf/type/__key_value/explorer/value | 33 +++++++++++++ conf/type/__key_value/gencode-remote | 52 +++++++++++++++++++++ conf/type/__key_value/man.text | 59 ++++++++++++++++++++++++ conf/type/__key_value/manifest | 26 +++++++++++ conf/type/__key_value/parameter/optional | 1 + conf/type/__key_value/parameter/required | 3 ++ 6 files changed, 174 insertions(+) create mode 100755 conf/type/__key_value/explorer/value create mode 100755 conf/type/__key_value/gencode-remote create mode 100644 conf/type/__key_value/man.text create mode 100755 conf/type/__key_value/manifest create mode 100644 conf/type/__key_value/parameter/optional create mode 100644 conf/type/__key_value/parameter/required diff --git a/conf/type/__key_value/explorer/value b/conf/type/__key_value/explorer/value new file mode 100755 index 00000000..b1d7983f --- /dev/null +++ b/conf/type/__key_value/explorer/value @@ -0,0 +1,33 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Get the current value of key or __NOTSET__ if the key doesn't exist. +# + +key="$(cat "$__object/parameter/key")" +file="$(cat "$__object/parameter/file")" +delimiter="$(cat "$__object/parameter/delimiter")" + +awk -F "$delimiter" ' +BEGIN { found=0 } +/^'$key'/ { print $2; found=1 } +END { if (found) exit 0; else exit 1 }' "$file" \ +|| echo "__NOTSET__" + diff --git a/conf/type/__key_value/gencode-remote b/conf/type/__key_value/gencode-remote new file mode 100755 index 00000000..e41cd9b5 --- /dev/null +++ b/conf/type/__key_value/gencode-remote @@ -0,0 +1,52 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + +value_is="$(cat "$__object/explorer/value")" +value_should="$(cat "$__object/parameter/value")" + +key="$(cat "$__object/parameter/key")" +file="$(cat "$__object/parameter/file")" +delimiter="$(cat "$__object/parameter/delimiter")" + +if [ "$value_is" != "$value_should" ]; then + case "$value_is" in + __NOTSET__) + # add key and value + echo "echo \"${key}${delimiter}${value_should}\" >> \"$file\"" + ;; + *) + if [ "$value_should" = '__NOTSET__' ]; then + # remove key and value + cat << DONE +sed -i '/^${key}/d' "$file" +DONE + else + # change value + cat << DONE +awk -F "$delimiter" ' +/${key}${delimiter}*/{gsub(/$value_is/, $value_should)};{print}' "$file" > "${file}+" \ +&& mv "${file}+" "$file" + +DONE + fi + ;; + esac +fi + diff --git a/conf/type/__key_value/man.text b/conf/type/__key_value/man.text new file mode 100644 index 00000000..78ba09a5 --- /dev/null +++ b/conf/type/__key_value/man.text @@ -0,0 +1,59 @@ +cdist-type__key_value(7) +========================== +Steven Armstrong + + +NAME +---- +cdist-type__key_value - Change property values in files + + +DESCRIPTION +----------- +This cdist type allows you to change values in a key value based config +file. + + +REQUIRED PARAMETERS +------------------- +value:: + The value for the key. Setting the value to __NOTSET__ will remove the key + from the file. +file:: + The file to operate on. +delimiter:: + The delimiter which seperates the key from the value. + + +OPTIONAL PARAMETERS +------------------- +key:: + The key to change. Defaults to object_id. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Set the maximum system user id +__key_value SYS_UID_MAX --file /etc/login.defs --value 666 --delimiter ' ' + +# Same with fancy id +__key_value my-fancy-id --file /etc/login.defs --key SYS_UID_MAX --value 666 \ + --delimiter ' ' + +# Enable packet forwarding +__key_value net.ipv4.ip_forward --file /etc/sysctl.conf --value 1 \ + --delimiter '=' +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__key_value/manifest b/conf/type/__key_value/manifest new file mode 100755 index 00000000..706b0b0d --- /dev/null +++ b/conf/type/__key_value/manifest @@ -0,0 +1,26 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + +if [ -f "$__object/parameter/key" ]; then + key="$(cat "$__object/parameter/key")" +else + echo "$__object_id" > "$__object/parameter/key" +fi + diff --git a/conf/type/__key_value/parameter/optional b/conf/type/__key_value/parameter/optional new file mode 100644 index 00000000..06bfde49 --- /dev/null +++ b/conf/type/__key_value/parameter/optional @@ -0,0 +1 @@ +key diff --git a/conf/type/__key_value/parameter/required b/conf/type/__key_value/parameter/required new file mode 100644 index 00000000..8f4aa53c --- /dev/null +++ b/conf/type/__key_value/parameter/required @@ -0,0 +1,3 @@ +value +file +delimiter From b959a14dc251826ff05a00d8cbc1226e408c4cb0 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 24 Mar 2011 23:22:08 +0100 Subject: [PATCH 0322/5465] fix length of ascidoc header Signed-off-by: Steven Armstrong --- conf/type/__key_value/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__key_value/man.text b/conf/type/__key_value/man.text index 78ba09a5..70711f97 100644 --- a/conf/type/__key_value/man.text +++ b/conf/type/__key_value/man.text @@ -1,5 +1,5 @@ cdist-type__key_value(7) -========================== +======================== Steven Armstrong From 46ceb3e3a924275bd096809b31f724044a502795 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 23:30:42 +0100 Subject: [PATCH 0323/5465] use variable instead of hardcoded value Signed-off-by: Nico Schottelius --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e43876b3..7b1e3dfa 100644 --- a/Makefile +++ b/Makefile @@ -121,10 +121,10 @@ test: # gentoo .rsync nicosc@ru3.inf.ethz.ch:cdist -web: man +web: manmove cp README $(WEBDIR)/$(WEBPAGE) rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man - cp -r doc/html/* $(WEBDIR)/$(WEBBASE)/man + cp -r $(HTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man cd $(WEBDIR) && git add $(WEBBASE)/man cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE) cd $(WEBDIR) && make pub From 79f6f90a05189bf4a6edca40e11c937c219631d3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 23:33:07 +0100 Subject: [PATCH 0324/5465] changelog+= __type/__key_value Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 6e119393..cd8cd4cc 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.4.1: * Manpage generation cleanup + * New type __key_value (Steven Armstrong) 1.4.0: 2011-03-24 * Add --recursive to __directory From fa309545a8b272ac3b2555c3bb3a4c2ec8ccabc4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 23:35:39 +0100 Subject: [PATCH 0325/5465] more stuff for 1.4.1 Signed-off-by: Nico Schottelius --- doc/changelog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index cd8cd4cc..fb0bb1f9 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,8 @@ 1.4.1: - * Manpage generation cleanup * New type __key_value (Steven Armstrong) + * New type __apt_ppa (Steven Armstrong) + * Documentation: Manpage generation cleanup + * Documentation: Manpage fix for __apt_ppa 1.4.0: 2011-03-24 * Add --recursive to __directory From ca139aa444650ae3815440a1f766122035a48460 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 23:40:56 +0100 Subject: [PATCH 0326/5465] fixup manpage move/html Signed-off-by: Nico Schottelius --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b1e3dfa..98ac3a76 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ manmove: $(MAN1DST) $(MAN7DST) $(MANHTML) mv doc/man/*.html $(HTMLDIR) for mantype in conf/type/*/man.html; do \ mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\ - mv $$mantype doc/html/$$mannew; \ + mv $$mantype $(HTMLDIR)/$$mannew; \ done # Reference depends on conf/type/*/man.text - HOWTO with posix make? From 4088da5d8c53e76920292ffb13dcfb21fba75343 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 24 Mar 2011 23:47:05 +0100 Subject: [PATCH 0327/5465] escape __NOTSET__ in man page Signed-off-by: Steven Armstrong --- conf/type/__key_value/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__key_value/man.text b/conf/type/__key_value/man.text index 70711f97..7b9381df 100644 --- a/conf/type/__key_value/man.text +++ b/conf/type/__key_value/man.text @@ -17,7 +17,7 @@ file. REQUIRED PARAMETERS ------------------- value:: - The value for the key. Setting the value to __NOTSET__ will remove the key + The value for the key. Setting the value to `__NOTSET__` will remove the key from the file. file:: The file to operate on. From 042638943a028b01965430b29951d0e544000014 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 11:17:52 +0100 Subject: [PATCH 0328/5465] begin real clean manpage solution Signed-off-by: Nico Schottelius --- Makefile | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 98ac3a76..fb6161b2 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,10 @@ WEBPAGE=$(WEBBASE).mdwn # Documentation MANDIR=doc/man -HTMLDIR=$(MANDIR)/html + +MAN1DSTDIR=$(MANDIR)/man1 +MAN7DSTDIR=$(MANDIR)/man7 +MANHTMLDIR=$(MANDIR)/html MAN1SRC= \ $(MANDIR)/cdist-code-run.text \ @@ -47,12 +50,14 @@ MAN7SRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-reference.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ - $(shell ls conf/type/*/man.text) + +MAN7TYPESRC=$(shell ls conf/type/*/man.text) MAN1DST=$(MAN1SRC:.text=.1) MAN7DST=$(MAN7SRC:.text=.7) MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html) + ################################################################################ # User targets # @@ -69,11 +74,15 @@ all: @echo '' -%.1 %.7: %.text +$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): + mkdir -p $< + +%.1 %.7: %.text $(MAN1DSTDIR) $(MAN7DSTDIR) $(A2XM) $*.text %.html: %.text - $(A2XH) $*.text + $(A2XH) -o $(MANHTMLDIR)/$(@F) $< + #$(A2XH) -o $(MANHTMLDIR)/$(@F) $*.text man: $(MAN1DST) $(MAN7DST) @@ -91,11 +100,11 @@ manmove: $(MAN1DST) $(MAN7DST) $(MANHTML) done # HTML - mkdir -p $(HTMLDIR) - mv doc/man/*.html $(HTMLDIR) + mkdir -p $(MANHTMLDIR) + mv doc/man/*.html $(MANHTMLDIR) for mantype in conf/type/*/man.html; do \ mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\ - mv $$mantype $(HTMLDIR)/$$mannew; \ + mv $$mantype $(MANHTMLDIR)/$$mannew; \ done # Reference depends on conf/type/*/man.text - HOWTO with posix make? @@ -107,7 +116,7 @@ $(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh clean: rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9] rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text - rm -rf $(HTMLDIR) + rm -rf $(MANHTMLDIR) ################################################################################ # Developer targets @@ -124,7 +133,7 @@ test: web: manmove cp README $(WEBDIR)/$(WEBPAGE) rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man - cp -r $(HTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man + cp -r $(MANHTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man cd $(WEBDIR) && git add $(WEBBASE)/man cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE) cd $(WEBDIR) && make pub From bbe4f940e37a667aa209a8134b2bdb964b2c7a7b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 11:34:29 +0100 Subject: [PATCH 0329/5465] in theory finish generation for man1 and man7 core cleanly Signed-off-by: Nico Schottelius --- Makefile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index fb6161b2..4af52565 100644 --- a/Makefile +++ b/Makefile @@ -53,8 +53,8 @@ MAN7SRC=$(MANDIR)/cdist.text \ MAN7TYPESRC=$(shell ls conf/type/*/man.text) -MAN1DST=$(MAN1SRC:.text=.1) -MAN7DST=$(MAN7SRC:.text=.7) +MAN1DST=$(addprefix $(MAN1DSTDIR)/,$(notdir $(MAN1SRC:.text=.1))) +MAN7DST=$(addprefix $(MAN7DSTDIR)/,$(notdir $(MAN7SRC:.text=.7))) MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html) @@ -74,15 +74,27 @@ all: @echo '' -$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): - mkdir -p $< +################################################################################ +# Documentation +# -%.1 %.7: %.text $(MAN1DSTDIR) $(MAN7DSTDIR) +# Create output dirs +$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): + mkdir -p $@ + +# Link source files +manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) + for mansrc in $(MAN1SRC); do ln -sf $$mansrc $(MAN1DSTDIR); done + for mansrc in $(MAN7SRC); do ln -sf $$mansrc $(MAN7DSTDIR); done + for mansrc in $(MAN7TYPESRC); do \ + dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \ + ln -sf $$mansrc $$dst; done + +%.1 %.7: %.text manlink $(A2XM) $*.text %.html: %.text $(A2XH) -o $(MANHTMLDIR)/$(@F) $< - #$(A2XH) -o $(MANHTMLDIR)/$(@F) $*.text man: $(MAN1DST) $(MAN7DST) From 6e85d65b72321c849ce224b6708bb031180310ec Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 11:35:43 +0100 Subject: [PATCH 0330/5465] and in practise link to .. is better than somewhere else Signed-off-by: Nico Schottelius --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4af52565..d0d43073 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,8 @@ $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): # Link source files manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) - for mansrc in $(MAN1SRC); do ln -sf $$mansrc $(MAN1DSTDIR); done - for mansrc in $(MAN7SRC); do ln -sf $$mansrc $(MAN7DSTDIR); done + for mansrc in $(notdir $(MAN1SRC)); do ln -sf ../$$mansrc $(MAN1DSTDIR); done + for mansrc in $(notdir $(MAN7SRC)); do ln -sf ../$$mansrc $(MAN7DSTDIR); done for mansrc in $(MAN7TYPESRC); do \ dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \ ln -sf $$mansrc $$dst; done From 3e72555e5923f9f433fd6f8dfd700cb53f8be41c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 11:46:56 +0100 Subject: [PATCH 0331/5465] make man is clean now Signed-off-by: Nico Schottelius --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d0d43073..47d0e3df 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ MAN7SRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-type.text \ MAN7TYPESRC=$(shell ls conf/type/*/man.text) - +MAN7TYPEDST=$(shell for mansrc in $(MAN7TYPESRC:.text=.7); do dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; echo $$dst; done) MAN1DST=$(addprefix $(MAN1DSTDIR)/,$(notdir $(MAN1SRC:.text=.1))) MAN7DST=$(addprefix $(MAN7DSTDIR)/,$(notdir $(MAN7SRC:.text=.7))) MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html) @@ -84,11 +84,11 @@ $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): # Link source files manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) - for mansrc in $(notdir $(MAN1SRC)); do ln -sf ../$$mansrc $(MAN1DSTDIR); done - for mansrc in $(notdir $(MAN7SRC)); do ln -sf ../$$mansrc $(MAN7DSTDIR); done + for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MAN1DSTDIR); done + for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MAN7DSTDIR); done for mansrc in $(MAN7TYPESRC); do \ dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \ - ln -sf $$mansrc $$dst; done + ln -sf ../../../$$mansrc $$dst; done %.1 %.7: %.text manlink $(A2XM) $*.text @@ -96,7 +96,7 @@ manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) %.html: %.text $(A2XH) -o $(MANHTMLDIR)/$(@F) $< -man: $(MAN1DST) $(MAN7DST) +man: $(MAN1DST) $(MAN7DST) $(MAN7TYPEDST) html: $(MANHTML) From 58391818ccd6a616524b7b98417870853603c4cf Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 11:52:51 +0100 Subject: [PATCH 0332/5465] remove old manmove target Signed-off-by: Nico Schottelius --- Makefile | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 47d0e3df..2b795740 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ MAN7TYPESRC=$(shell ls conf/type/*/man.text) MAN7TYPEDST=$(shell for mansrc in $(MAN7TYPESRC:.text=.7); do dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; echo $$dst; done) MAN1DST=$(addprefix $(MAN1DSTDIR)/,$(notdir $(MAN1SRC:.text=.1))) MAN7DST=$(addprefix $(MAN7DSTDIR)/,$(notdir $(MAN7SRC:.text=.7))) -MANHTML=$(MAN1SRC:.text=.html) $(MAN7SRC:.text=.html) +MANHTML=$(MAN1DST:.1=.html) $(MAN7DST:.7=.html) $(MAN7TYPEDST:.7=.html) ################################################################################ @@ -83,7 +83,7 @@ $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): mkdir -p $@ # Link source files -manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) +manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MAN1DSTDIR); done for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MAN7DSTDIR); done for mansrc in $(MAN7TYPESRC); do \ @@ -100,25 +100,6 @@ man: $(MAN1DST) $(MAN7DST) $(MAN7TYPEDST) html: $(MANHTML) -# man: doc/man/.marker - -# Move into manpath directories -manmove: $(MAN1DST) $(MAN7DST) $(MANHTML) - for manpage in $(MANDIR)/*.[1-9] conf/type/*/*.7; do \ - cat=$${manpage##*.}; \ - mandir=$(MANDIR)/man$$cat; \ - mkdir -p $$mandir; \ - mv $$manpage $$mandir; \ - done - - # HTML - mkdir -p $(MANHTMLDIR) - mv doc/man/*.html $(MANHTMLDIR) - for mantype in conf/type/*/man.html; do \ - mannew=$$(echo $$mantype | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;');\ - mv $$mantype $(MANHTMLDIR)/$$mannew; \ - done - # Reference depends on conf/type/*/man.text - HOWTO with posix make? $(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh $(MANDIR)/cdist-reference.text.sh From bd25d6810b836552a245677c8189e0ddcd4293fa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 19:39:50 +0100 Subject: [PATCH 0333/5465] makefile cleanup, todo add Signed-off-by: Nico Schottelius --- Makefile | 11 ++++++----- doc/dev/todo/TAKEME | 9 ++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 2b795740..3de70201 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,7 @@ all: @echo 'Here are the possible targets:' @echo '' @echo ' man: Build manpages (requires Asciidoc)' + @echo ' manhtml: Build html-manpages (requires Asciidoc)' @echo ' clean: Remove build stuff' @echo '' @echo '' @@ -83,7 +84,7 @@ $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): mkdir -p $@ # Link source files -manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) +manlink: $(MAN1SRC) $(MAN7SRC) $(MANTYPE7SRC) $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MAN1DSTDIR); done for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MAN7DSTDIR); done for mansrc in $(MAN7TYPESRC); do \ @@ -93,14 +94,14 @@ manlink: $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) %.1 %.7: %.text manlink $(A2XM) $*.text -%.html: %.text +%.html: %.text manlink $(A2XH) -o $(MANHTMLDIR)/$(@F) $< man: $(MAN1DST) $(MAN7DST) $(MAN7TYPEDST) -html: $(MANHTML) +# $(MANHTML): $(MANHTMLDIR) +manhtml: $(MANHTML) -# Reference depends on conf/type/*/man.text - HOWTO with posix make? $(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh $(MANDIR)/cdist-reference.text.sh $(A2XM) $(MANDIR)/cdist-reference.text @@ -109,7 +110,7 @@ $(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh clean: rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9] rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text - rm -rf $(MANHTMLDIR) + rm -rf $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) ################################################################################ # Developer targets diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 9fa083cc..2881c06c 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -1,7 +1,14 @@ +UNASSIGNED TODOS +---------------- The following list of todos has not been assigned to any developer. +Feel free to pick one! -Feel free to pick one: +CORE +---- +Only build manpages if necessary for types as well as for the core! +TYPES +------ Types to be written/extended: - __ssh-keys (host/user) - Think about __service - necessary? From 1a2f7bb8bb3df13ed9ae81c089eb31684e186e66 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 20:31:20 +0100 Subject: [PATCH 0334/5465] link type manpages into tempdir Signed-off-by: Nico Schottelius --- Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3de70201..b09d5719 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,8 @@ MANDIR=doc/man MAN1DSTDIR=$(MANDIR)/man1 MAN7DSTDIR=$(MANDIR)/man7 MANHTMLDIR=$(MANDIR)/html +MANTMPDIR=$(MANDIR)/tmp +MANOUTDIRS=$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) MAN1SRC= \ $(MANDIR)/cdist-code-run.text \ @@ -79,8 +81,18 @@ all: # Documentation # +# Type manpages are in no good format for asciidoc, make them look good! +manlinktypes: $(MANTMPDIR) + for mansrc in $(MAN7TYPESRC); do \ + dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;$(MANTMPDIR)/;')"; \ + ln -sf ../../../$$mansrc $$dst; done + +################################################################################ + +man: $(MAN1DST) $(MAN7DST) $(MAN7TYPEDST) + # Create output dirs -$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR): +$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) $(MANTMPDIR): mkdir -p $@ # Link source files @@ -91,14 +103,12 @@ manlink: $(MAN1SRC) $(MAN7SRC) $(MANTYPE7SRC) $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANH dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \ ln -sf ../../../$$mansrc $$dst; done -%.1 %.7: %.text manlink +%.1 %.7: %.text manlink $(MANOUTDIRS) $(A2XM) $*.text %.html: %.text manlink $(A2XH) -o $(MANHTMLDIR)/$(@F) $< -man: $(MAN1DST) $(MAN7DST) $(MAN7TYPEDST) - # $(MANHTML): $(MANHTMLDIR) manhtml: $(MANHTML) From 1398cde9f0f29f33420439ef608f50fe3d4a8e8d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 20:34:13 +0100 Subject: [PATCH 0335/5465] also link core manpages into tmp Signed-off-by: Nico Schottelius --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b09d5719..79188352 100644 --- a/Makefile +++ b/Makefile @@ -82,10 +82,12 @@ all: # # Type manpages are in no good format for asciidoc, make them look good! -manlinktypes: $(MANTMPDIR) +manlink: $(MANTMPDIR) for mansrc in $(MAN7TYPESRC); do \ dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;$(MANTMPDIR)/;')"; \ ln -sf ../../../$$mansrc $$dst; done + for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MANTMPDIR); done + for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MANTMPDIR); done ################################################################################ From 8c3782f091db1bcba723bf72d4f244d8d185fa60 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 20:49:09 +0100 Subject: [PATCH 0336/5465] further cleanups to the man build system Signed-off-by: Nico Schottelius --- Makefile | 52 +++++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index 79188352..e06db5c0 100644 --- a/Makefile +++ b/Makefile @@ -5,23 +5,20 @@ MANDIR=$(PREFIX)/share/man # Manpage and HTML A2XM=a2x -f manpage --no-xmllint -# A2XH=a2x -f xhtml --no-xmllint -A2XH=asciidoc -b xhtml11 +A2XH=a2x -f xhtml --no-xmllint -# Developer only +# Developer webbase WEBDIR=$$HOME/niconetz WEBBASE=software/cdist WEBPAGE=$(WEBBASE).mdwn - # Documentation MANDIR=doc/man MAN1DSTDIR=$(MANDIR)/man1 MAN7DSTDIR=$(MANDIR)/man7 MANHTMLDIR=$(MANDIR)/html -MANTMPDIR=$(MANDIR)/tmp -MANOUTDIRS=$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) +MANOUTDIRS=$(MAN1DSTDIR) $(MAN7DSTDIR) MAN1SRC= \ $(MANDIR)/cdist-code-run.text \ @@ -53,12 +50,17 @@ MAN7SRC=$(MANDIR)/cdist.text \ $(MANDIR)/cdist-stages.text \ $(MANDIR)/cdist-type.text \ +# Manpages from types MAN7TYPESRC=$(shell ls conf/type/*/man.text) -MAN7TYPEDST=$(shell for mansrc in $(MAN7TYPESRC:.text=.7); do dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; echo $$dst; done) -MAN1DST=$(addprefix $(MAN1DSTDIR)/,$(notdir $(MAN1SRC:.text=.1))) -MAN7DST=$(addprefix $(MAN7DSTDIR)/,$(notdir $(MAN7SRC:.text=.7))) -MANHTML=$(MAN1DST:.1=.html) $(MAN7DST:.7=.html) $(MAN7TYPEDST:.7=.html) +# Source files after linking them +MAN1TMPSRC=$(shell ls $(MAN1DSTDIR)/*.text) +MAN7TMPSRC=$(shell ls $(MAN7DSTDIR)/*.text) + +# Destination files based on linked files, not static list +MAN1DST=$(MAN1TMPSRC:.text=.1) +MAN7DST=$(MAN7TMPSRC:.text=.7) +MANHTML=$(MAN1TMPSRC:.text=.html) $(MAN7TMPSRC:.text=.html) ################################################################################ # User targets @@ -81,48 +83,36 @@ all: # Documentation # -# Type manpages are in no good format for asciidoc, make them look good! -manlink: $(MANTMPDIR) - for mansrc in $(MAN7TYPESRC); do \ - dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;$(MANTMPDIR)/;')"; \ - ln -sf ../../../$$mansrc $$dst; done - for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MANTMPDIR); done - for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MANTMPDIR); done +# Create manpages +man: $(MAN1DST) $(MAN7DST) +manhtml: $(MANHTML) -################################################################################ - -man: $(MAN1DST) $(MAN7DST) $(MAN7TYPEDST) +$(MANHTML): $(MANHTMLDIR) # Create output dirs $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) $(MANTMPDIR): mkdir -p $@ # Link source files -manlink: $(MAN1SRC) $(MAN7SRC) $(MANTYPE7SRC) $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) +manlink: $(MAN1SRC) $(MAN7SRC) $(MANTYPE7SRC) $(MANOUTDIRS) for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MAN1DSTDIR); done for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MAN7DSTDIR); done for mansrc in $(MAN7TYPESRC); do \ dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \ ln -sf ../../../$$mansrc $$dst; done -%.1 %.7: %.text manlink $(MANOUTDIRS) +%.1 %.7: %.text manlink $(A2XM) $*.text %.html: %.text manlink - $(A2XH) -o $(MANHTMLDIR)/$(@F) $< - -# $(MANHTML): $(MANHTMLDIR) -manhtml: $(MANHTML) + $(A2XH) $< $(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh $(MANDIR)/cdist-reference.text.sh - $(A2XM) $(MANDIR)/cdist-reference.text - $(A2XH) $(MANDIR)/cdist-reference.text clean: - rm -rf doc/man/html/* doc/man/*.[1-9] doc/man/man[1-9] - rm -f conf/type/*/man.html $(MANDIR)/cdist-reference.text - rm -rf $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) + rm -rf $(MANOUTDIRS) + rm -f $(MANDIR)/cdist-reference.text ################################################################################ # Developer targets From 8a01df66dd8b7202a7e604f12f81bb47a3eee565 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 20:54:50 +0100 Subject: [PATCH 0337/5465] does not work: MAN1TMPSRC=$(shell ls $(MAN1DSTDIR)/*.text) is expanded before manlink was run Signed-off-by: Nico Schottelius --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e06db5c0..fc55ea03 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ all: man: $(MAN1DST) $(MAN7DST) manhtml: $(MANHTML) -$(MANHTML): $(MANHTMLDIR) +$(MAN1DST) $(MAN7DST) $(MANHTML): $(MANOUTDIRS) # Create output dirs $(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) $(MANTMPDIR): From 4d33e524a122745c8d62eb0015cd4b9ef46d4092 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 20:56:25 +0100 Subject: [PATCH 0338/5465] begin to migrate makefile to shell script Signed-off-by: Nico Schottelius --- Makefile => build.sh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) rename Makefile => build.sh (80%) diff --git a/Makefile b/build.sh similarity index 80% rename from Makefile rename to build.sh index fc55ea03..f8544f09 100644 --- a/Makefile +++ b/build.sh @@ -1,7 +1,27 @@ -# General -PREFIX=/usr -BINDIR=$(PREFIX)/bin -MANDIR=$(PREFIX)/share/man +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Push a directory to a target, both sides have the same name (i.e. explorers) +# or +# Pull a directory from a target, both sides have the same name (i.e. explorers) +# # Manpage and HTML A2XM=a2x -f manpage --no-xmllint @@ -17,7 +37,6 @@ MANDIR=doc/man MAN1DSTDIR=$(MANDIR)/man1 MAN7DSTDIR=$(MANDIR)/man7 -MANHTMLDIR=$(MANDIR)/html MANOUTDIRS=$(MAN1DSTDIR) $(MAN7DSTDIR) MAN1SRC= \ From 8b9b95f98479c3002c9ca13da9ff8295f9d3d4ef Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 21:04:26 +0100 Subject: [PATCH 0339/5465] partial transformation Signed-off-by: Nico Schottelius --- build.sh | 156 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 84 insertions(+), 72 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index f8544f09..8509eddc --- a/build.sh +++ b/build.sh @@ -24,57 +24,98 @@ # # Manpage and HTML -A2XM=a2x -f manpage --no-xmllint -A2XH=a2x -f xhtml --no-xmllint +A2XM="a2x -f manpage --no-xmllint" +A2XH="a2x -f xhtml --no-xmllint" # Developer webbase -WEBDIR=$$HOME/niconetz +WEBDIR=$HOME/niconetz WEBBASE=software/cdist -WEBPAGE=$(WEBBASE).mdwn +WEBPAGE=${WEBBASE}.mdwn # Documentation MANDIR=doc/man - -MAN1DSTDIR=$(MANDIR)/man1 -MAN7DSTDIR=$(MANDIR)/man7 -MANOUTDIRS=$(MAN1DSTDIR) $(MAN7DSTDIR) +MAN1DSTDIR=${MANDIR}/man1 +MAN7DSTDIR=${MANDIR}/man7 MAN1SRC= \ - $(MANDIR)/cdist-code-run.text \ - $(MANDIR)/cdist-code-run-all.text \ - $(MANDIR)/cdist-config.text \ - $(MANDIR)/cdist-dir.text \ - $(MANDIR)/cdist-env.text \ - $(MANDIR)/cdist-explorer-run-global.text \ - $(MANDIR)/cdist-deploy-to.text \ - $(MANDIR)/cdist-explorer.text \ - $(MANDIR)/cdist-manifest.text \ - $(MANDIR)/cdist-manifest-run.text \ - $(MANDIR)/cdist-manifest-run-init.text \ - $(MANDIR)/cdist-manifest-run-all.text \ - $(MANDIR)/cdist-object-explorer-all.text \ - $(MANDIR)/cdist-object-gencode.text \ - $(MANDIR)/cdist-object-gencode-all.text \ - $(MANDIR)/cdist-remote-explorer-run.text \ - $(MANDIR)/cdist-run-remote.text \ - $(MANDIR)/cdist-type-build-emulation.text \ - $(MANDIR)/cdist-type-emulator.text \ - $(MANDIR)/cdist-type-template.text \ + ${MANDIR}/cdist-code-run.text \ + ${MANDIR}/cdist-code-run-all.text \ + ${MANDIR}/cdist-config.text \ + ${MANDIR}/cdist-dir.text \ + ${MANDIR}/cdist-env.text \ + ${MANDIR}/cdist-explorer-run-global.text \ + ${MANDIR}/cdist-deploy-to.text \ + ${MANDIR}/cdist-explorer.text \ + ${MANDIR}/cdist-manifest.text \ + ${MANDIR}/cdist-manifest-run.text \ + ${MANDIR}/cdist-manifest-run-init.text \ + ${MANDIR}/cdist-manifest-run-all.text \ + ${MANDIR}/cdist-object-explorer-all.text \ + ${MANDIR}/cdist-object-gencode.text \ + ${MANDIR}/cdist-object-gencode-all.text \ + ${MANDIR}/cdist-remote-explorer-run.text \ + ${MANDIR}/cdist-run-remote.text \ + ${MANDIR}/cdist-type-build-emulation.text \ + ${MANDIR}/cdist-type-emulator.text \ + ${MANDIR}/cdist-type-template.text + +MAN7SRC=${MANDIR}/cdist.text \ + ${MANDIR}/cdist-best-practise.text \ + ${MANDIR}/cdist-hacker.text \ + ${MANDIR}/cdist-quickstart.text \ + ${MANDIR}/cdist-reference.text \ + ${MANDIR}/cdist-stages.text \ + ${MANDIR}/cdist-type.text \ + + +case "$1" in + man) + for mansrc in ${MAN1SRC} ${MAN7SRC}; do + ln -sf ../../../$mansrc ${MAN1DSTDIR}; + done + for mansrc in ${MAN7TYPESRC}; do + dst="$(echo $mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')" + ln -sf ../../../$$mansrc $$dst + done + ;; + + web) + cp README ${WEBDIR}/${WEBPAGE} + rm -rf ${WEBDIR}/${WEBBASE}/man && mkdir ${WEBDIR}/${WEBBASE}/man + cp -r $(MANHTMLDIR)/* ${WEBDIR}/${WEBBASE}/man + cd ${WEBDIR} && git add ${WEBBASE}/man + cd ${WEBDIR} && git commit -m "cdist update" ${WEBBASE} ${WEBPAGE} + cd ${WEBDIR} && make pub + ;; + + pub) + git push --mirror + git push --mirror github + ;; + + *) + echo '' + echo 'Welcome to cdist!' + echo '' + echo 'Here are the possible targets:' + echo '' + echo ' man: Build manpages (requires Asciidoc)' + echo ' manhtml: Build html-manpages (requires Asciidoc)' + echo ' clean: Remove build stuff' + echo '' + echo '' + echo "Unknown target, \"$1\"" >&2 + exit 1 + ;; +esac -MAN7SRC=$(MANDIR)/cdist.text \ - $(MANDIR)/cdist-best-practise.text \ - $(MANDIR)/cdist-hacker.text \ - $(MANDIR)/cdist-quickstart.text \ - $(MANDIR)/cdist-reference.text \ - $(MANDIR)/cdist-stages.text \ - $(MANDIR)/cdist-type.text \ # Manpages from types -MAN7TYPESRC=$(shell ls conf/type/*/man.text) +MAN7TYPESRC=$(ls conf/type/*/man.text) # Source files after linking them -MAN1TMPSRC=$(shell ls $(MAN1DSTDIR)/*.text) -MAN7TMPSRC=$(shell ls $(MAN7DSTDIR)/*.text) +MAN1TMPSRC=$(shell ls ${MAN1DSTDIR}/*.text) +MAN7TMPSRC=$(shell ls ${MAN7DSTDIR}/*.text) # Destination files based on linked files, not static list MAN1DST=$(MAN1TMPSRC:.text=.1) @@ -85,18 +126,6 @@ MANHTML=$(MAN1TMPSRC:.text=.html) $(MAN7TMPSRC:.text=.html) # User targets # -all: - @echo '' - @echo 'Welcome to cdist!' - @echo '' - @echo 'Here are the possible targets:' - @echo '' - @echo ' man: Build manpages (requires Asciidoc)' - @echo ' manhtml: Build html-manpages (requires Asciidoc)' - @echo ' clean: Remove build stuff' - @echo '' - @echo '' - ################################################################################ # Documentation @@ -109,16 +138,11 @@ manhtml: $(MANHTML) $(MAN1DST) $(MAN7DST) $(MANHTML): $(MANOUTDIRS) # Create output dirs -$(MAN1DSTDIR) $(MAN7DSTDIR) $(MANHTMLDIR) $(MANTMPDIR): +${MAN1DSTDIR} ${MAN7DSTDIR} $(MANHTMLDIR) $(MANTMPDIR): mkdir -p $@ # Link source files -manlink: $(MAN1SRC) $(MAN7SRC) $(MANTYPE7SRC) $(MANOUTDIRS) - for mansrc in $(MAN1SRC); do ln -sf ../../../$$mansrc $(MAN1DSTDIR); done - for mansrc in $(MAN7SRC); do ln -sf ../../../$$mansrc $(MAN7DSTDIR); done - for mansrc in $(MAN7TYPESRC); do \ - dst="$$(echo $$mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')"; \ - ln -sf ../../../$$mansrc $$dst; done +manlink: ${MAN1SRC} ${MAN7SRC} $(MANTYPE7SRC) $(MANOUTDIRS) %.1 %.7: %.text manlink $(A2XM) $*.text @@ -126,12 +150,12 @@ manlink: $(MAN1SRC) $(MAN7SRC) $(MANTYPE7SRC) $(MANOUTDIRS) %.html: %.text manlink $(A2XH) $< -$(MANDIR)/cdist-reference.text: $(MANDIR)/cdist-reference.text.sh - $(MANDIR)/cdist-reference.text.sh +${MANDIR}/cdist-reference.text: ${MANDIR}/cdist-reference.text.sh + ${MANDIR}/cdist-reference.text.sh clean: rm -rf $(MANOUTDIRS) - rm -f $(MANDIR)/cdist-reference.text + rm -f ${MANDIR}/cdist-reference.text ################################################################################ # Developer targets @@ -144,15 +168,3 @@ test: .rsync nicosc@free.ethz.ch:cdist # gentoo .rsync nicosc@ru3.inf.ethz.ch:cdist - -web: manmove - cp README $(WEBDIR)/$(WEBPAGE) - rm -rf $(WEBDIR)/$(WEBBASE)/man && mkdir $(WEBDIR)/$(WEBBASE)/man - cp -r $(MANHTMLDIR)/* $(WEBDIR)/$(WEBBASE)/man - cd $(WEBDIR) && git add $(WEBBASE)/man - cd $(WEBDIR) && git commit -m "cdist update" $(WEBBASE) $(WEBPAGE) - cd $(WEBDIR) && make pub - -pub: - git push --mirror - git push --mirror github From 88ca7a44ec5180034afb31ce816d690fdbf5f47a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:10:52 +0100 Subject: [PATCH 0340/5465] finish most parts of translation Signed-off-by: Nico Schottelius --- build.sh | 157 +++++++++++++++++++++---------------------------------- 1 file changed, 59 insertions(+), 98 deletions(-) diff --git a/build.sh b/build.sh index 8509eddc..cf0574fd 100755 --- a/build.sh +++ b/build.sh @@ -37,55 +37,71 @@ MANDIR=doc/man MAN1DSTDIR=${MANDIR}/man1 MAN7DSTDIR=${MANDIR}/man7 -MAN1SRC= \ - ${MANDIR}/cdist-code-run.text \ - ${MANDIR}/cdist-code-run-all.text \ - ${MANDIR}/cdist-config.text \ - ${MANDIR}/cdist-dir.text \ - ${MANDIR}/cdist-env.text \ - ${MANDIR}/cdist-explorer-run-global.text \ - ${MANDIR}/cdist-deploy-to.text \ - ${MANDIR}/cdist-explorer.text \ - ${MANDIR}/cdist-manifest.text \ - ${MANDIR}/cdist-manifest-run.text \ - ${MANDIR}/cdist-manifest-run-init.text \ - ${MANDIR}/cdist-manifest-run-all.text \ - ${MANDIR}/cdist-object-explorer-all.text \ - ${MANDIR}/cdist-object-gencode.text \ - ${MANDIR}/cdist-object-gencode-all.text \ - ${MANDIR}/cdist-remote-explorer-run.text \ - ${MANDIR}/cdist-run-remote.text \ - ${MANDIR}/cdist-type-build-emulation.text \ - ${MANDIR}/cdist-type-emulator.text \ - ${MANDIR}/cdist-type-template.text - -MAN7SRC=${MANDIR}/cdist.text \ - ${MANDIR}/cdist-best-practise.text \ - ${MANDIR}/cdist-hacker.text \ - ${MANDIR}/cdist-quickstart.text \ - ${MANDIR}/cdist-reference.text \ - ${MANDIR}/cdist-stages.text \ - ${MANDIR}/cdist-type.text \ - - case "$1" in man) - for mansrc in ${MAN1SRC} ${MAN7SRC}; do - ln -sf ../../../$mansrc ${MAN1DSTDIR}; + set -e + "$0" mandirs + "$0" mantype + "$0" man1 + "$0" man7 + "$0" manbuild + ;; + + manbuild) + for src in ${MAN1DSTDIR}/*.text ${MAN7DSTDIR}/*.text; do + echo "Compiling manpage and html for $src" + $A2XM "$src" + $A2XH "$src" done + ;; + + mandirs) + # Create destination directories + mkdir -p "${MAN1DSTDIR}" "${MAN7DSTDIR}" + ;; + + mantype) for mansrc in ${MAN7TYPESRC}; do dst="$(echo $mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')" - ln -sf ../../../$$mansrc $$dst + ln -sf "../../../$mansrc" "$dst" done ;; + man1) + for man in cdist-code-run.text cdist-code-run-all.text cdist-config.text \ + cdist-dir.text cdist-env.text cdist-explorer-run-global.text \ + cdist-deploy-to.text cdist-explorer.text cdist-manifest.text \ + cdist-manifest-run.text cdist-manifest-run-init.text \ + cdist-manifest-run-all.text cdist-object-explorer-all.text \ + cdist-object-gencode.text cdist-object-gencode-all.text \ + cdist-remote-explorer-run.text cdist-run-remote.text \ + cdist-type-build-emulation.text cdist-type-emulator.text \ + cdist-type-template.text + do + ln -sf ../$man ${MAN1DSTDIR} + done + ;; + + man7) + for man in cdist.text cdist-best-practise.text cdist-hacker.text \ + cdist-quickstart.text cdist-reference.text cdist-stages.text \ + cdist-type.text + do + ln -sf ../$man ${MAN7DSTDIR} + done + ;; + + mangen) + ${MANDIR}/cdist-reference.text.sh + ;; + web) cp README ${WEBDIR}/${WEBPAGE} rm -rf ${WEBDIR}/${WEBBASE}/man && mkdir ${WEBDIR}/${WEBBASE}/man - cp -r $(MANHTMLDIR)/* ${WEBDIR}/${WEBBASE}/man - cd ${WEBDIR} && git add ${WEBBASE}/man - cd ${WEBDIR} && git commit -m "cdist update" ${WEBBASE} ${WEBPAGE} - cd ${WEBDIR} && make pub + cp -r ${MANHTMLDIR}/* ${WEBDIR}/${WEBBASE}/man + cd ${WEBDIR} && echo git add ${WEBBASE}/man + cd ${WEBDIR} && echo git commit -m "cdist update" ${WEBBASE} ${WEBPAGE} + cd ${WEBDIR} && echo make pub ;; pub) @@ -93,6 +109,11 @@ case "$1" in git push --mirror github ;; + clean) + rm -rf "$MAN1DSTDIR" "$MAN7DSTDIR" + rm -f ${MANDIR}/cdist-reference.text + ;; + *) echo '' echo 'Welcome to cdist!' @@ -108,63 +129,3 @@ case "$1" in exit 1 ;; esac - - -# Manpages from types -MAN7TYPESRC=$(ls conf/type/*/man.text) - -# Source files after linking them -MAN1TMPSRC=$(shell ls ${MAN1DSTDIR}/*.text) -MAN7TMPSRC=$(shell ls ${MAN7DSTDIR}/*.text) - -# Destination files based on linked files, not static list -MAN1DST=$(MAN1TMPSRC:.text=.1) -MAN7DST=$(MAN7TMPSRC:.text=.7) -MANHTML=$(MAN1TMPSRC:.text=.html) $(MAN7TMPSRC:.text=.html) - -################################################################################ -# User targets -# - - -################################################################################ -# Documentation -# - -# Create manpages -man: $(MAN1DST) $(MAN7DST) -manhtml: $(MANHTML) - -$(MAN1DST) $(MAN7DST) $(MANHTML): $(MANOUTDIRS) - -# Create output dirs -${MAN1DSTDIR} ${MAN7DSTDIR} $(MANHTMLDIR) $(MANTMPDIR): - mkdir -p $@ - -# Link source files -manlink: ${MAN1SRC} ${MAN7SRC} $(MANTYPE7SRC) $(MANOUTDIRS) - -%.1 %.7: %.text manlink - $(A2XM) $*.text - -%.html: %.text manlink - $(A2XH) $< - -${MANDIR}/cdist-reference.text: ${MANDIR}/cdist-reference.text.sh - ${MANDIR}/cdist-reference.text.sh - -clean: - rm -rf $(MANOUTDIRS) - rm -f ${MANDIR}/cdist-reference.text - -################################################################################ -# Developer targets -# - -test: - # ubuntu - .rsync lyni@tablett:cdist - # redhat - .rsync nicosc@free.ethz.ch:cdist - # gentoo - .rsync nicosc@ru3.inf.ethz.ch:cdist From 683e813ce22da3ff76933dff093710e16a104db7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:13:07 +0100 Subject: [PATCH 0341/5465] adjust web target Signed-off-by: Nico Schottelius --- build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index cf0574fd..2c1570f5 100755 --- a/build.sh +++ b/build.sh @@ -98,10 +98,10 @@ case "$1" in web) cp README ${WEBDIR}/${WEBPAGE} rm -rf ${WEBDIR}/${WEBBASE}/man && mkdir ${WEBDIR}/${WEBBASE}/man - cp -r ${MANHTMLDIR}/* ${WEBDIR}/${WEBBASE}/man - cd ${WEBDIR} && echo git add ${WEBBASE}/man - cd ${WEBDIR} && echo git commit -m "cdist update" ${WEBBASE} ${WEBPAGE} - cd ${WEBDIR} && echo make pub + cp ${MAN1DSTDIR}/*.html ${MAN7DSTDIR}/*.html ${WEBDIR}/${WEBBASE}/man + cd ${WEBDIR} && git add ${WEBBASE}/man + cd ${WEBDIR} && git commit -m "cdist update" ${WEBBASE} ${WEBPAGE} + cd ${WEBDIR} && make pub ;; pub) From 3356564c7772bfc1202aed4957663a23ce2b60e7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:24:02 +0100 Subject: [PATCH 0342/5465] upgrade to 1.4.1 Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- doc/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 00872438..86039f00 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.4.0" +__cdist_version="1.4.1" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index fb0bb1f9..5cfae26f 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.4.1: +1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) * New type __apt_ppa (Steven Armstrong) * Documentation: Manpage generation cleanup From 7a56c5466e9ddf53e53c831e00af361f8f3844f3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:28:34 +0100 Subject: [PATCH 0343/5465] use build.sh in documentation Signed-off-by: Nico Schottelius --- README | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README b/README index 389470a0..48b934f1 100644 --- a/README +++ b/README @@ -77,6 +77,7 @@ cdist was tested or is know to run on at least * [Debian](http://www.debian.org/) * [Gentoo](http://www.gentoo.org/) * [Mac OS X](http://www.apple.com/macosx/) + * [OpenBSD](http://www.openbsd.org) * [Redhat](http://www.redhat.com/) * [Ubuntu](http://www.ubuntu.com/) @@ -108,7 +109,7 @@ To install cdist, execute the following commands: export PATH=$PATH:$(pwd -P)/bin # If you want the manpages (requires gmake and asciidoc to be installed) - make man + ./build.sh man export MANPATH=$MANPATH:$(pwd -P)/doc/man @@ -150,7 +151,7 @@ To upgrade cdist in the current branch use git pull # Also update the manpages - make man + ./build.sh man export MANPATH=$MANPATH:$(pwd -P)/doc/man If you stay on a version branche (i.e. 1.0, 1.1., ...), nothing should break. From 7f2ca78b8238e037cab7fddf829cebb6172196f4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:34:11 +0100 Subject: [PATCH 0344/5465] spell correction Signed-off-by: Nico Schottelius --- .../{cdist-best-practise.text => cdist-best-practice.text} | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) rename doc/man/{cdist-best-practise.text => cdist-best-practice.text} (96%) diff --git a/doc/man/cdist-best-practise.text b/doc/man/cdist-best-practice.text similarity index 96% rename from doc/man/cdist-best-practise.text rename to doc/man/cdist-best-practice.text index af06084e..febe8f36 100644 --- a/doc/man/cdist-best-practise.text +++ b/doc/man/cdist-best-practice.text @@ -1,10 +1,10 @@ -cdist-best-practise(7) +cdist-best-practice(7) ====================== Nico Schottelius NAME ---- -cdist-best-practise - Practises used in real environments +cdist-best-practice - Practices used in real environments PASSWORDLESS CONNECTIONS @@ -61,7 +61,6 @@ machine-b % git clone git://your-git-server/cdist -------------------------------------------------------------------------------- - SEE ALSO -------- - cdist(7) From a55eb6ebc97713a4b9f9f4aab45cf761f119ad14 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 22:54:17 +0100 Subject: [PATCH 0345/5465] correct mantype linking and finish spell check Signed-off-by: Nico Schottelius --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 2c1570f5..4fc65b0d 100755 --- a/build.sh +++ b/build.sh @@ -41,6 +41,7 @@ case "$1" in man) set -e "$0" mandirs + "$0" mangen "$0" mantype "$0" man1 "$0" man7 @@ -61,7 +62,7 @@ case "$1" in ;; mantype) - for mansrc in ${MAN7TYPESRC}; do + for mansrc in conf/type/*/man.text; do dst="$(echo $mansrc | sed -e 's;conf/;cdist-;' -e 's;/;;' -e 's;/man;;' -e 's;^;doc/man/man7/;')" ln -sf "../../../$mansrc" "$dst" done @@ -83,7 +84,7 @@ case "$1" in ;; man7) - for man in cdist.text cdist-best-practise.text cdist-hacker.text \ + for man in cdist.text cdist-best-practice.text cdist-hacker.text \ cdist-quickstart.text cdist-reference.text cdist-stages.text \ cdist-type.text do From 5ec1a6cc2d9f43b7b2cb7a65608a1d11ee7e08fb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:06:30 +0100 Subject: [PATCH 0346/5465] rephrase cdist and add prominent example section Signed-off-by: Nico Schottelius --- doc/man/cdist.text | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/man/cdist.text b/doc/man/cdist.text index 44be52b1..a4c88c1d 100644 --- a/doc/man/cdist.text +++ b/doc/man/cdist.text @@ -10,8 +10,13 @@ cdist - Configuration management system DESCRIPTION ----------- -Cdist is a very simple, elegant, cleanly designed configuration management -system. The easiest way to get started with cdist is to run cdist-quickstart. +Cdist is a usable configuration management system. +The easiest way to get started with cdist is to initialise +the environment and run cdist-quickstart: + +-------------------------------------------------------------------------------- +eval `./bin/cdist-env` && cdist-quickstart +-------------------------------------------------------------------------------- Cdist configurations are written in the shell scripting language. The mapping of configurations to hosts is defined in so called manifests, From 8f88ed269198b83b101993355e9bd31d294e749c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:17:35 +0100 Subject: [PATCH 0347/5465] template for cdist-cache Signed-off-by: Nico Schottelius --- bin/cdist-cache | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 bin/cdist-cache diff --git a/bin/cdist-cache b/bin/cdist-cache new file mode 100755 index 00000000..d4ea18bb --- /dev/null +++ b/bin/cdist-cache @@ -0,0 +1,56 @@ +#!/bin/sh +# +# 2010 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Let's build a cconfig tree from a configuration +# And save it into the cache tree +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -u + +__cdist_target_host="$1"; shift +__cdist_manifest="$1"; shift + +################################################################################ +# Export information for cdist-type-emulator or manifest +# + +# Config dir should not get reset - FIXME: why did I do this? +export __cdist_conf_dir + +# Used to record the source in the object +export __cdist_manifest + +# Export information for manifests - __cdist_out_dir comes from cdist-config +export __global="$__cdist_out_dir" + +################################################################################ +# The actual run +# + +# Ensure binaries exist and are up-to-date +cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ + || __cdist_exit_err "Failed to build type emulation binaries" + +# prepend our path, so all cdist tools come before other tools +export PATH="${__cdist_out_type_bin_dir}:$PATH" + +__cdist_exec_fail_on_error "${__cdist_manifest}" From a9ce26f96858ec15fa88d3b26401bf1adc8ab10f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:35:11 +0100 Subject: [PATCH 0348/5465] integrate cdist-cache Signed-off-by: Nico Schottelius --- .gitignore | 9 ++------- bin/cdist-cache | 33 +++++++-------------------------- bin/cdist-config | 2 ++ bin/cdist-deploy-to | 1 + 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index fdf9184f..68f829dc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,13 +2,8 @@ .*.swp # Ignore generated manpages -doc/man/*.[1-9] doc/man/.marker doc/man/man*/ -doc/html - -conf/type/*/*.7 -conf/type/*/man.html - - +# Ignore cache for version control +cache/ diff --git a/bin/cdist-cache b/bin/cdist-cache index d4ea18bb..120b0df2 100755 --- a/bin/cdist-cache +++ b/bin/cdist-cache @@ -23,34 +23,15 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 1 ] || __cdist_usage "" set -u __cdist_target_host="$1"; shift -__cdist_manifest="$1"; shift -################################################################################ -# Export information for cdist-type-emulator or manifest -# +mkdir -p "${__cdist_local_base_cache_dir}" +__cdist_abs_cache_dir="$(cd "$__cdist_local_base_cache_dir" && pwd -P)" +__cdist_abs_ddir="$__cdist_abs_cache_dir/$__cdist_target_host" -# Config dir should not get reset - FIXME: why did I do this? -export __cdist_conf_dir - -# Used to record the source in the object -export __cdist_manifest - -# Export information for manifests - __cdist_out_dir comes from cdist-config -export __global="$__cdist_out_dir" - -################################################################################ -# The actual run -# - -# Ensure binaries exist and are up-to-date -cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \ - || __cdist_exit_err "Failed to build type emulation binaries" - -# prepend our path, so all cdist tools come before other tools -export PATH="${__cdist_out_type_bin_dir}:$PATH" - -__cdist_exec_fail_on_error "${__cdist_manifest}" +echo "Saving cache to $__cdist_abs_ddir ..." +rm -rf "$__cdist_abs_ddir" +mv "$__cdist_local_base_dir" "$__cdist_abs_ddir" diff --git a/bin/cdist-config b/bin/cdist-config index 86039f00..ccab81cc 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -41,6 +41,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" # : ${__cdist_name_bin:=bin} +: ${__cdist_name_cache:=cache} : ${__cdist_name_code:=code} : ${__cdist_name_code_finished:=codedone} : ${__cdist_name_conf_dir:=conf} @@ -100,6 +101,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") # Local Base # : ${__cdist_local_base_dir:=$__cdist_tmp_dir} +: ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache} : ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"} diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 9a2fd303..3a2c37c9 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -58,5 +58,6 @@ cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ "${__cdist_remote_out_object_base_dir}" cdist-code-run-all "$__cdist_target_host" +cdist-cache "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" From a11e9791650be176d0c270edf7d8dca9b58319d4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:36:42 +0100 Subject: [PATCH 0349/5465] update todos Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 3556f371..ada791ca 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,8 +1,12 @@ Core: - support $__self = relative_type/object_id - - cache Cache: + - add manpage + - add example how to use + - export variable $__cache + -> to all hosts or this host? + Assume you want to configure stuff one host ("monitor node"), depending on the configuration of other hosts ("cluster nodes"). From 76725c1b0db5923069fdc5734c37551a2efa68a6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:43:23 +0100 Subject: [PATCH 0350/5465] begin to document cache Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 25 ++------------------- doc/man/cdist-cache.text | 47 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 23 deletions(-) create mode 100644 doc/man/cdist-cache.text diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index ada791ca..6b0891a2 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,27 +1,6 @@ -Core: - - support $__self = relative_type/object_id - Cache: - - add manpage - add example how to use - export variable $__cache -> to all hosts or this host? - - Assume you want to configure stuff one host ("monitor node"), - depending on the configuration of other hosts ("cluster nodes"). - - For instance, the monitor host would like to know, - which hosts are configured with the provider - "apache" and option --start true. - - This requires the monitor node to be able to - query all other configured nodes. It can't - ask for all hosts, because cdist does not - know which hosts are configured or may exist. - - Example implementation - - If cdist keeps ("caches") the configuration of every - node it configures, each new node can query the - cache for existing nodes that acquired the given - configuration. +Core: + - support $__self = relative_type/object_id diff --git a/doc/man/cdist-cache.text b/doc/man/cdist-cache.text new file mode 100644 index 00000000..cbf4c9d7 --- /dev/null +++ b/doc/man/cdist-cache.text @@ -0,0 +1,47 @@ +cdist-cache(1) +============== +Nico Schottelius + + +NAME +---- +cdist-cache - Cache output of last run + + +SYNOPSIS +-------- +cdist-cache TARGET_HOST + + +DESCRIPTION +----------- + + Assume you want to configure stuff one host ("monitor node"), + depending on the configuration of other hosts ("cluster nodes"). + + For instance, the monitor host would like to know, + which hosts are configured with the provider + "apache" and option --start true. + + This requires the monitor node to be able to + query all other configured nodes. It can't + ask for all hosts, because cdist does not + know which hosts are configured or may exist. + + Example implementation + + If cdist keeps ("caches") the configuration of every + node it configures, each new node can query the + cache for existing nodes that acquired the given + configuration. + + +SEE ALSO +-------- +cdist(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 652c0c1615d9b73eee55cdeb2445be1a179db871 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:52:13 +0100 Subject: [PATCH 0351/5465] document stuff for next release Signed-off-by: Nico Schottelius --- build.sh | 2 +- doc/changelog | 4 +++- doc/man/cdist-cache.text | 22 +++------------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/build.sh b/build.sh index 4fc65b0d..b91db496 100755 --- a/build.sh +++ b/build.sh @@ -86,7 +86,7 @@ case "$1" in man7) for man in cdist.text cdist-best-practice.text cdist-hacker.text \ cdist-quickstart.text cdist-reference.text cdist-stages.text \ - cdist-type.text + cdist-type.text cdist-cache.text do ln -sf ../$man ${MAN7DSTDIR} done diff --git a/doc/changelog b/doc/changelog index 5cfae26f..93d0f7e4 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.5.0: + * Add cache functionality + 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) * New type __apt_ppa (Steven Armstrong) @@ -41,7 +44,6 @@ * Document cdist-object-gencode-all * Document cdist-manifest-run - 1.1.0: 2011-03-16 * Replace type __file with __file, __directory, __link * Document cdist-env diff --git a/doc/man/cdist-cache.text b/doc/man/cdist-cache.text index cbf4c9d7..54619199 100644 --- a/doc/man/cdist-cache.text +++ b/doc/man/cdist-cache.text @@ -15,25 +15,9 @@ cdist-cache TARGET_HOST DESCRIPTION ----------- - - Assume you want to configure stuff one host ("monitor node"), - depending on the configuration of other hosts ("cluster nodes"). - - For instance, the monitor host would like to know, - which hosts are configured with the provider - "apache" and option --start true. - - This requires the monitor node to be able to - query all other configured nodes. It can't - ask for all hosts, because cdist does not - know which hosts are configured or may exist. - - Example implementation - - If cdist keeps ("caches") the configuration of every - node it configures, each new node can query the - cache for existing nodes that acquired the given - configuration. +cdist-cache moves away the objects created during last run so the +next run can use the previous information and compare them with +the current status. SEE ALSO From 38a9c5d60fb492945aeb6b2ddf7f8466d991f40f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 25 Mar 2011 23:53:38 +0100 Subject: [PATCH 0352/5465] ++todo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 6b0891a2..05a44503 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +1,9 @@ Cache: - add example how to use - export variable $__cache - -> to all hosts or this host? + -> for current host + -> add function to cdist-config, import from cdist-cache + + Core: - support $__self = relative_type/object_id From 2a0cba4e4b37ed115accd5ce24cefc9a24cc9f7d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 00:07:23 +0100 Subject: [PATCH 0353/5465] rephrase features Signed-off-by: Nico Schottelius --- README | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/README b/README index 48b934f1..c498e3b8 100644 --- a/README +++ b/README @@ -52,22 +52,28 @@ You can [browse the documentation for the latest version online](man) as well. ### Features -Stuff that should probably be included in every configuration management, -but is not. Or: Why I began to write cdist: - - * Speed - * Elegant code - * Clean design + * Elegant code and clean design + * Type and core cleanly seperated + * Small codebase in core * Good documentation (man pages) - * Meaningful error messages - * The no surprise factor * Consistency in behaviour, naming and documentation + * Meaningful error messages + * Either standard error messages from tools or added description for clearification + * The no surprise factor + * No magic guessing of what the user wants + * Simple and well-known DSL + * Posix shell * Easy integration into bare metal installations - * Simple and well-known DSL: posix shell - * It must be very easy to extend and debug cdist - * Focus on reuse of existing functionality (like sh, ssh, find, rm, ...) - * Easy upgrade: ***There is no need to update cdist on target hosts!*** - * cdist only needs to be update on the master server + * requires only ssh + sh + * Easy upgrade + * ***There is no need to update cdist on target hosts!*** + * cdist only needs to be updated on the master server(s) + * Very easy to extend + * Can be done via types, which can be stacked on top of others + * Reuse of existing functionality + * sh, ssh, find, rm, mv, ... + * Very easy to debug + * Just add set -x in the scripts ### OS support From 086e47a636c765835f132735d319da9141f34696 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 00:23:59 +0100 Subject: [PATCH 0354/5465] extract code to transfer type explorers into its own executable Signed-off-by: Steven Armstrong --- bin/cdist-type-explorer-push | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 bin/cdist-type-explorer-push diff --git a/bin/cdist-type-explorer-push b/bin/cdist-type-explorer-push new file mode 100755 index 00000000..7ba412ca --- /dev/null +++ b/bin/cdist-type-explorer-push @@ -0,0 +1,40 @@ +#!/bin/sh +# +# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Push the given types explorers to the target host +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " + +set -eu + +__cdist_target_host="$1"; shift +__cdist_type="$1"; shift + +src_dir="$(__cdist_type_explorer_dir "$__cdist_type")" +dst_dir="$(__cdist_remote_type_explorer_dir "$__cdist_type")" + +if [ -d "$src_dir" ]; then + echo "Transfering explorers for $__cdist_type ..." + cdist-dir push "$__cdist_target_host" "$src_dir" "$dst_dir" +fi + From 92005e25670206302ae87d1b3da561f0911aa176 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 00:24:35 +0100 Subject: [PATCH 0355/5465] extract code to run an objects explorers into its own executable Signed-off-by: Steven Armstrong --- bin/cdist-object-explorer-run | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 bin/cdist-object-explorer-run diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run new file mode 100755 index 00000000..e349a490 --- /dev/null +++ b/bin/cdist-object-explorer-run @@ -0,0 +1,61 @@ +#!/bin/sh +# +# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Run the explorers for the given object on the target host. +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " + +set -eu + +__cdist_target_host="$1"; shift +__object="$1"; shift + +__object_id="$(__cdist_object_id_from_object "$__object")" +__cdist_type="$(__cdist_type_from_object "$__object")" + +# Check if type of object has >= 1 explorer +has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" + +# If so, run explorers on remote side +if [ "$has_explorer" ]; then + echo "Running explorers for $__object ..." + # Copy object parameters + cdist-dir push "$__cdist_target_host" \ + "$(__cdist_object_parameter_dir "$__object")" \ + "$(__cdist_remote_object_parameter_dir "$__object")" + + # Execute explorers + cdist-run-remote "$__cdist_target_host" \ + "__object=\"$(__cdist_remote_object_dir "$__object")\"" \ + "__object_id=\"$__object_id\"" \ + cdist-remote-explorer-run \ + "$__cdist_name_var_type_explorer" \ + "$(__cdist_remote_type_explorer_dir "$__cdist_type")" \ + "$(__cdist_remote_object_type_explorer_dir "$__object")" + + # Copy back results + cdist-dir pull "$__cdist_target_host" \ + "$(__cdist_remote_object_type_explorer_dir "$__object")" \ + "$(__cdist_object_type_explorer_dir "$__object")" +fi + From f7d20c002cd8f2d34ebdf3296a6e70d473ca885e Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 00:25:46 +0100 Subject: [PATCH 0356/5465] introduce new executable to process objects Signed-off-by: Steven Armstrong --- bin/cdist-object-run-all | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 bin/cdist-object-run-all diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all new file mode 100755 index 00000000..1dfef04f --- /dev/null +++ b/bin/cdist-object-run-all @@ -0,0 +1,61 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# For each created object: +# - run type explorers +# - generate code +# - copy object to target +# - execute code on target +# + +. cdist-config +[ $# -eq 1 ] || __cdist_usage "" +set -eu + +__cdist_target_host="$1"; shift + +object_listing="$__cdist_tmp_dir/objects" +type_listing_all="$__cdist_tmp_dir/types_all" +type_listing="$__cdist_tmp_dir/types" +types_pushed="$__cdist_tmp_dir/types_pushed" +touch "$types_pushed" + + +# Get listing of objects +__cdist_object_list "$__cdist_out_object_dir" > "$object_listing" + + +while read object; do + __cdist_type="$(__cdist_type_from_object "$object")" + if __cdist_type_has_explorer "$__cdist_type"; then + # Transfer the type explorers + if ! grep -q "$__cdist_type" "$types_pushed"; then + cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" + echo "$__cdist_type" >> "$types_pushed" + fi + + # Run the type explorers for the current object + cdist-object-explorer-run "$__cdist_target_host" "$object" + + fi + +done < "$object_listing" + From b740a4b934dc719f9a4f6a2cca4dd8c21d211c95 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 00:26:12 +0100 Subject: [PATCH 0357/5465] use new workflow Signed-off-by: Steven Armstrong --- bin/cdist-deploy-to | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 7a63f5ca..29c3a847 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -52,6 +52,9 @@ cdist-manifest-run-init "$__cdist_target_host" cdist-manifest-run-all "$__cdist_target_host" # Change workflow here: cdist-object-{apply, run, foo} +cdist-object-run-all "$__cdist_target_host" +exit + cdist-object-explorer-all "$__cdist_target_host" cdist-object-gencode-all "$__cdist_target_host" From 31a0b6c3d0b202f6624f236c122d27a93b9ce3e7 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:43:55 +0100 Subject: [PATCH 0358/5465] fixed inconsistencies between local and remote variable naming - /__cdist_remote_out_object_base_dir/__cdist_remote_out_object_dir/ - __cdist_remote_object_dir += __cdist_name_dot_cdist Signed-off-by: Steven Armstrong --- bin/cdist-code-run-all | 2 +- bin/cdist-config | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all index 1486cc46..6f5aeb92 100755 --- a/bin/cdist-code-run-all +++ b/bin/cdist-code-run-all @@ -44,7 +44,7 @@ while [ $# -ge 1 ]; do # Code remote cdist-run-remote "$__cdist_target_host" \ - "export __cdist_out_object_dir=\"$__cdist_remote_out_object_base_dir\";" \ + "export __cdist_out_object_dir=\"$__cdist_remote_out_object_dir\";" \ "cdist-code-run" "$object" "${__cdist_name_gencode_remote}" \ || __cdist_exit_err "Remote code failed for $object" done < "$__cdist_tmp_file" diff --git a/bin/cdist-config b/bin/cdist-config index 86039f00..26139819 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -131,7 +131,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") # : ${__cdist_remote_out_dir:=$__cdist_remote_base_dir/$__cdist_name_out_dir} : ${__cdist_remote_out_explorer_dir:=$__cdist_remote_out_dir/$__cdist_name_explorer} -: ${__cdist_remote_out_object_base_dir:=$__cdist_remote_out_dir/$__cdist_name_object} +: ${__cdist_remote_out_object_dir:=$__cdist_remote_out_dir/$__cdist_name_object} ################################################################################ # Internal functions @@ -254,9 +254,14 @@ __cdist_object_type_explorer_dir() # Remote # +__cdist_remote_object_base_dir() +{ + echo "${__cdist_remote_out_object_dir}/$1" +} + __cdist_remote_object_dir() { - echo "${__cdist_remote_out_object_base_dir}/$1" + echo "$(__cdist_remote_object_base_dir "$1")/${__cdist_name_dot_cdist}" } __cdist_remote_object_parameter_dir() From 14ece853df0a5daf6ee1dd7ec5da06b8596988ac Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:46:02 +0100 Subject: [PATCH 0359/5465] trust nico when he says: SSH DESTROYS WHILE READ LOOP Signed-off-by: Steven Armstrong --- bin/cdist-object-run-all | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 1dfef04f..a6e5790d 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -43,9 +43,21 @@ touch "$types_pushed" __cdist_object_list "$__cdist_out_object_dir" > "$object_listing" +# NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP while read object; do + set -- "$@" "$object" +done < "$object_listing" + +while [ $# -gt 0 ]; do + object="$1"; shift + __cdist_type="$(__cdist_type_from_object "$object")" - if __cdist_type_has_explorer "$__cdist_type"; then + + # Check if type of object has >= 1 explorer + has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" + + # If so, run explorers on remote side + if [ "$has_explorer" ]; then # Transfer the type explorers if ! grep -q "$__cdist_type" "$types_pushed"; then cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" @@ -57,5 +69,14 @@ while read object; do fi -done < "$object_listing" + # Run the gencode scripts for the current object + cdist-object-gencode-run "$__cdist_target_host" "$object" + + # Transfer the current object to the target + cdist-object-push "$__cdist_target_host" "$object" + + # Run the code for the current object + cdist-object-code-run "$__cdist_target_host" "$object" + +done From e8d656556cb15f7f8f975415ae3b75e5f1494968 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:46:53 +0100 Subject: [PATCH 0360/5465] /__cdist_remote_out_object_base_dir/__cdist_remote_out_object_dir/ Signed-off-by: Steven Armstrong --- bin/cdist-deploy-to | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 29c3a847..db26a988 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -51,6 +51,7 @@ cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" cdist-manifest-run-all "$__cdist_target_host" + # Change workflow here: cdist-object-{apply, run, foo} cdist-object-run-all "$__cdist_target_host" exit @@ -60,7 +61,7 @@ cdist-object-gencode-all "$__cdist_target_host" echo "Transferring objects to $__cdist_target_host ..." cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ - "${__cdist_remote_out_object_base_dir}" + "${__cdist_remote_out_object_dir}" cdist-code-run-all "$__cdist_target_host" From 31842564d37374e844a56d2bc3f5629dfc8d2a18 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:47:51 +0100 Subject: [PATCH 0361/5465] extract code to run gencode scripts into its own executable Signed-off-by: Steven Armstrong --- bin/cdist-object-gencode-run | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 bin/cdist-object-gencode-run diff --git a/bin/cdist-object-gencode-run b/bin/cdist-object-gencode-run new file mode 100755 index 00000000..76ce6953 --- /dev/null +++ b/bin/cdist-object-gencode-run @@ -0,0 +1,44 @@ +#!/bin/sh +# +# 2010 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# For the given object create the code to be executed on the target. +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -eu + +__cdist_target_host="$1"; shift +__cdist_object="$1"; shift + +code_local="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_local}" +code_remote="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_remote}" + +echo "Generating local code for $__cdist_object ..." +cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ + "${__cdist_name_gencode_local}" > "${code_local}" + +echo "Generating remote code for $__cdist_object ..." +cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ + "${__cdist_name_gencode_remote}" > "${code_remote}" + +chmod u+x "${code_local}" "${code_remote}" + From 4c6f115a434eaf9e33ec1b305179b306f53d0edd Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:48:19 +0100 Subject: [PATCH 0362/5465] extract code to execute gencode-generated scripts into its own executable Signed-off-by: Steven Armstrong --- bin/cdist-object-code-run | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 bin/cdist-object-code-run diff --git a/bin/cdist-object-code-run b/bin/cdist-object-code-run new file mode 100755 index 00000000..b75f6f46 --- /dev/null +++ b/bin/cdist-object-code-run @@ -0,0 +1,42 @@ +#!/bin/sh +# +# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Exec the code for the given object locally and remote +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -e + +__cdist_target_host="$1"; shift +__cdist_object="$1"; shift + +# Code local +export __cdist_out_object_dir="$__cdist_out_object_dir" +cdist-code-run "$__cdist_object" "${__cdist_name_gencode_local}" \ + || __cdist_exit_err "Local code failed for $__cdist_object" + +# Code remote +cdist-run-remote "$__cdist_target_host" \ + "export __cdist_out_object_dir=\"$__cdist_remote_out_object_dir\";" \ + "cdist-code-run" "$__cdist_object" "${__cdist_name_gencode_remote}" \ + || __cdist_exit_err "Remote code failed for $__cdist_object" + From 0dab5b5f7e80a69c4a39e708e22c6920d4095713 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:48:44 +0100 Subject: [PATCH 0363/5465] extract code to transfer objects into its own executable Signed-off-by: Steven Armstrong --- bin/cdist-object-push | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 bin/cdist-object-push diff --git a/bin/cdist-object-push b/bin/cdist-object-push new file mode 100755 index 00000000..9c44d14e --- /dev/null +++ b/bin/cdist-object-push @@ -0,0 +1,37 @@ +#!/bin/sh +# +# 2010 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Transfer the given object to the target host. +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -eu + +__cdist_target_host="$1"; shift +__cdist_object="$1"; shift + + +echo "Transferring object $__cdist_object to target host ..." +cdist-dir push "$__cdist_target_host" \ + "$(__cdist_object_dir "$__cdist_object")" \ + "$(__cdist_remote_object_dir "$__cdist_object")" + From 2c710186996f40b2e7ef1182ddd176897d3abdb2 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:52:15 +0100 Subject: [PATCH 0364/5465] migrate to new workflow Signed-off-by: Steven Armstrong --- bin/cdist-code-run-all | 50 ----------------- bin/cdist-deploy-to | 15 ----- bin/cdist-object-explorer-all | 102 ---------------------------------- bin/cdist-object-gencode-all | 45 --------------- 4 files changed, 212 deletions(-) delete mode 100755 bin/cdist-code-run-all delete mode 100755 bin/cdist-object-explorer-all delete mode 100755 bin/cdist-object-gencode-all diff --git a/bin/cdist-code-run-all b/bin/cdist-code-run-all deleted file mode 100755 index 6f5aeb92..00000000 --- a/bin/cdist-code-run-all +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Exec code locally and remote -# - -. cdist-config -[ $# -eq 1 ] || __cdist_usage "" -set -e - -__cdist_target_host="$1"; shift - -__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" - -# NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP -while read object; do - set -- "$@" "$object" -done < "$__cdist_tmp_file" - -while [ $# -ge 1 ]; do - object="$1"; shift - - # Code local - export __cdist_out_object_dir="$__cdist_out_object_dir" - cdist-code-run "$object" "${__cdist_name_gencode_local}" \ - || __cdist_exit_err "Local code failed for $object" - - # Code remote - cdist-run-remote "$__cdist_target_host" \ - "export __cdist_out_object_dir=\"$__cdist_remote_out_object_dir\";" \ - "cdist-code-run" "$object" "${__cdist_name_gencode_remote}" \ - || __cdist_exit_err "Remote code failed for $object" -done < "$__cdist_tmp_file" diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index db26a988..96b65e8b 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -50,21 +50,6 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" cdist-manifest-run-all "$__cdist_target_host" - - -# Change workflow here: cdist-object-{apply, run, foo} cdist-object-run-all "$__cdist_target_host" -exit - -cdist-object-explorer-all "$__cdist_target_host" -cdist-object-gencode-all "$__cdist_target_host" - -echo "Transferring objects to $__cdist_target_host ..." -cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \ - "${__cdist_remote_out_object_dir}" - -cdist-code-run-all "$__cdist_target_host" - -# Stop change here echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" diff --git a/bin/cdist-object-explorer-all b/bin/cdist-object-explorer-all deleted file mode 100755 index 692a79bb..00000000 --- a/bin/cdist-object-explorer-all +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# For each created object check the explorers and run them if needed. -# - -. cdist-config -[ $# -eq 1 ] || __cdist_usage "" -set -eu - -__cdist_target_host="$1"; shift - -object_listing="$__cdist_tmp_dir/objects" -type_listing_all="$__cdist_tmp_dir/types_all" -type_listing="$__cdist_tmp_dir/types" - -# Get listing of objects -__cdist_object_list "$__cdist_out_object_dir" > "$object_listing" - -# Get listing of types used -while read object; do - echo "$(__cdist_type_from_object "$object")" >> "$type_listing_all" -done < "$object_listing" -sort "$type_listing_all" | uniq > "$type_listing" - -# Create pseudo array to avoid issues with ssh -tc=0 -while read type; do - eval type_$tc=\"\$type\" - tc=$((tc+1)) -done < "$type_listing" - -# For every type that has explorers, Transfer the explorers -i=0 -while [ "$i" -lt "$tc" ]; do - eval cur_type=\"\$type_$i\" - - src_dir="$(__cdist_type_explorer_dir "$cur_type")" - dst_dir="$(__cdist_remote_type_explorer_dir "$cur_type")" - - if [ -d "$src_dir" ]; then - cdist-dir push "$__cdist_target_host" "$src_dir" "$dst_dir" - fi - i=$((i+1)) -done - -################################################################################ -# Explorer execution per object -# -# need to create pseudo array, as ssh in cdist-explorer-run will destroy while-read loops -while read object; do - set -- "$@" "$object" -done < "$object_listing" - -while [ $# -gt 0 ]; do - __object="$1"; shift - __object_id="$(__cdist_object_id_from_object "$__object")" - __cdist_type="$(__cdist_type_from_object "$__object")" - - # Check if type of object has >= 1 explorer - has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" - - # If so, run explorers on remote side - if [ "$has_explorer" ]; then - echo "Running explorers for $__object ..." - # Copy object parameters - cdist-dir push "$__cdist_target_host" \ - "$(__cdist_object_parameter_dir "$__object")" \ - "$(__cdist_remote_object_parameter_dir "$__object")" - - # Execute explorers - cdist-run-remote "$__cdist_target_host" \ - "__object=\"$(__cdist_remote_object_dir "$__object")\"" \ - "__object_id=\"$__object_id\"" \ - cdist-remote-explorer-run \ - "$__cdist_name_var_type_explorer" \ - "$(__cdist_remote_type_explorer_dir "$__cdist_type")" \ - "$(__cdist_remote_object_type_explorer_dir "$__object")" - - # Copy back results - cdist-dir pull "$__cdist_target_host" \ - "$(__cdist_remote_object_type_explorer_dir "$__object")" \ - "$(__cdist_object_type_explorer_dir "$__object")" - fi -done diff --git a/bin/cdist-object-gencode-all b/bin/cdist-object-gencode-all deleted file mode 100755 index 00ac1664..00000000 --- a/bin/cdist-object-gencode-all +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# 2010 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# For each created object create the code to be executed on the target. -# - -. cdist-config -[ $# -eq 1 ] || __cdist_usage "" -set -eu - -__cdist_target_host="$1"; shift - -__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_tmp_file" - -while read object; do - code_local="$(__cdist_object_code "$object")-${__cdist_name_gencode_local}" - code_remote="$(__cdist_object_code "$object")-${__cdist_name_gencode_remote}" - - echo "Generating local code for $object ..." - cdist-object-gencode "$__cdist_target_host" "$object" \ - "${__cdist_name_gencode_local}" > "${code_local}" - - echo "Generating remote code for $object ..." - cdist-object-gencode "$__cdist_target_host" "$object" \ - "${__cdist_name_gencode_remote}" > "${code_remote}" - - chmod u+x "${code_local}" "${code_remote}" -done < "$__cdist_tmp_file" From 4e2d063911587fda08d703c6fc74b28b112c42b3 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 01:53:03 +0100 Subject: [PATCH 0365/5465] cleanup: remove unused variables Signed-off-by: Steven Armstrong --- bin/cdist-object-run-all | 2 -- 1 file changed, 2 deletions(-) diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index a6e5790d..67c69154 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -33,8 +33,6 @@ set -eu __cdist_target_host="$1"; shift object_listing="$__cdist_tmp_dir/objects" -type_listing_all="$__cdist_tmp_dir/types_all" -type_listing="$__cdist_tmp_dir/types" types_pushed="$__cdist_tmp_dir/types_pushed" touch "$types_pushed" From 216ea21933903be61e1fa0f4e19fb1848aca1f4f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 18:44:31 +0100 Subject: [PATCH 0366/5465] a lot of more stuff in 1.5.0 :-) Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 93d0f7e4..a99a0c3d 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.5.0: * Add cache functionality + * Restructured execution: Run whole object at once (REPHRASE) 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) From 74266df8aa3e9fa1fe16c8b18bd21124c88ff889 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 18:46:58 +0100 Subject: [PATCH 0367/5465] rereformulate Signed-off-by: Nico Schottelius --- doc/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index a99a0c3d..b5908a36 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,6 @@ 1.5.0: * Add cache functionality - * Restructured execution: Run whole object at once (REPHRASE) + * Restructured execution: Run whole object at once (REPHRASE) (Steven Armstrong) 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) From bdf3e4b86e752909575744b28b1e15a83b0f5479 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Sat, 26 Mar 2011 22:09:19 +0100 Subject: [PATCH 0368/5465] prefix all variables with __cdist_ Signed-off-by: Steven Armstrong --- bin/cdist-object-run-all | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 67c69154..14a6d9b3 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -32,49 +32,49 @@ set -eu __cdist_target_host="$1"; shift -object_listing="$__cdist_tmp_dir/objects" -types_pushed="$__cdist_tmp_dir/types_pushed" -touch "$types_pushed" +__cdist_objects="$__cdist_tmp_dir/objects" +__cdist_types_pushed="$__cdist_tmp_dir/types_pushed" +touch "$__cdist_types_pushed" # Get listing of objects -__cdist_object_list "$__cdist_out_object_dir" > "$object_listing" +__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects" # NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP -while read object; do - set -- "$@" "$object" -done < "$object_listing" +while read __cdist_object; do + set -- "$@" "$__cdist_object" +done < "$__cdist_objects" while [ $# -gt 0 ]; do - object="$1"; shift + __cdist_object="$1"; shift - __cdist_type="$(__cdist_type_from_object "$object")" + __cdist_type="$(__cdist_type_from_object "$__cdist_object")" # Check if type of object has >= 1 explorer - has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" + __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" # If so, run explorers on remote side - if [ "$has_explorer" ]; then + if [ "$__cdist_has_explorer" ]; then # Transfer the type explorers - if ! grep -q "$__cdist_type" "$types_pushed"; then + if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" - echo "$__cdist_type" >> "$types_pushed" + echo "$__cdist_type" >> "$__cdist_types_pushed" fi # Run the type explorers for the current object - cdist-object-explorer-run "$__cdist_target_host" "$object" + cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" fi # Run the gencode scripts for the current object - cdist-object-gencode-run "$__cdist_target_host" "$object" + cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" # Transfer the current object to the target - cdist-object-push "$__cdist_target_host" "$object" + cdist-object-push "$__cdist_target_host" "$__cdist_object" # Run the code for the current object - cdist-object-code-run "$__cdist_target_host" "$object" + cdist-object-code-run "$__cdist_target_host" "$__cdist_object" done From 0a14aa080ce9d88366f691d8b521772b9e81f0c2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:04:06 +0100 Subject: [PATCH 0369/5465] prepare version change Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index ccab81cc..991d23bb 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.4.1" +__cdist_version="1.5.0pre" # Fail if something bogus is going on set -u From 4ba452874a666b6b2d774eee1eeb3b39d22df723 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:45:41 +0100 Subject: [PATCH 0370/5465] add template for fancy idea __process Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/cksum | 34 ++++++++++++++ conf/type/__process/explorer/exists | 30 +++++++++++++ conf/type/__process/gencode-local | 44 +++++++++++++++++++ conf/type/__process/gencode-remote | 46 +++++++++++++++++++ conf/type/__process/man.text | 61 ++++++++++++++++++++++++++ conf/type/__process/parameter/optional | 4 ++ 6 files changed, 219 insertions(+) create mode 100755 conf/type/__process/explorer/cksum create mode 100755 conf/type/__process/explorer/exists create mode 100755 conf/type/__process/gencode-local create mode 100755 conf/type/__process/gencode-remote create mode 100644 conf/type/__process/man.text create mode 100644 conf/type/__process/parameter/optional diff --git a/conf/type/__process/explorer/cksum b/conf/type/__process/explorer/cksum new file mode 100755 index 00000000..dcad99ba --- /dev/null +++ b/conf/type/__process/explorer/cksum @@ -0,0 +1,34 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Retrieve the md5sum of a file to be created, if it is already existing. +# + +destination="/$__object_id" + +if [ -e "$destination" ]; then + if [ -f "$destination" ]; then + cksum < "$destination" + else + echo "NO REGULAR FILE" + fi +else + echo "NO FILE FOUND, NO CHECKSUM CALCULATED." +fi diff --git a/conf/type/__process/explorer/exists b/conf/type/__process/explorer/exists new file mode 100755 index 00000000..f8b85671 --- /dev/null +++ b/conf/type/__process/explorer/exists @@ -0,0 +1,30 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Check whether file exists or not +# + +destination="/$__object_id" + +if [ -e "$destination" ]; then + echo yes +else + echo no +fi diff --git a/conf/type/__process/gencode-local b/conf/type/__process/gencode-local new file mode 100755 index 00000000..1168919e --- /dev/null +++ b/conf/type/__process/gencode-local @@ -0,0 +1,44 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# __file is a very basic type, which will probably be reused quite often +# + +destination="/$__object_id" + +if [ -f "$__object/parameter/source" ]; then + source="$(cat "$__object/parameter/source")" + + if [ -f "$source" ]; then + local_cksum="$(cksum < "$source")" + remote_cksum="$(cat "$__object/explorer/cksum")" + + if [ "$local_cksum" != "$remote_cksum" ]; then + # FIXME: The username is ugly and hardcoded, replace after 1.0! + # Probably a better aproach is to have the user configured + # ~/.ssh/config to contain the right username + # Probably describe it in cdist-quickstart... + echo scp "$source" "root@${__target_host}:${destination}" + fi + else + echo "Source \"$source\" does not exist." >&2 + exit 1 + fi +fi diff --git a/conf/type/__process/gencode-remote b/conf/type/__process/gencode-remote new file mode 100755 index 00000000..7c5cf7ce --- /dev/null +++ b/conf/type/__process/gencode-remote @@ -0,0 +1,46 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# __file is a very basic type, which will probably be reused quite often +# + +destination="/$__object_id" + +# No source? Create empty file +if [ ! -f "$__object/parameter/source" ]; then + if [ no = "$(cat "$__object/explorer/exists")" ]; then + echo touch \"$destination\" + fi +fi + +# Mode settings +if [ -f "$__object/parameter/mode" ]; then + echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" +fi + +# Group +if [ -f "$__object/parameter/group" ]; then + echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" +fi + +# Owner +if [ -f "$__object/parameter/owner" ]; then + echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" +fi diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text new file mode 100644 index 00000000..67ab53d1 --- /dev/null +++ b/conf/type/__process/man.text @@ -0,0 +1,61 @@ +cdist-type__file(7) +=================== +Nico Schottelius + + +NAME +---- +cdist-type__file - Create files + + +DESCRIPTION +----------- +This cdist type allows you to create files on the target. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +group:: + Group to chgrp to. + +mode:: + Unix permissions, suitable for chmod. + +owner:: + User to chown to. + +source:: + If supplied, copy this file from the host running cdist to the target. + If not supplied, an empty file or directory will be created. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Create /etc/cdist-configured as an empty file +__file /etc/cdist-configured + +# Use __file from another type +__file /etc/issue --source "$__type/files/archlinux" + +# Supply some more settings +__file /etc/shadow --source "$__type/files/shadow" \ + --owner root --group shadow --mode 0640 +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__process/parameter/optional b/conf/type/__process/parameter/optional new file mode 100644 index 00000000..06120518 --- /dev/null +++ b/conf/type/__process/parameter/optional @@ -0,0 +1,4 @@ +group +mode +owner +source From 6c6ece859bb035429a67446dd41bf183d0a93370 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:51:45 +0100 Subject: [PATCH 0371/5465] update documentation for __process Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 67ab53d1..2273f6f9 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -1,52 +1,33 @@ -cdist-type__file(7) -=================== +cdist-type__process(7) +====================== Nico Schottelius NAME ---- -cdist-type__file - Create files +cdist-type__process - Start or stop process DESCRIPTION ----------- -This cdist type allows you to create files on the target. +This cdist type allows you to define the state of a process. REQUIRED PARAMETERS ------------------- -None. +state:: + State of the process: Either stopped or running. OPTIONAL PARAMETERS ------------------- -group:: - Group to chgrp to. - -mode:: - Unix permissions, suitable for chmod. - -owner:: - User to chown to. - -source:: - If supplied, copy this file from the host running cdist to the target. - If not supplied, an empty file or directory will be created. - +None EXAMPLES -------- -------------------------------------------------------------------------------- -# Create /etc/cdist-configured as an empty file -__file /etc/cdist-configured - -# Use __file from another type -__file /etc/issue --source "$__type/files/archlinux" - -# Supply some more settings -__file /etc/shadow --source "$__type/files/shadow" \ - --owner root --group shadow --mode 0640 +__process /usr/sbin/sshd --state running --start "/etc/rc.d/sshd start" -------------------------------------------------------------------------------- From 06fe371b1df80492b300093b7db77ee47ad7dc39 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 26 Mar 2011 23:56:17 +0100 Subject: [PATCH 0372/5465] create type explorer "runs" Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/cksum | 34 ------------------- conf/type/__process/explorer/{exists => runs} | 10 ++---- 2 files changed, 3 insertions(+), 41 deletions(-) delete mode 100755 conf/type/__process/explorer/cksum rename conf/type/__process/explorer/{exists => runs} (85%) diff --git a/conf/type/__process/explorer/cksum b/conf/type/__process/explorer/cksum deleted file mode 100755 index dcad99ba..00000000 --- a/conf/type/__process/explorer/cksum +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Retrieve the md5sum of a file to be created, if it is already existing. -# - -destination="/$__object_id" - -if [ -e "$destination" ]; then - if [ -f "$destination" ]; then - cksum < "$destination" - else - echo "NO REGULAR FILE" - fi -else - echo "NO FILE FOUND, NO CHECKSUM CALCULATED." -fi diff --git a/conf/type/__process/explorer/exists b/conf/type/__process/explorer/runs similarity index 85% rename from conf/type/__process/explorer/exists rename to conf/type/__process/explorer/runs index f8b85671..685dd19e 100755 --- a/conf/type/__process/explorer/exists +++ b/conf/type/__process/explorer/runs @@ -18,13 +18,9 @@ # along with cdist. If not, see . # # -# Check whether file exists or not +# Check whether a process runs # -destination="/$__object_id" +process="$__object_id" -if [ -e "$destination" ]; then - echo yes -else - echo no -fi +pgrep -f "$process" || true From e4467de8fd9dfe044e65d2cce1972c102513441e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 00:05:30 +0100 Subject: [PATCH 0373/5465] describe how __process should work Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 2273f6f9..623ec4b2 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -21,13 +21,28 @@ state:: OPTIONAL PARAMETERS ------------------- -None +stop:: + Executable to use for stopping the process. + +start:: + Executable to use for starting the process. + EXAMPLES -------- -------------------------------------------------------------------------------- +# Start /usr/sbin/sshd if not running +__process /usr/sbin/sshd --state running + +# Start /usr/sbin/sshd if not running with a different binary __process /usr/sbin/sshd --state running --start "/etc/rc.d/sshd start" + +# Stop the process using kill (the type default) +__process /usr/sbin/sshd --state stopped + +# Stop the process using /etc/rc.d/sshd stop +__process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop" -------------------------------------------------------------------------------- From e7c1d3f16b774c3b33f7b41aa7dbec4041dd6d5c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 00:07:39 +0100 Subject: [PATCH 0374/5465] add parameter Signed-off-by: Nico Schottelius --- conf/type/__process/gencode-local | 44 -------------------------- conf/type/__process/parameter/optional | 6 ++-- conf/type/__process/parameter/required | 1 + 3 files changed, 3 insertions(+), 48 deletions(-) delete mode 100755 conf/type/__process/gencode-local create mode 100644 conf/type/__process/parameter/required diff --git a/conf/type/__process/gencode-local b/conf/type/__process/gencode-local deleted file mode 100755 index 1168919e..00000000 --- a/conf/type/__process/gencode-local +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# __file is a very basic type, which will probably be reused quite often -# - -destination="/$__object_id" - -if [ -f "$__object/parameter/source" ]; then - source="$(cat "$__object/parameter/source")" - - if [ -f "$source" ]; then - local_cksum="$(cksum < "$source")" - remote_cksum="$(cat "$__object/explorer/cksum")" - - if [ "$local_cksum" != "$remote_cksum" ]; then - # FIXME: The username is ugly and hardcoded, replace after 1.0! - # Probably a better aproach is to have the user configured - # ~/.ssh/config to contain the right username - # Probably describe it in cdist-quickstart... - echo scp "$source" "root@${__target_host}:${destination}" - fi - else - echo "Source \"$source\" does not exist." >&2 - exit 1 - fi -fi diff --git a/conf/type/__process/parameter/optional b/conf/type/__process/parameter/optional index 06120518..4189bb2c 100644 --- a/conf/type/__process/parameter/optional +++ b/conf/type/__process/parameter/optional @@ -1,4 +1,2 @@ -group -mode -owner -source +stop +start diff --git a/conf/type/__process/parameter/required b/conf/type/__process/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__process/parameter/required @@ -0,0 +1 @@ +state From 97dd649f447a917c63200cce74d35aadfdc2b63b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 22:55:58 +0200 Subject: [PATCH 0375/5465] update todos Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 4 +++- doc/dev/todo/niconext | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 2881c06c..138f7714 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -5,7 +5,8 @@ Feel free to pick one! CORE ---- -Only build manpages if necessary for types as well as for the core! +- Only build manpages if necessary for types as well as for the core! +- support $__self = relative_type/object_id TYPES ------ @@ -17,3 +18,4 @@ Types to be written/extended: -> aka sed. - __cron + diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 05a44503..e9a6ddfc 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -5,5 +5,5 @@ Cache: -> add function to cdist-config, import from cdist-cache -Core: - - support $__self = relative_type/object_id +remove --preseed from package_apt and add debconf_set_selection or similar + -> much cleaner! From d21cfa66a03e681bf3f24774eb1995c49c85a717 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 22:58:42 +0200 Subject: [PATCH 0376/5465] +indent Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 6294870a..b3ed1f3d 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -155,7 +155,7 @@ if [ -e "${__cdist_object_dir}" ]; then # Allow diff to fail set +e diff -ru "${__cdist_new_object_dir}/${__cdist_name_parameter}" \ - "${__cdist_object_dir}/${__cdist_name_parameter}" \ + "${__cdist_object_dir}/${__cdist_name_parameter}" \ > "$__cdist_tmp_file"; ret=$? set -e From ec2971787090c11c5eb029a0a225ed1b9b56cc09 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 22:59:00 +0200 Subject: [PATCH 0377/5465] in theory finish __process Signed-off-by: Nico Schottelius --- conf/type/__process/gencode-remote | 46 ++++++++++++++++-------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/conf/type/__process/gencode-remote b/conf/type/__process/gencode-remote index 7c5cf7ce..219230db 100755 --- a/conf/type/__process/gencode-remote +++ b/conf/type/__process/gencode-remote @@ -21,26 +21,30 @@ # __file is a very basic type, which will probably be reused quite often # -destination="/$__object_id" +process="$__object_id" -# No source? Create empty file -if [ ! -f "$__object/parameter/source" ]; then - if [ no = "$(cat "$__object/explorer/exists")" ]; then - echo touch \"$destination\" - fi -fi +runs="$(cat "$__object/explorer/runs")" +state="$(cat "$__object/parameter/state")" -# Mode settings -if [ -f "$__object/parameter/mode" ]; then - echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" -fi - -# Group -if [ -f "$__object/parameter/group" ]; then - echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" -fi - -# Owner -if [ -f "$__object/parameter/owner" ]; then - echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" -fi +case "$state" in + running) + # Does not run, start it! + if [ -z "$runs" ]; then + if [ -f "$__object/parameter/start" ]; then + cat "$__object/parameter/start" + else + echo "$process" + fi + fi + ;; + stopped) + # Runs, kill it! + if [ "$runs" ]; then + if [ -f "$__object/parameter/stop" ]; then + cat "$__object/parameter/stop" + else + echo kill "${runs}" + fi + fi + ;; +esac From 4cd70b7abbf19a3a1b71d4e5176ec8b67f515576 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:10:29 +0200 Subject: [PATCH 0378/5465] document pgrep fun Signed-off-by: Nico Schottelius --- doc/dev/logs/2011-03-27.pgrep | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/dev/logs/2011-03-27.pgrep diff --git a/doc/dev/logs/2011-03-27.pgrep b/doc/dev/logs/2011-03-27.pgrep new file mode 100644 index 00000000..fedfa81e --- /dev/null +++ b/doc/dev/logs/2011-03-27.pgrep @@ -0,0 +1,12 @@ +Some pgrep fun when grepping for -f /usr/lib/postfix/master: + +[23:08] kr:cdist% cat cache/localhost/out/object/__process/usr/lib/postfix/master/.cdist/explorer/runs | grep -e 2529 -e 2537 -e 2538 -e 2539 +nico 2529 0.0 0.0 14848 1816 pts/45 S+ 23:08 0:00 /bin/sh /home/users/nico/oeffentlich/rechner/projekte/cdist/bin/cdist-run-remote localhost __object="/var/lib/cdist/out/object/__process/usr/lib/postfix/master" __object_id="usr/lib/postfix/master" cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +nico 2537 0.0 0.0 41976 2324 pts/45 S+ 23:08 0:00 ssh root@localhost export PATH="/var/lib/cdist/bin:$PATH"; __object="/var/lib/cdist/out/object/__process/usr/lib/postfix/master" __object_id="usr/lib/postfix/master" cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +root 2538 0.0 0.0 11440 1264 ? Ss 23:08 0:00 bash -c export PATH="/var/lib/cdist/bin:$PATH"; __object="/var/lib/cdist/out/object/__process/usr/lib/postfix/master" __object_id="usr/lib/postfix/master" cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +root 2539 0.0 0.0 11440 1524 ? S 23:08 0:00 /bin/sh /var/lib/cdist/bin/cdist-remote-explorer-run __type_explorer /var/lib/cdist/conf/type/__process/explorer /var/lib/cdist/out/object/__process/usr/lib/postfix/master/explorer +2529 +2537 +2538 +2539 + From 0e8d36f5928a5869f67eb79c55f3e1ff69973f08 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:12:25 +0200 Subject: [PATCH 0379/5465] add -x to pgrep Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/runs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 685dd19e..6d2bdf8c 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -23,4 +23,5 @@ process="$__object_id" -pgrep -f "$process" || true +ps aux +pgrep -x -f "$process" || true From 40b7b158c0c38708574a2d4354490de83df23c3c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:13:18 +0200 Subject: [PATCH 0380/5465] -debug Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/runs | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 6d2bdf8c..19d259a6 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -23,5 +23,4 @@ process="$__object_id" -ps aux pgrep -x -f "$process" || true From b8002efa6d630006b333bb7e650f7092fcd3659e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:29:10 +0200 Subject: [PATCH 0381/5465] add support for __process --name (in theory) Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/runs | 8 ++++++-- conf/type/__process/gencode-remote | 13 +++++++++++-- conf/type/__process/man.text | 3 +++ conf/type/__process/parameter/optional | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 19d259a6..240ebef9 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -21,6 +21,10 @@ # Check whether a process runs # -process="$__object_id" +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi -pgrep -x -f "$process" || true +pgrep -x -f "$name" || true diff --git a/conf/type/__process/gencode-remote b/conf/type/__process/gencode-remote index 219230db..f8da1795 100755 --- a/conf/type/__process/gencode-remote +++ b/conf/type/__process/gencode-remote @@ -21,7 +21,11 @@ # __file is a very basic type, which will probably be reused quite often # -process="$__object_id" +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi runs="$(cat "$__object/explorer/runs")" state="$(cat "$__object/parameter/state")" @@ -33,7 +37,7 @@ case "$state" in if [ -f "$__object/parameter/start" ]; then cat "$__object/parameter/start" else - echo "$process" + echo "$name" fi fi ;; @@ -47,4 +51,9 @@ case "$state" in fi fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; + esac diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 623ec4b2..5f49865b 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -21,6 +21,9 @@ state:: OPTIONAL PARAMETERS ------------------- +name:: + Process name to match on when using pgrep -f -x. + stop:: Executable to use for stopping the process. diff --git a/conf/type/__process/parameter/optional b/conf/type/__process/parameter/optional index 4189bb2c..3411afb4 100644 --- a/conf/type/__process/parameter/optional +++ b/conf/type/__process/parameter/optional @@ -1,2 +1,3 @@ +name stop start From 271aa95a4da8f20f258fdb428faa4660197fbefa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:32:28 +0200 Subject: [PATCH 0382/5465] add --name example to manpage Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index 5f49865b..d144498d 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -46,6 +46,11 @@ __process /usr/sbin/sshd --state stopped # Stop the process using /etc/rc.d/sshd stop __process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop" + +# Ensure cups is running, which runs with -C ...: +__process cups --start "/etc/rc.d/cups start" --state running \ + --name "/usr/sbin/cupsd -C /etc/cups/cupsd.conf" + -------------------------------------------------------------------------------- From 741e505b1e90acd584fbf232ff4945bdea40c98a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 27 Mar 2011 23:33:27 +0200 Subject: [PATCH 0383/5465] more interesting stuff for 1.5.0 Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index b5908a36..7faf789b 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.5.0: * Add cache functionality + * New type __process * Restructured execution: Run whole object at once (REPHRASE) (Steven Armstrong) 1.4.1: 2011-03-25 From 417ce618217a49a83d4d83cb5260bfba2a5a3abc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 08:54:41 +0200 Subject: [PATCH 0384/5465] -'' Signed-off-by: Nico Schottelius --- conf/type/__process/man.text | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/type/__process/man.text b/conf/type/__process/man.text index d144498d..3f7004c7 100644 --- a/conf/type/__process/man.text +++ b/conf/type/__process/man.text @@ -50,7 +50,6 @@ __process /usr/sbin/sshd --state stopped --stop "/etc/rc.d/sshd stop" # Ensure cups is running, which runs with -C ...: __process cups --start "/etc/rc.d/cups start" --state running \ --name "/usr/sbin/cupsd -C /etc/cups/cupsd.conf" - -------------------------------------------------------------------------------- From dbe74dcc3330117d01df306833c019361c448742 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 08:56:53 +0200 Subject: [PATCH 0385/5465] compile all manpages in parallel! Signed-off-by: Nico Schottelius --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index b91db496..4b0311c5 100755 --- a/build.sh +++ b/build.sh @@ -51,9 +51,10 @@ case "$1" in manbuild) for src in ${MAN1DSTDIR}/*.text ${MAN7DSTDIR}/*.text; do echo "Compiling manpage and html for $src" - $A2XM "$src" - $A2XH "$src" + $A2XM "$src" & + $A2XH "$src" & done + wait ;; mandirs) From 3d87f3f19a6de515923a74fcdd761bfcf3d76bf7 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 09:58:36 +0200 Subject: [PATCH 0386/5465] more ideas for future version Signed-off-by: Steven Armstrong --- doc/dev/logs/2011-03-28.execution-order | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/dev/logs/2011-03-28.execution-order diff --git a/doc/dev/logs/2011-03-28.execution-order b/doc/dev/logs/2011-03-28.execution-order new file mode 100644 index 00000000..940da522 --- /dev/null +++ b/doc/dev/logs/2011-03-28.execution-order @@ -0,0 +1,14 @@ +run global explorers +run init manitest + +run all objects + -> depencies aufloesen wie/was/wo ???????? + run object + run explorer + run manifest + -> object liste wird evt veraendert + run gencode + run push -> target + run exec code + + From 4687d32771316506396fb0214b6cdb073a4c1ad4 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 10:00:22 +0200 Subject: [PATCH 0387/5465] add half backed code for new object-run ideas Signed-off-by: Steven Armstrong --- bin/cdist-deploy-to | 2 +- bin/cdist-object-run-all | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 96b65e8b..c9aa1e2f 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -49,7 +49,7 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" -cdist-manifest-run-all "$__cdist_target_host" +#cdist-manifest-run-all "$__cdist_target_host" cdist-object-run-all "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 14a6d9b3..abf01b23 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -48,6 +48,8 @@ done < "$__cdist_objects" while [ $# -gt 0 ]; do __cdist_object="$1"; shift + echo + echo "Running object $__cdist_object" __cdist_type="$(__cdist_type_from_object "$__cdist_object")" @@ -67,6 +69,9 @@ while [ $# -gt 0 ]; do fi + # Run the manifest for the current object + cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" + # Run the gencode scripts for the current object cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" From b5ab490a23a1413eb949ba9b3512561455303e07 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 10:02:13 +0200 Subject: [PATCH 0388/5465] add more half backed code for new object-run ideas Signed-off-by: Steven Armstrong --- bin/cdist-object-manifest-run | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 bin/cdist-object-manifest-run diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run new file mode 100755 index 00000000..e20848cd --- /dev/null +++ b/bin/cdist-object-manifest-run @@ -0,0 +1,64 @@ +#!/bin/sh +# +# 2010 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Run the manifest for the given object. +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -eu + +__cdist_target_host="$1"; shift +__cdist_object="$1"; shift + +# Full path to current object +__cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object")" + +# Only the id +__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" + +if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then + echo "Checking manifest for $__cdist_object ..." + + __cdist_type="$(__cdist_type_from_object "$__cdist_object")" + __cdist_manifest="$(__cdist_type_manifest "$__cdist_type")" + + if [ -f "$__cdist_manifest" ]; then + if [ -x "$__cdist_manifest" ]; then + # Make __cdist_manifest available for cdist-type-emulator + export __cdist_manifest + + echo "Executing manifest ${__cdist_manifest} ..." + # Make variables available to non-core - FIXME: beatify + export $__cdist_name_var_object="$__cdist_cur_object_dir" + export $__cdist_name_var_object_id="$__cdist_object_id" + export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" + + cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" + else + __cdist_exit_err "${__cdist_manifest} needs to be executable." + fi + fi +fi + +# done with this object +touch "$__cdist_cur_object_dir/$__cdist_name_object_finished" + From c5d8eaa63dd7f44990a2e4bf4fe282198adf1131 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 10:54:22 +0200 Subject: [PATCH 0389/5465] add stevens todo list Signed-off-by: Steven Armstrong --- doc/dev/todo/steven | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/dev/todo/steven diff --git a/doc/dev/todo/steven b/doc/dev/todo/steven new file mode 100644 index 00000000..5f91a198 --- /dev/null +++ b/doc/dev/todo/steven @@ -0,0 +1,16 @@ +- document object_id=$1 for manifest + gencode :-) + +- update docs regarding flow in cdist-stages.text +- create man pages for new executables +- nuke legacy manpages + +- prettify output of cdist-deploy-to, e.g. + +Processing object __file/etc/cdist-configured + transfering type explorers ... + running type explorers ... + running manifest ... + running gencode ... + transfering object to target ... + running code ... + From d7a607d54a9b595259408e2f3a60e7e1cf368568 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 11:22:25 +0200 Subject: [PATCH 0390/5465] update man pages for type explorer transfer and execution Signed-off-by: Steven Armstrong --- doc/man/cdist-object-explorer-all.text | 33 -------------------------- doc/man/cdist-object-explorer-run.text | 32 +++++++++++++++++++++++++ doc/man/cdist-type-explorer-push.text | 32 +++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 33 deletions(-) delete mode 100644 doc/man/cdist-object-explorer-all.text create mode 100644 doc/man/cdist-object-explorer-run.text create mode 100644 doc/man/cdist-type-explorer-push.text diff --git a/doc/man/cdist-object-explorer-all.text b/doc/man/cdist-object-explorer-all.text deleted file mode 100644 index dda3d30d..00000000 --- a/doc/man/cdist-object-explorer-all.text +++ /dev/null @@ -1,33 +0,0 @@ -cdist-object-explorer-all(1) -============================ -Nico Schottelius - - -NAME ----- -cdist-object-explorer-all - Run type explorer for every object - - -SYNOPSIS --------- -cdist-object-explorer-all HOSTNAME - - -DESCRIPTION ------------ -For every object, it checks whether the type has one or more explorers. -If so, the explorers of the type are copied to the target and executed -once per object. - - -SEE ALSO --------- -- cdist(7) -- cdist-deploy-to(1) -- cdist-remote-explorer-run(1) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/doc/man/cdist-object-explorer-run.text b/doc/man/cdist-object-explorer-run.text new file mode 100644 index 00000000..a94047c3 --- /dev/null +++ b/doc/man/cdist-object-explorer-run.text @@ -0,0 +1,32 @@ +cdist-object-explorer-run(1) +============================ +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-object-explorer-run - Run type explorers for a object + + +SYNOPSIS +-------- +cdist-object-explorer-run HOSTNAME OBJECT + + +DESCRIPTION +----------- +Runs the explorers for the given object on the target host. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-remote-explorer-run(1) + + +COPYING +------- +Copyright \(C) 2011 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/doc/man/cdist-type-explorer-push.text b/doc/man/cdist-type-explorer-push.text new file mode 100644 index 00000000..31da880c --- /dev/null +++ b/doc/man/cdist-type-explorer-push.text @@ -0,0 +1,32 @@ +cdist-type-explorer-push(1) +============================ +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-type-explorer-push - Transfer type explorers to the target host + + +SYNOPSIS +-------- +cdist-type-explorer-push HOSTNAME TYPE + + +DESCRIPTION +----------- +Transfers the explorers of the given type to the target host. + + +SEE ALSO +-------- +- cdist(7) +- cdist-object-run(1) +- cdist-type(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 269ad8c4325c6435c288cc3071f0e8c3949d6cbd Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 11:27:05 +0200 Subject: [PATCH 0391/5465] update man pages for object gencode generation Signed-off-by: Steven Armstrong --- doc/man/cdist-object-gencode-all.text | 32 -------------------------- doc/man/cdist-object-gencode-run.text | 33 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 32 deletions(-) delete mode 100644 doc/man/cdist-object-gencode-all.text create mode 100644 doc/man/cdist-object-gencode-run.text diff --git a/doc/man/cdist-object-gencode-all.text b/doc/man/cdist-object-gencode-all.text deleted file mode 100644 index b1c96748..00000000 --- a/doc/man/cdist-object-gencode-all.text +++ /dev/null @@ -1,32 +0,0 @@ -cdist-object-gencode-all(1) -=========================== -Nico Schottelius - - -NAME ----- -cdist-object-gencode-all - Generate code for every existing object - - -SYNOPSIS --------- -cdist-object-gencode-all HOSTNAME - - -DESCRIPTION ------------ -For every object that exists, the cdist-object-gencode is executed. - - -SEE ALSO --------- -- cdist(7) -- cdist-code-run(1) -- cdist-deploy-to(1) -- cdist-object-gencode(1) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/doc/man/cdist-object-gencode-run.text b/doc/man/cdist-object-gencode-run.text new file mode 100644 index 00000000..d69d1787 --- /dev/null +++ b/doc/man/cdist-object-gencode-run.text @@ -0,0 +1,33 @@ +cdist-object-gencode-run(1) +=========================== +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-object-gencode-run - Generate code for a object + + +SYNOPSIS +-------- +cdist-object-gencode-run HOSTNAME OBJECT + + +DESCRIPTION +----------- +For the given object, generate the code for local and remote execution. + + +SEE ALSO +-------- +- cdist(7) +- cdist-code-run(1) +- cdist-object-run-all(1) +- cdist-object-gencode(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 70caac86e914eee4a0c969003a3be691d1bb5377 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:11:55 +0200 Subject: [PATCH 0392/5465] man page for cdist-object-push Signed-off-by: Steven Armstrong --- doc/man/cdist-object-push.txt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/man/cdist-object-push.txt diff --git a/doc/man/cdist-object-push.txt b/doc/man/cdist-object-push.txt new file mode 100644 index 00000000..c4190e00 --- /dev/null +++ b/doc/man/cdist-object-push.txt @@ -0,0 +1,32 @@ +cdist-object-push(1) +============================ +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-object-push - Transfer a object to the target host + + +SYNOPSIS +-------- +cdist-object-push HOSTNAME OBJECT + + +DESCRIPTION +----------- +Transfers the given object to the target host. + + +SEE ALSO +-------- +- cdist(7) +- cdist-object-run-all(1) +- cdist-type(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 2ee4f7e95207dfcb2b6cac9c0dabe99ba106e224 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:12:57 +0200 Subject: [PATCH 0393/5465] cdist-object-push.txt -> cdist-object-push.text Signed-off-by: Steven Armstrong --- doc/man/{cdist-object-push.txt => cdist-object-push.text} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/man/{cdist-object-push.txt => cdist-object-push.text} (100%) diff --git a/doc/man/cdist-object-push.txt b/doc/man/cdist-object-push.text similarity index 100% rename from doc/man/cdist-object-push.txt rename to doc/man/cdist-object-push.text From c680f3e81d45c6afd4d74ef3bacb86fb88e54ef3 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:21:45 +0200 Subject: [PATCH 0394/5465] added man page for cdist-object-run-all Signed-off-by: Steven Armstrong --- doc/man/cdist-object-run-all.text | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 doc/man/cdist-object-run-all.text diff --git a/doc/man/cdist-object-run-all.text b/doc/man/cdist-object-run-all.text new file mode 100644 index 00000000..c5163208 --- /dev/null +++ b/doc/man/cdist-object-run-all.text @@ -0,0 +1,38 @@ +cdist-object-run-all(1) +======================= +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-object-run-all - Run all created objects on the target host + + +SYNOPSIS +-------- +cdist-object-run-all HOSTNAME + + +DESCRIPTION +----------- +Iterates over all objects and runs them on the given target host. +The different subtasks are dispatched to specialized exectuables. +See related man pages for details. + + +SEE ALSO +-------- +- cdist(7) +- cdist-type-explorer-push(1) +- cdist-object-explorer-run(1) +- cdist-object-gencode-run(1) +- cdist-object-push(1) +- cdist-object-code-run(1) +- cdist-type(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From a5633df809cc05c5a242e086f1e82ee9262fbf8b Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:23:52 +0200 Subject: [PATCH 0395/5465] fix asciidoc headers Signed-off-by: Steven Armstrong --- doc/man/cdist-object-push.text | 2 +- doc/man/cdist-type-explorer-push.text | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/man/cdist-object-push.text b/doc/man/cdist-object-push.text index c4190e00..69648a4d 100644 --- a/doc/man/cdist-object-push.text +++ b/doc/man/cdist-object-push.text @@ -1,5 +1,5 @@ cdist-object-push(1) -============================ +==================== Nico Schottelius Steven Armstrong diff --git a/doc/man/cdist-type-explorer-push.text b/doc/man/cdist-type-explorer-push.text index 31da880c..e32f10a4 100644 --- a/doc/man/cdist-type-explorer-push.text +++ b/doc/man/cdist-type-explorer-push.text @@ -1,5 +1,5 @@ cdist-type-explorer-push(1) -============================ +=========================== Nico Schottelius Steven Armstrong From 23e2fb82c7c725b097e34c4e36c197d1ef822a22 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:27:43 +0200 Subject: [PATCH 0396/5465] add man page for cdist-object-code-run Signed-off-by: Steven Armstrong --- doc/man/cdist-object-code-run.text | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 doc/man/cdist-object-code-run.text diff --git a/doc/man/cdist-object-code-run.text b/doc/man/cdist-object-code-run.text new file mode 100644 index 00000000..4d19b5eb --- /dev/null +++ b/doc/man/cdist-object-code-run.text @@ -0,0 +1,33 @@ +cdist-object-code-run(1) +======================== +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-object-code-run - Execute the generated code for a object + + +SYNOPSIS +-------- +cdist-object-code-run HOSTNAME OBJECT + + +DESCRIPTION +----------- +Execute the local and remote code for the given object. + + +SEE ALSO +-------- +- cdist(7) +- cdist-object-run-all(1) +- cdist-code-run(1) +- cdist-run-remote(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From d56b7d19448282594047480936e7d976f4614eaa Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:29:46 +0200 Subject: [PATCH 0397/5465] remove legacy man pages Signed-off-by: Steven Armstrong --- doc/man/cdist-code-run-all.text | 32 -------------------------------- doc/man/cdist-run-remote.text | 2 +- 2 files changed, 1 insertion(+), 33 deletions(-) delete mode 100644 doc/man/cdist-code-run-all.text diff --git a/doc/man/cdist-code-run-all.text b/doc/man/cdist-code-run-all.text deleted file mode 100644 index fba2e7e3..00000000 --- a/doc/man/cdist-code-run-all.text +++ /dev/null @@ -1,32 +0,0 @@ -cdist-code-run-all(1) -===================== -Nico Schottelius - - -NAME ----- -cdist-code-run-all - Execute all generated code on the target - - -SYNOPSIS --------- -cdist-code-run-all HOSTNAME - - -DESCRIPTION ------------ -cdist-code-run-all is just a wrapper for cdist-remote-code-run-all. - - -SEE ALSO --------- -- cdist(7) -- cdist-deploy-to(1) -- cdist-remote-code-run-all(1) -- cdist-run-remote(1) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/doc/man/cdist-run-remote.text b/doc/man/cdist-run-remote.text index 6f06360f..ee7a6337 100644 --- a/doc/man/cdist-run-remote.text +++ b/doc/man/cdist-run-remote.text @@ -22,7 +22,7 @@ It ensures PATH is setup correctly on the target side. SEE ALSO -------- - cdist(7) -- cdist-code-run-all(1) +- cdist-object-code-run(1) - cdist-deploy-to(1) - cdist-remote-code-run-all(1) From 0f2193c5e3b731e4f92be2631e63c471d3f6a838 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:44:03 +0200 Subject: [PATCH 0398/5465] concentrate on iteration in cdist-object-run-all; move all execution code into new executable bin/cdist-object-run Signed-off-by: Steven Armstrong --- bin/cdist-object-run | 55 ++++++++++++++++++++++++++++++++++++++++ bin/cdist-object-run-all | 29 +++++---------------- 2 files changed, 61 insertions(+), 23 deletions(-) create mode 100755 bin/cdist-object-run diff --git a/bin/cdist-object-run b/bin/cdist-object-run new file mode 100755 index 00000000..44be01be --- /dev/null +++ b/bin/cdist-object-run @@ -0,0 +1,55 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# For the given object: +# - run type explorers +# - generate code +# - copy object to target +# - execute code on target +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -eu + +__cdist_target_host="$1"; shift +__cdist_object="$1"; shift + + +__cdist_type="$(__cdist_type_from_object "$__cdist_object")" + +# Check if type of object has >= 1 explorer +__cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" + +# Run the type explorers for the current object if any +if [ "$__cdist_has_explorer" ]; then + cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" +fi + +# Run the gencode scripts for the current object +cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" + +# Transfer the current object to the target +cdist-object-push "$__cdist_target_host" "$__cdist_object" + +# Run the code for the current object +cdist-object-code-run "$__cdist_target_host" "$__cdist_object" + diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 14a6d9b3..3d2cb21c 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -19,11 +19,7 @@ # along with cdist. If not, see . # # -# For each created object: -# - run type explorers -# - generate code -# - copy object to target -# - execute code on target +# Run cdist-object-run for each created object. # . cdist-config @@ -49,32 +45,19 @@ done < "$__cdist_objects" while [ $# -gt 0 ]; do __cdist_object="$1"; shift - __cdist_type="$(__cdist_type_from_object "$__cdist_object")" - # Check if type of object has >= 1 explorer __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" - # If so, run explorers on remote side + # Transfer the type explorers if any if [ "$__cdist_has_explorer" ]; then - # Transfer the type explorers if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" - echo "$__cdist_type" >> "$__cdist_types_pushed" - fi - - # Run the type explorers for the current object - cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" - + echo "$__cdist_type" >> "$__cdist_types_pushed" + fi fi - # Run the gencode scripts for the current object - cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" - - # Transfer the current object to the target - cdist-object-push "$__cdist_target_host" "$__cdist_object" - - # Run the code for the current object - cdist-object-code-run "$__cdist_target_host" "$__cdist_object" + # Process the given object + cdist-object-run "$__cdist_target_host" "$__cdist_object" done From 1c51d32cdca9a6372274ff8dedaf845222973712 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:45:16 +0200 Subject: [PATCH 0399/5465] add missing variable __cdist_type Signed-off-by: Steven Armstrong --- bin/cdist-object-run-all | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 3d2cb21c..e95c7841 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -45,6 +45,8 @@ done < "$__cdist_objects" while [ $# -gt 0 ]; do __cdist_object="$1"; shift + __cdist_type="$(__cdist_type_from_object "$__cdist_object")" + # Check if type of object has >= 1 explorer __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" From 0726735f38623efe0b825644a45a8ce63ed889b8 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 12:49:46 +0200 Subject: [PATCH 0400/5465] update man pages for cdist-object-run-all and cdist-object-run Signed-off-by: Steven Armstrong --- doc/man/cdist-object-run-all.text | 10 +++------ doc/man/cdist-object-run.text | 37 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 doc/man/cdist-object-run.text diff --git a/doc/man/cdist-object-run-all.text b/doc/man/cdist-object-run-all.text index c5163208..a3a8d56b 100644 --- a/doc/man/cdist-object-run-all.text +++ b/doc/man/cdist-object-run-all.text @@ -16,19 +16,15 @@ cdist-object-run-all HOSTNAME DESCRIPTION ----------- -Iterates over all objects and runs them on the given target host. -The different subtasks are dispatched to specialized exectuables. -See related man pages for details. +Transfers type explorers to the target then runs cdist-object-run(1) +for each created object. SEE ALSO -------- - cdist(7) - cdist-type-explorer-push(1) -- cdist-object-explorer-run(1) -- cdist-object-gencode-run(1) -- cdist-object-push(1) -- cdist-object-code-run(1) +- cdist-object-run(1) - cdist-type(1) diff --git a/doc/man/cdist-object-run.text b/doc/man/cdist-object-run.text new file mode 100644 index 00000000..b527c0e6 --- /dev/null +++ b/doc/man/cdist-object-run.text @@ -0,0 +1,37 @@ +cdist-object-run(1) +=================== +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-object-run - Run an object + + +SYNOPSIS +-------- +cdist-object-run HOSTNAME OBJECT + + +DESCRIPTION +----------- +Runs the given object on the given target host. +The different subtasks are dispatched to specialized exectuables. +See related man pages for details. + + +SEE ALSO +-------- +- cdist(7) +- cdist-object-explorer-run(1) +- cdist-object-gencode-run(1) +- cdist-object-push(1) +- cdist-object-code-run(1) +- cdist-type(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 4ee5d74c9ff5cb36132ef1751602087892b1d1fe Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 14:55:58 +0200 Subject: [PATCH 0401/5465] implement dependency handling at the object level Signed-off-by: Steven Armstrong --- bin/cdist-code-run | 15 ---------- bin/cdist-config | 16 ++++++++-- bin/cdist-object-manifest-run | 37 +++++++++++------------ bin/cdist-object-run | 54 ++++++++++++++++++++++------------ bin/cdist-object-run-all | 55 +++++++++++++++++------------------ 5 files changed, 93 insertions(+), 84 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index a6a9137f..e969d942 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -32,31 +32,16 @@ if [ ! -d "$(__cdist_object_dir "$object")" ]; then __cdist_exit_err "Object $object is missing." fi -finished="$(__cdist_object_code_finished "$object")" -require="$(__cdist_object_require "$object")" - code="$(__cdist_object_code "$object")-${__cdist_gencode_type}" -# Do nothing if our work has been done -if [ -f "$finished" ]; then - exit 0 -fi - echo "Checking code-${__cdist_gencode_type} for $object ..." -if [ -f "$require" ]; then - while read requirement; do - echo "Requiring dependency $requirement for $object ..." - cdist-code-run "$requirement" "$__cdist_gencode_type" - done < "$require" -fi if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then echo "Executing code-${__cdist_gencode_type} for $object ..." "$code" - touch "$finished" else __cdist_exit_err "$code exists, but is not executable." fi diff --git a/bin/cdist-config b/bin/cdist-config index 26139819..1b172ddb 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -42,7 +42,6 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_bin:=bin} : ${__cdist_name_code:=code} -: ${__cdist_name_code_finished:=codedone} : ${__cdist_name_conf_dir:=conf} : ${__cdist_name_dot_cdist:=.cdist} : ${__cdist_name_explorer:=explorer} @@ -68,6 +67,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_type:=type} : ${__cdist_name_type_bin:=type_bin} : ${__cdist_name_type_explorer:=type_explorer} +: ${__cdist_name_objects_created:=objects_created} # Used for IDs: Allow everything not starting with - and . : ${__cdist_sane_regexp:=[^-\.].*} @@ -107,6 +107,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") : ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifest} : ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init} : ${__cdist_type_dir:=$__cdist_conf_dir/$__cdist_name_type} +: ${__cdist_new_objects_created:=$__cdist_local_base_dir/$__cdist_name_objects_created} ################################################################################ # Local output @@ -176,6 +177,14 @@ __cdist_init_deploy() ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir" } +__cdist_new_objects_created() { + touch "$__cdist_tmp_dir/object_created" +} + +__cdist_has_new_objects() { + touch "$__cdist_tmp_dir/object_created" +} + ################################################################################ # Object # @@ -185,9 +194,9 @@ __cdist_object_code() echo "$(__cdist_object_dir "$1")/${__cdist_name_code}" } -__cdist_object_code_finished() +__cdist_object_finished() { - echo "$(__cdist_object_dir "$1")/${__cdist_name_code_finished}" + echo "$(__cdist_object_dir "$1")/${__cdist_name_object_finished}" } __cdist_object_dir() @@ -250,6 +259,7 @@ __cdist_object_type_explorer_dir() echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" } + ################################################################################ # Remote # diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index e20848cd..4f8111f6 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -35,30 +35,27 @@ __cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object")" # Only the id __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" -if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then - echo "Checking manifest for $__cdist_object ..." +echo "Checking manifest for $__cdist_object ..." - __cdist_type="$(__cdist_type_from_object "$__cdist_object")" - __cdist_manifest="$(__cdist_type_manifest "$__cdist_type")" +__cdist_type="$(__cdist_type_from_object "$__cdist_object")" +__cdist_manifest="$(__cdist_type_manifest "$__cdist_type")" - if [ -f "$__cdist_manifest" ]; then - if [ -x "$__cdist_manifest" ]; then - # Make __cdist_manifest available for cdist-type-emulator - export __cdist_manifest +if [ -f "$__cdist_manifest" ]; then + if [ -x "$__cdist_manifest" ]; then + # Make __cdist_manifest available for cdist-type-emulator + export __cdist_manifest - echo "Executing manifest ${__cdist_manifest} ..." - # Make variables available to non-core - FIXME: beatify - export $__cdist_name_var_object="$__cdist_cur_object_dir" - export $__cdist_name_var_object_id="$__cdist_object_id" - export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" + echo "Executing manifest ${__cdist_manifest} ..." + # Make variables available to non-core - FIXME: beatify + export $__cdist_name_var_object="$__cdist_cur_object_dir" + export $__cdist_name_var_object_id="$__cdist_object_id" + export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" - cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" - else - __cdist_exit_err "${__cdist_manifest} needs to be executable." - fi + cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" + # Tell cdist that there may be new objects + touch "$__cdist_new_objects_created" + else + __cdist_exit_err "${__cdist_manifest} needs to be executable." fi fi -# done with this object -touch "$__cdist_cur_object_dir/$__cdist_name_object_finished" - diff --git a/bin/cdist-object-run b/bin/cdist-object-run index e123c7a4..6ad95656 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -21,6 +21,7 @@ # # For the given object: # - run type explorers +# - run type manifest # - generate code # - copy object to target # - execute code on target @@ -35,24 +36,41 @@ __cdist_object="$1"; shift __cdist_type="$(__cdist_type_from_object "$__cdist_object")" +__cdist_types_pushed="$__cdist_tmp_dir/types_pushed" +touch "$__cdist_types_pushed" -# Check if type of object has >= 1 explorer -__cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" +__cdist_object_finished="$(__cdist_object_finished "$__cdist_object")" +if [ ! -f "$__cdist_object_finished" ]; then + + echo + echo "Running object $__cdist_object" + + # Check if type of object has >= 1 explorer + __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" + + # Run the type explorers for the current object if any + if [ "$__cdist_has_explorer" ]; then + if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then + cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" + echo "$__cdist_type" >> "$__cdist_types_pushed" + fi + + cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" + fi + + # Run the manifest for the current object + cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" + + # Run the gencode scripts for the current object + cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" + + # Transfer the current object to the target + cdist-object-push "$__cdist_target_host" "$__cdist_object" + + # Run the code for the current object + cdist-object-code-run "$__cdist_target_host" "$__cdist_object" + + # Mark this object as done + touch "$__cdist_object_finished" -# Run the type explorers for the current object if any -if [ "$__cdist_has_explorer" ]; then - cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" fi - -# Run the manifest for the current object -cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" - -# Run the gencode scripts for the current object -cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" - -# Transfer the current object to the target -cdist-object-push "$__cdist_target_host" "$__cdist_object" - -# Run the code for the current object -cdist-object-code-run "$__cdist_target_host" "$__cdist_object" - diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 45a1ae2a..582ff163 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -29,39 +29,38 @@ set -eu __cdist_target_host="$1"; shift __cdist_objects="$__cdist_tmp_dir/objects" -__cdist_types_pushed="$__cdist_tmp_dir/types_pushed" -touch "$__cdist_types_pushed" + +# Loop until we do not create new objects anymore +# which is equal to all objects have been run +touch "$__cdist_new_objects_created" +while [ -f "$__cdist_new_objects_created" ]; do + # Assume we're done after this run + rm "$__cdist_new_objects_created" + + # Get listing of objects + __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects" -# Get listing of objects -__cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects" + # NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP + while read __cdist_object; do + set -- "$@" "$__cdist_object" + done < "$__cdist_objects" + while [ $# -gt 0 ]; do + __cdist_object="$1"; shift -# NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP -while read __cdist_object; do - set -- "$@" "$__cdist_object" -done < "$__cdist_objects" + __cdist_object_require="$(__cdist_object_require "$__cdist_object")" + if [ -f "$__cdist_object_require" ]; then + echo + while read __cdist_requirement; do + echo "Resolving dependency $__cdist_object -> $__cdist_requirement ..." + cdist-object-run "$__cdist_target_host" "$__cdist_requirement" + done < "$__cdist_object_require" + fi -while [ $# -gt 0 ]; do - __cdist_object="$1"; shift - echo - echo "Running object $__cdist_object" - - __cdist_type="$(__cdist_type_from_object "$__cdist_object")" - - # Check if type of object has >= 1 explorer - __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" - - # Transfer the type explorers if any - if [ "$__cdist_has_explorer" ]; then - if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then - cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" - echo "$__cdist_type" >> "$__cdist_types_pushed" - fi - fi - - # Process the given object - cdist-object-run "$__cdist_target_host" "$__cdist_object" + # Process the object + cdist-object-run "$__cdist_target_host" "$__cdist_object" + done done From 62c4f0d086d76f54a5cc63e5a8741d5f30a7691a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 15:16:48 +0200 Subject: [PATCH 0402/5465] ABORT if explorer fails, not only WARN Signed-off-by: Nico Schottelius --- bin/cdist-remote-explorer-run | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/cdist-remote-explorer-run b/bin/cdist-remote-explorer-run index 1fdd1467..028f8d7d 100755 --- a/bin/cdist-remote-explorer-run +++ b/bin/cdist-remote-explorer-run @@ -57,16 +57,16 @@ for explorer in "$__cdist_explorer_dir/"*; do if [ -f "$explorer" ]; then if [ ! -x "$explorer" ]; then - echo "Explorer \"$explorer\" exists, but is not executable." - continue + echo "Explorer \"$explorer\" exists, but is not executable." >&2 + exit 1 fi # Execute explorers and save results in remote destination directory "$explorer" > "${__cdist_my_out_dir}/$explorer_name" else if [ -e "$explorer" ]; then - echo "Explorer \"$explorer\" exists, but is not a file." - continue + echo "Explorer \"$explorer\" exists, but is not a file." >&2 + exit 1 fi fi done From 9bdba19d4a077641d8a797ff1ae7f1cca4d696b8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 15:20:58 +0200 Subject: [PATCH 0403/5465] prepend slash when using __object_id as name for __process Signed-off-by: Nico Schottelius --- conf/type/__process/explorer/runs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__process/explorer/runs b/conf/type/__process/explorer/runs index 240ebef9..2bfa8f84 100755 --- a/conf/type/__process/explorer/runs +++ b/conf/type/__process/explorer/runs @@ -24,7 +24,7 @@ if [ -f "$__object/parameter/name" ]; then name="$(cat "$__object/parameter/name")" else - name="$__object_id" + name="/$__object_id" fi pgrep -x -f "$name" || true From 8b0b7052c67673684018d0010eea94611a6febe7 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 15:28:55 +0200 Subject: [PATCH 0404/5465] remove commented obsolete code Signed-off-by: Steven Armstrong --- bin/cdist-deploy-to | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index c9aa1e2f..b0a0117d 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -49,7 +49,7 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" -#cdist-manifest-run-all "$__cdist_target_host" cdist-object-run-all "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" + From ba0bc4d02b320422a8605d56ea7932edb6de1c81 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:09:02 +0200 Subject: [PATCH 0405/5465] add somo todo proposals for steven / questions Signed-off-by: Nico Schottelius --- doc/dev/todo/steven-from-nico | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/dev/todo/steven-from-nico diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico new file mode 100644 index 00000000..1aa81aaa --- /dev/null +++ b/doc/dev/todo/steven-from-nico @@ -0,0 +1,12 @@ +- check: echo without parameters == valid in posix? bin/cdist-object-run:45 and others +- align messages (already in todo for steven, but makes life much easier, thus repeated) +- advantage of touch/rm loop vs. y == variable? bin/cdist-object-run-all +- bin/cdist-object-run-all: "->" graphic: can be useful, but if -> consistent! + -> all graphics could look cool: + + Object foo + | + |--> Requires ... + |--> ... + + but maybe bad do parse from outside From 29b61f38eaede3edab65fc5ef3308caecce77da3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:09:35 +0200 Subject: [PATCH 0406/5465] remove unecessary empty lines (interrupts read flow) Signed-off-by: Nico Schottelius --- bin/cdist-object-run-all | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 582ff163..a3745689 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -40,7 +40,6 @@ while [ -f "$__cdist_new_objects_created" ]; do # Get listing of objects __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects" - # NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP while read __cdist_object; do set -- "$@" "$__cdist_object" @@ -60,7 +59,5 @@ while [ -f "$__cdist_new_objects_created" ]; do # Process the object cdist-object-run "$__cdist_target_host" "$__cdist_object" - done done - From 98c7b98aac81776d2a109dee08f3b8e0c25c15b0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:16:55 +0200 Subject: [PATCH 0407/5465] more todo for steven :-p Signed-off-by: Nico Schottelius --- doc/dev/todo/steven-from-nico | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico index 1aa81aaa..c879144d 100644 --- a/doc/dev/todo/steven-from-nico +++ b/doc/dev/todo/steven-from-nico @@ -1,6 +1,7 @@ - check: echo without parameters == valid in posix? bin/cdist-object-run:45 and others - align messages (already in todo for steven, but makes life much easier, thus repeated) - advantage of touch/rm loop vs. y == variable? bin/cdist-object-run-all + also in bin/cdist-object-run - bin/cdist-object-run-all: "->" graphic: can be useful, but if -> consistent! -> all graphics could look cool: @@ -10,3 +11,7 @@ |--> ... but maybe bad do parse from outside + +- bin/cdist-object-run: type_explorer stuff: probably put into own binary + - sounds like cdist-object-explorer-run is already the right executable to + place such stuff into From 4ab770400a8f7349ca04f7c6d48f7581f3e678da Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:17:17 +0200 Subject: [PATCH 0408/5465] - lines + variable alignement Signed-off-by: Nico Schottelius --- bin/cdist-object-run | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 6ad95656..90e61fd4 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -34,14 +34,12 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift - __cdist_type="$(__cdist_type_from_object "$__cdist_object")" __cdist_types_pushed="$__cdist_tmp_dir/types_pushed" touch "$__cdist_types_pushed" __cdist_object_finished="$(__cdist_object_finished "$__cdist_object")" if [ ! -f "$__cdist_object_finished" ]; then - echo echo "Running object $__cdist_object" @@ -59,18 +57,17 @@ if [ ! -f "$__cdist_object_finished" ]; then fi # Run the manifest for the current object - cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" + cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" # Run the gencode scripts for the current object - cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" + cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" # Transfer the current object to the target - cdist-object-push "$__cdist_target_host" "$__cdist_object" + cdist-object-push "$__cdist_target_host" "$__cdist_object" # Run the code for the current object - cdist-object-code-run "$__cdist_target_host" "$__cdist_object" + cdist-object-code-run "$__cdist_target_host" "$__cdist_object" # Mark this object as done touch "$__cdist_object_finished" - fi From 4e68c3027b1b96a6f9348667241532c42d591d47 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:19:51 +0200 Subject: [PATCH 0409/5465] remove self explanatory comments Signed-off-by: Nico Schottelius --- bin/cdist-object-run | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 90e61fd4..d633e537 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -56,16 +56,9 @@ if [ ! -f "$__cdist_object_finished" ]; then cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" fi - # Run the manifest for the current object cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" - - # Run the gencode scripts for the current object cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" - - # Transfer the current object to the target cdist-object-push "$__cdist_target_host" "$__cdist_object" - - # Run the code for the current object cdist-object-code-run "$__cdist_target_host" "$__cdist_object" # Mark this object as done From 10c96dee875240c8290da46b72e61271d5e25d33 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:26:17 +0200 Subject: [PATCH 0410/5465] -useless emptly line in bin/cdist-deploy-to Signed-off-by: Nico Schottelius --- bin/cdist-deploy-to | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index af33c3fe..e44ceff4 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -53,4 +53,3 @@ cdist-object-run-all "$__cdist_target_host" cdist-cache "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" - From 78777ba9f3e8870975089d63fbd787361adc915a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:30:09 +0200 Subject: [PATCH 0411/5465] use same argv processing as elsewhere Signed-off-by: Nico Schottelius --- bin/cdist-remote-explorer-run | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/cdist-remote-explorer-run b/bin/cdist-remote-explorer-run index 028f8d7d..cef91e0d 100755 --- a/bin/cdist-remote-explorer-run +++ b/bin/cdist-remote-explorer-run @@ -25,9 +25,7 @@ # . cdist-config -if [ $# -ne 3 ]; then - __cdist_usage " " -fi +[ $# -eq 3 ] || __cdist_usage " " set -ue # Variable that defines the home of the explorers From 332548ba4f231c7d47f39dd8c64ef3954963527a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:31:26 +0200 Subject: [PATCH 0412/5465] more todo, less whiteline in bin/cdist-object-explorer-run Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 1 - doc/dev/todo/steven-from-nico | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index e349a490..637d4448 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -24,7 +24,6 @@ . cdist-config [ $# -eq 2 ] || __cdist_usage " " - set -eu __cdist_target_host="$1"; shift diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico index c879144d..bbfe13dc 100644 --- a/doc/dev/todo/steven-from-nico +++ b/doc/dev/todo/steven-from-nico @@ -15,3 +15,31 @@ - bin/cdist-object-run: type_explorer stuff: probably put into own binary - sounds like cdist-object-explorer-run is already the right executable to place such stuff into + +- remove enormous amount of empty lines :-) + - at end of file + - between [ $# -eq 2 ] || and set + - after if + - before fi + +- cdist-type-explorer-push: wherefore if [ -d "$src_dir" ];? + -> does this not even hide bugs? + -> not sure whether covering cdist-dir in its own script makes + sense, as cdist-dir push is only a one liner + -> if cdist-dir does too less, enhance it + +- code aus cdist-object-run-all für requirements: + in cdist-object-requirements oder so auslagern? + cdist-object-run-all wäre dann eine schöne zwei-zeiler-schleife + +- try to prefix all internal variables with __cdist! + - only avoid if waayyyyyyyyyyy tooooooooo long + - f.i.: cdist-object-explorer-run + +- cdist-object-explorer-run and bin/cdist-object-run seem to contain + very very similar code regarding transfer and co. + + +- general: cdist-object-run-all looks like a good idea! + + From 8abd5ce33ed323719bd29b1e8f97b3b1b14e85e4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:37:26 +0200 Subject: [PATCH 0413/5465] - another empty line Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode-run | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/cdist-object-gencode-run b/bin/cdist-object-gencode-run index 76ce6953..bfc65730 100755 --- a/bin/cdist-object-gencode-run +++ b/bin/cdist-object-gencode-run @@ -41,4 +41,3 @@ cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ "${__cdist_name_gencode_remote}" > "${code_remote}" chmod u+x "${code_local}" "${code_remote}" - From 8315ac2e256ff7de0f77bf9806ae94b391bd01bc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:38:08 +0200 Subject: [PATCH 0414/5465] - blank lines Signed-off-by: Nico Schottelius --- bin/cdist-object-push | 2 -- doc/dev/todo/steven-from-nico | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-object-push b/bin/cdist-object-push index 9c44d14e..170aaef3 100755 --- a/bin/cdist-object-push +++ b/bin/cdist-object-push @@ -29,9 +29,7 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift - echo "Transferring object $__cdist_object to target host ..." cdist-dir push "$__cdist_target_host" \ "$(__cdist_object_dir "$__cdist_object")" \ "$(__cdist_remote_object_dir "$__cdist_object")" - diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico index bbfe13dc..52d3047f 100644 --- a/doc/dev/todo/steven-from-nico +++ b/doc/dev/todo/steven-from-nico @@ -39,6 +39,8 @@ - cdist-object-explorer-run and bin/cdist-object-run seem to contain very very similar code regarding transfer and co. +- cdist-object-manifest-run: + # Tell cdist that there may be new objects -> WHO? :-) - general: cdist-object-run-all looks like a good idea! From a46c0a43726e66ed1903f0b7018bb9c5282d5089 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:38:43 +0200 Subject: [PATCH 0415/5465] replace CONSTANT target host by variable target host Signed-off-by: Nico Schottelius --- bin/cdist-object-push | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-object-push b/bin/cdist-object-push index 170aaef3..f7d46be4 100755 --- a/bin/cdist-object-push +++ b/bin/cdist-object-push @@ -29,7 +29,7 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift -echo "Transferring object $__cdist_object to target host ..." +echo "Transferring object $__cdist_object to $__cdist_target_host ..." cdist-dir push "$__cdist_target_host" \ "$(__cdist_object_dir "$__cdist_object")" \ "$(__cdist_remote_object_dir "$__cdist_object")" From c80fa65af1236c68e391ad6753d37a2631ad420d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 18:42:04 +0200 Subject: [PATCH 0416/5465] -blank line Signed-off-by: Nico Schottelius --- bin/cdist-object-code-run | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/cdist-object-code-run b/bin/cdist-object-code-run index b75f6f46..d0722788 100755 --- a/bin/cdist-object-code-run +++ b/bin/cdist-object-code-run @@ -39,4 +39,3 @@ cdist-run-remote "$__cdist_target_host" \ "export __cdist_out_object_dir=\"$__cdist_remote_out_object_dir\";" \ "cdist-code-run" "$__cdist_object" "${__cdist_name_gencode_remote}" \ || __cdist_exit_err "Remote code failed for $__cdist_object" - From bb66523ea517822874125b4959ea9be4b52b131e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 28 Mar 2011 22:43:50 +0200 Subject: [PATCH 0417/5465] todo: fix __ in asciidoc Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 138f7714..b362d491 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -18,4 +18,7 @@ Types to be written/extended: -> aka sed. - __cron - +DOCUMENTATION +-------------- +- asciidoc interprets __, which we use for variables + names -> seek through docs and replace with \_\_! From 3618b225a39835d56bac0c1eda11b07688e1bb49 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 10:34:04 +0200 Subject: [PATCH 0418/5465] make all internal variables __cdist_ prefixed Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 637d4448..e9a20921 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -33,10 +33,10 @@ __object_id="$(__cdist_object_id_from_object "$__object")" __cdist_type="$(__cdist_type_from_object "$__object")" # Check if type of object has >= 1 explorer -has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" +__cdist_has_explorer="$(__cdist_type___cdist_has_explorer "$__cdist_type")" # If so, run explorers on remote side -if [ "$has_explorer" ]; then +if [ "$__cdist_has_explorer" ]; then echo "Running explorers for $__object ..." # Copy object parameters cdist-dir push "$__cdist_target_host" \ @@ -57,4 +57,3 @@ if [ "$has_explorer" ]; then "$(__cdist_remote_object_type_explorer_dir "$__object")" \ "$(__cdist_object_type_explorer_dir "$__object")" fi - From 5306737d22aa2da3b685cd02a0134202e401a7ca Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 10:38:35 +0200 Subject: [PATCH 0419/5465] discuss todos / cleanup / make more fun for us Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 -- bin/cdist-object-manifest-run | 3 +- bin/cdist-object-run | 1 + bin/cdist-object-run-all | 7 ++++- doc/dev/todo/niconext | 2 ++ doc/dev/todo/steven-from-nico | 59 +++++++++++++++++++++-------------- 6 files changed, 45 insertions(+), 29 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index c4b8d44c..9a00395d 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -68,7 +68,6 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_type:=type} : ${__cdist_name_type_bin:=type_bin} : ${__cdist_name_type_explorer:=type_explorer} -: ${__cdist_name_objects_created:=objects_created} # Used for IDs: Allow everything not starting with - and . : ${__cdist_sane_regexp:=[^-\.].*} @@ -109,7 +108,6 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") : ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifest} : ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init} : ${__cdist_type_dir:=$__cdist_conf_dir/$__cdist_name_type} -: ${__cdist_new_objects_created:=$__cdist_local_base_dir/$__cdist_name_objects_created} ################################################################################ # Local output diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index 4f8111f6..a65ed138 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -52,10 +52,9 @@ if [ -f "$__cdist_manifest" ]; then export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" - # Tell cdist that there may be new objects + FIXME: Tell cdist that there may be new objects - WHO? Mama? touch "$__cdist_new_objects_created" else __cdist_exit_err "${__cdist_manifest} needs to be executable." fi fi - diff --git a/bin/cdist-object-run b/bin/cdist-object-run index d633e537..015d95fa 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -46,6 +46,7 @@ if [ ! -f "$__cdist_object_finished" ]; then # Check if type of object has >= 1 explorer __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" + FIXME: put into cdist-object-explorer-run # Run the type explorers for the current object if any if [ "$__cdist_has_explorer" ]; then if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index a3745689..7c87660b 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -30,6 +30,9 @@ __cdist_target_host="$1"; shift __cdist_objects="$__cdist_tmp_dir/objects" +FIXME: reuse in subscripts, save in objects_base_dir +export __cdist_objects_created="$__cdist_tmp_dir/objects_created" + # Loop until we do not create new objects anymore # which is equal to all objects have been run touch "$__cdist_new_objects_created" @@ -48,11 +51,13 @@ while [ -f "$__cdist_new_objects_created" ]; do while [ $# -gt 0 ]; do __cdist_object="$1"; shift + FIXME: migrate into cdist-object-run + FIXME: take care of SSH foo after migration in while loop __cdist_object_require="$(__cdist_object_require "$__cdist_object")" if [ -f "$__cdist_object_require" ]; then echo while read __cdist_requirement; do - echo "Resolving dependency $__cdist_object -> $__cdist_requirement ..." + echo "Resolving dependency $__cdist_requirement for $__cdist_object ..." cdist-object-run "$__cdist_target_host" "$__cdist_requirement" done < "$__cdist_object_require" fi diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index e9a6ddfc..be66a33d 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,5 @@ +/ prefix all internal variables with __cdist! -> Nico + Cache: - add example how to use - export variable $__cache diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico index 52d3047f..c04e980f 100644 --- a/doc/dev/todo/steven-from-nico +++ b/doc/dev/todo/steven-from-nico @@ -1,8 +1,5 @@ -- check: echo without parameters == valid in posix? bin/cdist-object-run:45 and others -- align messages (already in todo for steven, but makes life much easier, thus repeated) -- advantage of touch/rm loop vs. y == variable? bin/cdist-object-run-all - also in bin/cdist-object-run -- bin/cdist-object-run-all: "->" graphic: can be useful, but if -> consistent! +x check: echo without parameters == valid in posix? bin/cdist-object-run:45 and others +x bin/cdist-object-run-all: "->" graphic: can be useful, but if -> consistent! -> all graphics could look cool: Object foo @@ -12,36 +9,50 @@ but maybe bad do parse from outside -- bin/cdist-object-run: type_explorer stuff: probably put into own binary - - sounds like cdist-object-explorer-run is already the right executable to - place such stuff into - -- remove enormous amount of empty lines :-) +x advantage of touch/rm loop vs. y == variable? bin/cdist-object-run-all + also in bin/cdist-object-run + -> cool :-) +x remove enormous amount of empty lines :-) - at end of file - between [ $# -eq 2 ] || and set - after if - before fi +x code aus cdist-object-run-all für requirements: + in cdist-object-requirements oder so auslagern? + cdist-object-run-all wäre dann eine schöne zwei-zeiler-schleife + +x cdist-object-explorer-run and bin/cdist-object-run seem to contain + very very similar code regarding transfer and co. + -> indirect solved by moving code into cdist-object-explorer-run + +x cdist-object-manifest-run: + # Tell cdist that there may be new objects -> WHO? :-) + +x general: cdist-object-run-all looks like a good idea! + +- export $__cdist_name_var_self=$__cdist_object_self -> non core + +- bin/cdist-object-run: type_explorer stuff: probably put into own binary + - sounds like cdist-object-explorer-run is already the right executable to + place such stuff into + - cdist-type-explorer-push: wherefore if [ -d "$src_dir" ];? -> does this not even hide bugs? -> not sure whether covering cdist-dir in its own script makes sense, as cdist-dir push is only a one liner -> if cdist-dir does too less, enhance it + => merge into cdist-object-explorer-run -- code aus cdist-object-run-all für requirements: - in cdist-object-requirements oder so auslagern? - cdist-object-run-all wäre dann eine schöne zwei-zeiler-schleife +- marker for type transferred / pushed goes into out/type/ + -> new variables for out/type + -> new variables for out/type/.MARKERFOONAMEMEGOOD -- try to prefix all internal variables with __cdist! - - only avoid if waayyyyyyyyyyy tooooooooo long - - f.i.: cdist-object-explorer-run - -- cdist-object-explorer-run and bin/cdist-object-run seem to contain - very very similar code regarding transfer and co. - -- cdist-object-manifest-run: - # Tell cdist that there may be new objects -> WHO? :-) - -- general: cdist-object-run-all looks like a good idea! +- new function: __cdist_type_explorer_created $name + if ! -d foo -> mkdir foo, echo $name >> foo/$NEW_FANCY_VAR +- align messages (already in todo for steven, but makes life much easier, thus repeated) + -> prefix all object stuff with $__self + -> __cdist_echo object string + -> $__cdist_object_self :-) From f187ed257aed536c8b0d12a8d0d42bb83d327dec Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 14:36:35 +0200 Subject: [PATCH 0420/5465] implement the big code shuffle Signed-off-by: Steven Armstrong --- bin/cdist-config | 20 ++++++++++++++++++ bin/cdist-object-explorer-run | 14 +++++++++--- bin/cdist-object-manifest-run | 4 ++-- bin/cdist-object-run | 29 +++++++++++++------------ bin/cdist-object-run-all | 21 +++--------------- bin/cdist-type-explorer-push | 40 ----------------------------------- doc/dev/todo/steven-from-nico | 19 +++++++++-------- doc/man/cdist-stages.text | 7 ++++-- 8 files changed, 67 insertions(+), 87 deletions(-) delete mode 100755 bin/cdist-type-explorer-push diff --git a/bin/cdist-config b/bin/cdist-config index 9a00395d..2c751cd8 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -57,6 +57,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_object_finished:=done} : ${__cdist_name_object_id:=object_id} : ${__cdist_name_object_source:=source} +: ${__cdist_name_objects_created:=.objects_created} : ${__cdist_name_out_dir:=out} : ${__cdist_name_parameter:=parameter} : ${__cdist_name_parameter_required:=required} @@ -68,6 +69,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_type:=type} : ${__cdist_name_type_bin:=type_bin} : ${__cdist_name_type_explorer:=type_explorer} +: ${__cdist_name_type_explorer_pushed:=.explorer_pushed} # Used for IDs: Allow everything not starting with - and . : ${__cdist_sane_regexp:=[^-\.].*} @@ -115,6 +117,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") : ${__cdist_out_dir:=$__cdist_local_base_dir/$__cdist_name_out_dir} : ${__cdist_out_explorer_dir:=$__cdist_out_dir/$__cdist_name_explorer} : ${__cdist_out_object_dir:=$__cdist_out_dir/$__cdist_name_object} +: ${__cdist_out_type_dir:=$__cdist_out_dir/$__cdist_name_type} : ${__cdist_out_type_bin_dir:=$__cdist_out_dir/$__cdist_name_type_bin} ################################################################################ @@ -134,6 +137,11 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") : ${__cdist_remote_out_explorer_dir:=$__cdist_remote_out_dir/$__cdist_name_explorer} : ${__cdist_remote_out_object_dir:=$__cdist_remote_out_dir/$__cdist_name_object} +################################################################################ +# Global internal variables +# +: ${__cdist_objects_created:=$__cdist_out_object_dir/$__cdist_name_objects_created} + ################################################################################ # Internal functions # @@ -329,6 +337,18 @@ __cdist_type_has_explorer() fi } +__cdist_type_explorer_pushed() +{ + [ -f "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" ] \ + && grep -q "$1" "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" +} + +__cdist_type_explorer_pushed_add() +{ + [ -d "$__cdist_out_type_dir" ] || mkdir "$__cdist_out_type_dir" + echo "$1" >> "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" +} + __cdist_type_gencode() { echo "${__cdist_type_dir}/$1/${__cdist_name_gencode}" diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index e9a20921..72ca7a1d 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -32,11 +32,19 @@ __object="$1"; shift __object_id="$(__cdist_object_id_from_object "$__object")" __cdist_type="$(__cdist_type_from_object "$__object")" -# Check if type of object has >= 1 explorer -__cdist_has_explorer="$(__cdist_type___cdist_has_explorer "$__cdist_type")" -# If so, run explorers on remote side +# Check if type of object has >= 1 explorer +__cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" +# Run the type explorers for the current object if any if [ "$__cdist_has_explorer" ]; then + if ! __cdist_type_explorer_pushed "$__cdist_type"; then + src_dir="$(__cdist_type_explorer_dir "$__cdist_type")" + dst_dir="$(__cdist_remote_type_explorer_dir "$__cdist_type")" + echo "Transfering explorers for $__cdist_type ..." + cdist-dir push "$__cdist_target_host" "$src_dir" "$dst_dir" + __cdist_type_explorer_pushed_add "$__cdist_type" + fi + echo "Running explorers for $__object ..." # Copy object parameters cdist-dir push "$__cdist_target_host" \ diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index a65ed138..25378eb2 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -52,8 +52,8 @@ if [ -f "$__cdist_manifest" ]; then export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" - FIXME: Tell cdist that there may be new objects - WHO? Mama? - touch "$__cdist_new_objects_created" + # Tell cdist-object-run-all that there may be new objects + touch "$__cdist_objects_created" else __cdist_exit_err "${__cdist_manifest} needs to be executable." fi diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 015d95fa..f5d846e3 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -40,23 +40,26 @@ touch "$__cdist_types_pushed" __cdist_object_finished="$(__cdist_object_finished "$__cdist_object")" if [ ! -f "$__cdist_object_finished" ]; then - echo - echo "Running object $__cdist_object" - # Check if type of object has >= 1 explorer - __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" + # Resolve dependencies if any + __cdist_object_require="$(__cdist_object_require "$__cdist_object")" + if [ -f "$__cdist_object_require" ]; then + echo + # NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP + while read __cdist_requirement; do + set -- "$@" "$__cdist_requirement" + done < "$__cdist_object_require" - FIXME: put into cdist-object-explorer-run - # Run the type explorers for the current object if any - if [ "$__cdist_has_explorer" ]; then - if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then - cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" - echo "$__cdist_type" >> "$__cdist_types_pushed" - fi - - cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" + while [ $# -gt 0 ]; do + __cdist_requirement="$1"; shift + echo "Resolving dependency $__cdist_requirement for $__cdist_object ..." + cdist-object-run "$__cdist_target_host" "$__cdist_requirement" + done fi + echo + echo "Running object $__cdist_object" + cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" cdist-object-push "$__cdist_target_host" "$__cdist_object" diff --git a/bin/cdist-object-run-all b/bin/cdist-object-run-all index 7c87660b..c646ab16 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-run-all @@ -30,15 +30,12 @@ __cdist_target_host="$1"; shift __cdist_objects="$__cdist_tmp_dir/objects" -FIXME: reuse in subscripts, save in objects_base_dir -export __cdist_objects_created="$__cdist_tmp_dir/objects_created" - # Loop until we do not create new objects anymore # which is equal to all objects have been run -touch "$__cdist_new_objects_created" -while [ -f "$__cdist_new_objects_created" ]; do +touch "$__cdist_objects_created" +while [ -f "$__cdist_objects_created" ]; do # Assume we're done after this run - rm "$__cdist_new_objects_created" + rm "$__cdist_objects_created" # Get listing of objects __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects" @@ -50,18 +47,6 @@ while [ -f "$__cdist_new_objects_created" ]; do while [ $# -gt 0 ]; do __cdist_object="$1"; shift - - FIXME: migrate into cdist-object-run - FIXME: take care of SSH foo after migration in while loop - __cdist_object_require="$(__cdist_object_require "$__cdist_object")" - if [ -f "$__cdist_object_require" ]; then - echo - while read __cdist_requirement; do - echo "Resolving dependency $__cdist_requirement for $__cdist_object ..." - cdist-object-run "$__cdist_target_host" "$__cdist_requirement" - done < "$__cdist_object_require" - fi - # Process the object cdist-object-run "$__cdist_target_host" "$__cdist_object" done diff --git a/bin/cdist-type-explorer-push b/bin/cdist-type-explorer-push deleted file mode 100755 index 7ba412ca..00000000 --- a/bin/cdist-type-explorer-push +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Push the given types explorers to the target host -# - -. cdist-config -[ $# -eq 2 ] || __cdist_usage " " - -set -eu - -__cdist_target_host="$1"; shift -__cdist_type="$1"; shift - -src_dir="$(__cdist_type_explorer_dir "$__cdist_type")" -dst_dir="$(__cdist_remote_type_explorer_dir "$__cdist_type")" - -if [ -d "$src_dir" ]; then - echo "Transfering explorers for $__cdist_type ..." - cdist-dir push "$__cdist_target_host" "$src_dir" "$dst_dir" -fi - diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico index c04e980f..2f0ca2b5 100644 --- a/doc/dev/todo/steven-from-nico +++ b/doc/dev/todo/steven-from-nico @@ -31,28 +31,29 @@ x cdist-object-manifest-run: x general: cdist-object-run-all looks like a good idea! -- export $__cdist_name_var_self=$__cdist_object_self -> non core - -- bin/cdist-object-run: type_explorer stuff: probably put into own binary - - sounds like cdist-object-explorer-run is already the right executable to - place such stuff into - -- cdist-type-explorer-push: wherefore if [ -d "$src_dir" ];? +x cdist-type-explorer-push: wherefore if [ -d "$src_dir" ];? -> does this not even hide bugs? -> not sure whether covering cdist-dir in its own script makes sense, as cdist-dir push is only a one liner -> if cdist-dir does too less, enhance it => merge into cdist-object-explorer-run -- marker for type transferred / pushed goes into out/type/ +x bin/cdist-object-run: type_explorer stuff: probably put into own binary + - sounds like cdist-object-explorer-run is already the right executable to + place such stuff into + +x marker for type transferred / pushed goes into out/type/ -> new variables for out/type -> new variables for out/type/.MARKERFOONAMEMEGOOD -- new function: __cdist_type_explorer_created $name +x new function: __cdist_type_explorer_created $name if ! -d foo -> mkdir foo, echo $name >> foo/$NEW_FANCY_VAR +- export $__cdist_name_var_self=$__cdist_object_self -> non core + - align messages (already in todo for steven, but makes life much easier, thus repeated) -> prefix all object stuff with $__self -> __cdist_echo object string -> $__cdist_object_self :-) + diff --git a/doc/man/cdist-stages.text b/doc/man/cdist-stages.text index 4ab93cff..fbd60cea 100644 --- a/doc/man/cdist-stages.text +++ b/doc/man/cdist-stages.text @@ -51,8 +51,11 @@ Related manpages: - cdist-manifest-run-init(1) -STAGE 3: EXECUTION OF TYPES ---------------------------- +STAGE 3: EXECUTION OF OBJECTS +----------------------------- +Each object in the cconfig database is run through the following stages: +- + Every object is checked whether its type has a manifest file. If the type has a manifest file and it is executable, it will be executed. The manifest script may generate and change the created objects. In other words, one type can reuse From 801d2be3d2fbfacd84affbd2e50f85685278d848 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:17:45 +0200 Subject: [PATCH 0421/5465] remove legacy variables Signed-off-by: Steven Armstrong --- bin/cdist-object-run | 2 -- 1 file changed, 2 deletions(-) diff --git a/bin/cdist-object-run b/bin/cdist-object-run index f5d846e3..af543316 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -35,8 +35,6 @@ __cdist_target_host="$1"; shift __cdist_object="$1"; shift __cdist_type="$(__cdist_type_from_object "$__cdist_object")" -__cdist_types_pushed="$__cdist_tmp_dir/types_pushed" -touch "$__cdist_types_pushed" __cdist_object_finished="$(__cdist_object_finished "$__cdist_object")" if [ ! -f "$__cdist_object_finished" ]; then From 32392d129a3cafdaca0ba509e1aada102e656b48 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:27:17 +0200 Subject: [PATCH 0422/5465] implement $__self Signed-off-by: Steven Armstrong --- bin/cdist-config | 2 ++ bin/cdist-object-explorer-run | 1 + bin/cdist-object-run | 2 ++ 3 files changed, 5 insertions(+) diff --git a/bin/cdist-config b/bin/cdist-config index 2c751cd8..19c127d4 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -63,6 +63,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_parameter_required:=required} : ${__cdist_name_parameter_optional:=optional} : ${__cdist_name_require:=require} +: ${__cdist_name_self:=self} : ${__cdist_name_singleton:=singleton} : ${__cdist_name_target_host:=target_host} : ${__cdist_name_target_user:=target_user} @@ -89,6 +90,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_var_target_user:=__$__cdist_name_target_user} : ${__cdist_name_var_object:=__$__cdist_name_object} : ${__cdist_name_var_object_id:=__$__cdist_name_object_id} +: ${__cdist_name_var_self:=__$__cdist_name_self} : ${__cdist_name_var_type:=__$__cdist_name_type} diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 72ca7a1d..99e12e89 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -55,6 +55,7 @@ if [ "$__cdist_has_explorer" ]; then cdist-run-remote "$__cdist_target_host" \ "__object=\"$(__cdist_remote_object_dir "$__object")\"" \ "__object_id=\"$__object_id\"" \ + "$__cdist_name_var_self=\"$__cdist_object\"" \ cdist-remote-explorer-run \ "$__cdist_name_var_type_explorer" \ "$(__cdist_remote_type_explorer_dir "$__cdist_type")" \ diff --git a/bin/cdist-object-run b/bin/cdist-object-run index af543316..450ba361 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -33,6 +33,8 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift +# Export to non-core for use in manifest and gencode scripts +export $__cdist_name_var_self=$__cdist_object __cdist_type="$(__cdist_type_from_object "$__cdist_object")" From ce62775aecd5117040cc4f188d5ff700e7dc46d7 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:29:56 +0200 Subject: [PATCH 0423/5465] remove hard coded variable names; prefix all variables with __cdist_ Signed-off-by: Steven Armstrong --- bin/cdist-object-explorer-run | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 99e12e89..ff0668e5 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -27,10 +27,10 @@ set -eu __cdist_target_host="$1"; shift -__object="$1"; shift +__cdist_object="$1"; shift -__object_id="$(__cdist_object_id_from_object "$__object")" -__cdist_type="$(__cdist_type_from_object "$__object")" +__object_id="$(__cdist_object_id_from_object "$__cdist_object")" +__cdist_type="$(__cdist_type_from_object "$__cdist_object")" # Check if type of object has >= 1 explorer @@ -45,24 +45,24 @@ if [ "$__cdist_has_explorer" ]; then __cdist_type_explorer_pushed_add "$__cdist_type" fi - echo "Running explorers for $__object ..." + echo "Running explorers for $__cdist_object ..." # Copy object parameters cdist-dir push "$__cdist_target_host" \ - "$(__cdist_object_parameter_dir "$__object")" \ - "$(__cdist_remote_object_parameter_dir "$__object")" + "$(__cdist_object_parameter_dir "$__cdist_object")" \ + "$(__cdist_remote_object_parameter_dir "$__cdist_object")" # Execute explorers cdist-run-remote "$__cdist_target_host" \ - "__object=\"$(__cdist_remote_object_dir "$__object")\"" \ - "__object_id=\"$__object_id\"" \ - "$__cdist_name_var_self=\"$__cdist_object\"" \ + "$__cdist_name_var_object=\"$(__cdist_remote_object_dir "$__cdist_object")\"" \ + "$__cdist_name_var_object_id=\"$__object_id\"" \ + "$__cdist_name_var_self=\"$__cdist_object\"" \ cdist-remote-explorer-run \ "$__cdist_name_var_type_explorer" \ "$(__cdist_remote_type_explorer_dir "$__cdist_type")" \ - "$(__cdist_remote_object_type_explorer_dir "$__object")" + "$(__cdist_remote_object_type_explorer_dir "$__cdist_object")" # Copy back results cdist-dir pull "$__cdist_target_host" \ - "$(__cdist_remote_object_type_explorer_dir "$__object")" \ - "$(__cdist_object_type_explorer_dir "$__object")" + "$(__cdist_remote_object_type_explorer_dir "$__cdist_object")" \ + "$(__cdist_object_type_explorer_dir "$__cdist_object")" fi From f671df1c67abdebf79918596cd3407339c57d036 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:33:37 +0200 Subject: [PATCH 0424/5465] less todo Signed-off-by: Steven Armstrong --- doc/dev/todo/steven-from-nico | 54 ----------------------------------- 1 file changed, 54 deletions(-) diff --git a/doc/dev/todo/steven-from-nico b/doc/dev/todo/steven-from-nico index 2f0ca2b5..21c8fb52 100644 --- a/doc/dev/todo/steven-from-nico +++ b/doc/dev/todo/steven-from-nico @@ -1,57 +1,3 @@ -x check: echo without parameters == valid in posix? bin/cdist-object-run:45 and others -x bin/cdist-object-run-all: "->" graphic: can be useful, but if -> consistent! - -> all graphics could look cool: - - Object foo - | - |--> Requires ... - |--> ... - - but maybe bad do parse from outside - -x advantage of touch/rm loop vs. y == variable? bin/cdist-object-run-all - also in bin/cdist-object-run - -> cool :-) -x remove enormous amount of empty lines :-) - - at end of file - - between [ $# -eq 2 ] || and set - - after if - - before fi - -x code aus cdist-object-run-all für requirements: - in cdist-object-requirements oder so auslagern? - cdist-object-run-all wäre dann eine schöne zwei-zeiler-schleife - -x cdist-object-explorer-run and bin/cdist-object-run seem to contain - very very similar code regarding transfer and co. - -> indirect solved by moving code into cdist-object-explorer-run - -x cdist-object-manifest-run: - # Tell cdist that there may be new objects -> WHO? :-) - -x general: cdist-object-run-all looks like a good idea! - -x cdist-type-explorer-push: wherefore if [ -d "$src_dir" ];? - -> does this not even hide bugs? - -> not sure whether covering cdist-dir in its own script makes - sense, as cdist-dir push is only a one liner - -> if cdist-dir does too less, enhance it - => merge into cdist-object-explorer-run - -x bin/cdist-object-run: type_explorer stuff: probably put into own binary - - sounds like cdist-object-explorer-run is already the right executable to - place such stuff into - -x marker for type transferred / pushed goes into out/type/ - -> new variables for out/type - -> new variables for out/type/.MARKERFOONAMEMEGOOD - -x new function: __cdist_type_explorer_created $name - if ! -d foo -> mkdir foo, echo $name >> foo/$NEW_FANCY_VAR - -- export $__cdist_name_var_self=$__cdist_object_self -> non core - - - align messages (already in todo for steven, but makes life much easier, thus repeated) -> prefix all object stuff with $__self -> __cdist_echo object string From f2967ef9f13596a4fdaef6e7d07b569ed4ad1154 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:36:23 +0200 Subject: [PATCH 0425/5465] remove legacy script Signed-off-by: Steven Armstrong --- bin/cdist-manifest-run-all | 77 -------------------------------------- 1 file changed, 77 deletions(-) delete mode 100755 bin/cdist-manifest-run-all diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all deleted file mode 100755 index a431576d..00000000 --- a/bin/cdist-manifest-run-all +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# -# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# Run all manifests -# - -. cdist-config -[ $# -eq 1 ] || __cdist_usage "" -set -eu - -__cdist_target_host="$1"; shift - -__cdist_objects_list="${__cdist_tmp_dir}/objects_file" -__cdist_new_objects_list="${__cdist_tmp_dir}/new_objects_file" - -# Loop until we do not create new objects anymore -# which is equal to all objects have been run -__cdist_new_objects_created=y -while [ "$__cdist_new_objects_created" = "y" ]; do - # Assume we're done after this run - __cdist_new_objects_created=n - - __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects_list" - - # Check every object, if we need to run it - while read __cdist_object_self; do - # Full path to current object - __cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object_self")" - - # Only the id - __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" - - if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then - echo "Checking manifest for ${__cdist_object_self} ..." - - __cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" - __cdist_manifest="$(__cdist_type_manifest "${__cdist_type}")" - - if [ -f "$__cdist_manifest" ]; then - if [ -x "$__cdist_manifest" ]; then - # Make __cdist_manifest available for cdist-type-emulator - export __cdist_manifest - - echo "Executing manifest ${__cdist_manifest} ..." - # Make variables available to non-core - FIXME: beatify - export $__cdist_name_var_object="$__cdist_cur_object_dir" - export $__cdist_name_var_object_id="$__cdist_object_id" - export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" - - cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" - __cdist_new_objects_created=y - else - __cdist_exit_err "${__cdist_manifest} needs to be executable." - fi - fi - fi - - # done with this object - touch "$__cdist_cur_object_dir/$__cdist_name_object_finished" - done < "$__cdist_objects_list" -done From 49e987236fed77a1fc4314a1637ac82b29eba3bc Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:42:17 +0200 Subject: [PATCH 0426/5465] add manpage for cdist-object-manifest-run Signed-off-by: Steven Armstrong --- doc/man/cdist-object-manifest-run.text | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/man/cdist-object-manifest-run.text diff --git a/doc/man/cdist-object-manifest-run.text b/doc/man/cdist-object-manifest-run.text new file mode 100644 index 00000000..76132425 --- /dev/null +++ b/doc/man/cdist-object-manifest-run.text @@ -0,0 +1,32 @@ +cdist-object-manifest-run(1) +============================ +Nico Schottelius +Steven Armstrong + + +NAME +---- +cdist-object-manifest-run - Run an objects manifest + + +SYNOPSIS +-------- +cdist-object-manifest-run HOSTNAME OBJECT + + +DESCRIPTION +----------- +Run the manifest for the given object. + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) +- cdist-manifest-run(1) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 59cc3dc1b3afb9f5abc2a4dc55fd4984ed3b05b1 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:42:40 +0200 Subject: [PATCH 0427/5465] remove legacy manpage Signed-off-by: Steven Armstrong --- doc/man/cdist-manifest-run-all.text | 32 ----------------------------- 1 file changed, 32 deletions(-) delete mode 100644 doc/man/cdist-manifest-run-all.text diff --git a/doc/man/cdist-manifest-run-all.text b/doc/man/cdist-manifest-run-all.text deleted file mode 100644 index 717089ad..00000000 --- a/doc/man/cdist-manifest-run-all.text +++ /dev/null @@ -1,32 +0,0 @@ -cdist-manifest-run-all(1) -========================== -Nico Schottelius - - -NAME ----- -cdist-manifest-run-all - Run manifests of all created types - - -SYNOPSIS --------- -cdist-manifest-run-all HOSTNAME - - -DESCRIPTION ------------ -cdist-manifest-run-all iterates over every existing object and -executes the manifest of its type. - - -SEE ALSO --------- -- cdist(7) -- cdist-deploy-to(1) -- cdist-manifest-run-init(1) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). From 7ff24008308faf57bc1638c68e967230c918c4cc Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 15:43:37 +0200 Subject: [PATCH 0428/5465] remove legacy manpage Signed-off-by: Steven Armstrong --- doc/man/cdist-type-explorer-push.text | 32 --------------------------- 1 file changed, 32 deletions(-) delete mode 100644 doc/man/cdist-type-explorer-push.text diff --git a/doc/man/cdist-type-explorer-push.text b/doc/man/cdist-type-explorer-push.text deleted file mode 100644 index e32f10a4..00000000 --- a/doc/man/cdist-type-explorer-push.text +++ /dev/null @@ -1,32 +0,0 @@ -cdist-type-explorer-push(1) -=========================== -Nico Schottelius -Steven Armstrong - - -NAME ----- -cdist-type-explorer-push - Transfer type explorers to the target host - - -SYNOPSIS --------- -cdist-type-explorer-push HOSTNAME TYPE - - -DESCRIPTION ------------ -Transfers the explorers of the given type to the target host. - - -SEE ALSO --------- -- cdist(7) -- cdist-object-run(1) -- cdist-type(1) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). From 7c920231b7ac1de4b3aead46b0ed288c29b0721f Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 16:11:38 +0200 Subject: [PATCH 0429/5465] update stages man page to reflect new situation Signed-off-by: Steven Armstrong --- doc/man/cdist-stages.text | 60 ++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/doc/man/cdist-stages.text b/doc/man/cdist-stages.text index fbd60cea..465a7fc8 100644 --- a/doc/man/cdist-stages.text +++ b/doc/man/cdist-stages.text @@ -1,6 +1,7 @@ cdist-stages(7) =============== Nico Schottelius +Steven Armstrong NAME @@ -12,8 +13,8 @@ DESCRIPTION ----------- Starting the execution of deployment with cdist-deploy-to(1), cdist passes through different stages, each can be triggered and debugged on its own. -Reading the source of the cdist-deploy-to executable shous the scripts -responsible for each stage. +Reading the source of the cdist-deploy-to and cdist-object-run-all executables +shows the scripts responsible for each stage. STAGE 0: INTERNAL PREPERATION @@ -23,7 +24,7 @@ to contain cdist binaries and creates a clean environment for the configuration run. Related manpages: - - cdist-bin-transfer(1) + - cdist-bin-transfer(1) FIXME: does not exist STAGE 1: TARGET INFORMATION RETRIEVAL @@ -34,6 +35,8 @@ explorers are copied back into the local cache. The results can be used by manifests and types. Related manpages: + - cdist-explorer-run-global(1) + - cdist-remote-explorer-run(1) - cdist-explorer(7) @@ -46,16 +49,27 @@ no conflicts may occur, i.e. no object of the same type with the same id may be created. Related manpages: - - cdist-manifest(7) - - cdist-manifest-run(1) - cdist-manifest-run-init(1) + - cdist-manifest-run(1) + - cdist-manifest(7) -STAGE 3: EXECUTION OF OBJECTS ------------------------------ -Each object in the cconfig database is run through the following stages: -- +STAGE 3: OBJECT INFORMATION RETRIEVAL +------------------------------------- +Every object is checked whether its type has explorers and if so, these are +transfered to the target host and executed. The results are transfered back +and can be used in the following stages to decide what changes need to made +on the target to implement the desired state. +Related manpages: + - cdist-object-explorer-run(1) + - cdist-remote-explorer-run(1) + - cdist-type(7) + - cdist-explorer(7) + + +STAGE 4: RUN THE OBJECT MANIFEST +-------------------------------- Every object is checked whether its type has a manifest file. If the type has a manifest file and it is executable, it will be executed. The manifest script may generate and change the created objects. In other words, one type can reuse @@ -69,12 +83,12 @@ may occur during the merge. A conflict would mean that two different objects try to create the same object, which indicates a broken configuration. Related manpages: + - cdist-object-manifest-run(1) - cdist-manifest-run(1) - - cdist-manifest-run-all(1) - cdist-type(7) -STAGE 4: CODE GENERATION +STAGE 5: CODE GENERATION ------------------------ In this stage for every created objects its type is checked whether it has a gencode script. If the type has a gencode script and it is executable it will @@ -83,19 +97,27 @@ on stdout. If the gencode executable fails, it must print diagnostic messages on stderr and exit non-zero. Related manpages: - - cdist-gencode(1) - - cdist-gencode-all(1) + - cdist-object-gencode-run(1) + - cdist-object-gencode(1) - cdist-type(7) -STAGE 5: CODE EXECUTION +STAGE 6: CODE EXECUTION ----------------------- -The resulting code from the previous stage is transferred to the target host -and executed there to apply the configuration changes, +For every object the resulting code from the previous stage is transferred to +the target host and executed there to apply the configuration changes. Related manpages: - - cdist-exec-run(1) - - cdist-exec-transfer(1) + - cdist-object-code-run(1) + - cdist-code-run(1) + + +STAGE 7: CACHE +-------------- +The cache stores the information from the current run for later use. + +Related manpages: + - cdist-cache(1) SUMMARY @@ -115,5 +137,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is +Copyright \(C) 2010-2011 Nico Schottelius, Steven Armstrong. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). From 44fd2e3c1ce0f59e0c0b0d4de54c4c5a2955b4f9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:23:45 +0200 Subject: [PATCH 0430/5465] :%s/Related manpages/Related documentation/g Signed-off-by: Nico Schottelius --- doc/man/cdist-stages.text | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/man/cdist-stages.text b/doc/man/cdist-stages.text index 465a7fc8..279e1d5f 100644 --- a/doc/man/cdist-stages.text +++ b/doc/man/cdist-stages.text @@ -23,7 +23,7 @@ Before running the user facing stages, cdist prepares the target host to contain cdist binaries and creates a clean environment for the configuration run. -Related manpages: +Related documentation: - cdist-bin-transfer(1) FIXME: does not exist @@ -34,7 +34,7 @@ explorers. Every existing explorer is run on the target and the output of all explorers are copied back into the local cache. The results can be used by manifests and types. -Related manpages: +Related documentation: - cdist-explorer-run-global(1) - cdist-remote-explorer-run(1) - cdist-explorer(7) @@ -48,7 +48,7 @@ the objects as defined in the manifest for the specific host. In this stage, no conflicts may occur, i.e. no object of the same type with the same id may be created. -Related manpages: +Related documentation: - cdist-manifest-run-init(1) - cdist-manifest-run(1) - cdist-manifest(7) @@ -61,7 +61,7 @@ transfered to the target host and executed. The results are transfered back and can be used in the following stages to decide what changes need to made on the target to implement the desired state. -Related manpages: +Related documentation: - cdist-object-explorer-run(1) - cdist-remote-explorer-run(1) - cdist-type(7) @@ -82,7 +82,7 @@ The newly created objects are merged back into the existing tree. No conflicts may occur during the merge. A conflict would mean that two different objects try to create the same object, which indicates a broken configuration. -Related manpages: +Related documentation: - cdist-object-manifest-run(1) - cdist-manifest-run(1) - cdist-type(7) @@ -96,7 +96,7 @@ be executed. This executable should create code to be executed on the target on stdout. If the gencode executable fails, it must print diagnostic messages on stderr and exit non-zero. -Related manpages: +Related documentation: - cdist-object-gencode-run(1) - cdist-object-gencode(1) - cdist-type(7) @@ -107,7 +107,7 @@ 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. -Related manpages: +Related documentation: - cdist-object-code-run(1) - cdist-code-run(1) @@ -116,7 +116,7 @@ STAGE 7: CACHE -------------- The cache stores the information from the current run for later use. -Related manpages: +Related documentation: - cdist-cache(1) From e2e4936103379d6e25de2198a633b6bc8ae9bfca Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:24:13 +0200 Subject: [PATCH 0431/5465] -FIXME in doc/man/cdist-stages.text Signed-off-by: Nico Schottelius --- doc/man/cdist-stages.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/cdist-stages.text b/doc/man/cdist-stages.text index 279e1d5f..6ac6efe2 100644 --- a/doc/man/cdist-stages.text +++ b/doc/man/cdist-stages.text @@ -24,7 +24,7 @@ to contain cdist binaries and creates a clean environment for the configuration run. Related documentation: - - cdist-bin-transfer(1) FIXME: does not exist + - Source of cdist-deploy-to STAGE 1: TARGET INFORMATION RETRIEVAL From 3fae65539e58b02cbad9bc3e901f65098bad6772 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 16:25:26 +0200 Subject: [PATCH 0432/5465] remove legacy man pages Signed-off-by: Steven Armstrong --- build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 709c1c55..335bbe9c 100755 --- a/build.sh +++ b/build.sh @@ -70,12 +70,11 @@ case "$1" in ;; man1) - for man in cdist-code-run.text cdist-code-run-all.text cdist-config.text \ + for man in cdist-code-run.text cdist-config.text \ cdist-dir.text cdist-env.text cdist-explorer-run-global.text \ cdist-deploy-to.text cdist-explorer.text cdist-manifest.text \ cdist-manifest-run.text cdist-manifest-run-init.text \ - cdist-manifest-run-all.text cdist-object-explorer-all.text \ - cdist-object-gencode.text cdist-object-gencode-all.text \ + cdist-object-gencode.text \ cdist-remote-explorer-run.text cdist-run-remote.text \ cdist-type-build-emulation.text cdist-type-emulator.text \ cdist-type-template.text From ad7a9f82f77526a2c52b30447686ecf6391cd6e3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:27:57 +0200 Subject: [PATCH 0433/5465] __cdist_objects_created == local output Signed-off-by: Nico Schottelius --- bin/cdist-config | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 19c127d4..1882d1bb 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -122,6 +122,8 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") : ${__cdist_out_type_dir:=$__cdist_out_dir/$__cdist_name_type} : ${__cdist_out_type_bin_dir:=$__cdist_out_dir/$__cdist_name_type_bin} +: ${__cdist_objects_created:=$__cdist_out_object_dir/$__cdist_name_objects_created} + ################################################################################ # Remote base # @@ -139,10 +141,6 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") : ${__cdist_remote_out_explorer_dir:=$__cdist_remote_out_dir/$__cdist_name_explorer} : ${__cdist_remote_out_object_dir:=$__cdist_remote_out_dir/$__cdist_name_object} -################################################################################ -# Global internal variables -# -: ${__cdist_objects_created:=$__cdist_out_object_dir/$__cdist_name_objects_created} ################################################################################ # Internal functions From 6be9d02e6a8f588d4b40ef0fdf01743d8f9736cc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:28:59 +0200 Subject: [PATCH 0434/5465] consistency: function {} begin on next line Signed-off-by: Nico Schottelius --- bin/cdist-config | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 1882d1bb..531f709c 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -185,11 +185,13 @@ __cdist_init_deploy() ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir" } -__cdist_new_objects_created() { +__cdist_new_objects_created() +{ touch "$__cdist_tmp_dir/object_created" } -__cdist_has_new_objects() { +__cdist_has_new_objects() +{ touch "$__cdist_tmp_dir/object_created" } @@ -267,7 +269,6 @@ __cdist_object_type_explorer_dir() echo "$(__cdist_object_dir "$1")/${__cdist_name_explorer}" } - ################################################################################ # Remote # From 0422eda599f51916c9c7d3cbd213b818d00c62e0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:33:09 +0200 Subject: [PATCH 0435/5465] WARNING: WHITESPACE-NAZI Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 138f7714..e63d3dfb 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -17,5 +17,3 @@ Types to be written/extended: - regexp replace (can probably cover all?) -> aka sed. - __cron - - From a5586aecff4ef3a37e41da1fe86b772027130329 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 16:36:10 +0200 Subject: [PATCH 0436/5465] changelog++ Signed-off-by: Steven Armstrong --- doc/changelog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index 7faf789b..20c59b93 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,7 +1,11 @@ 1.5.0: * Add cache functionality * New type __process - * Restructured execution: Run whole object at once (REPHRASE) (Steven Armstrong) + * Restructured execution: (Steven Armstrong) + Process each object as a whole, resolve dependencies and ensure + correct execution order. + * Documentation: Rewrite stages docs + * Documentation: Remove legacy man pages 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) From ebbacf48732ee2375a7fe8704985162ce121ed87 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 16:41:38 +0200 Subject: [PATCH 0437/5465] remove unused functions Signed-off-by: Steven Armstrong --- bin/cdist-config | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 531f709c..eb2a8e90 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -185,16 +185,6 @@ __cdist_init_deploy() ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir" } -__cdist_new_objects_created() -{ - touch "$__cdist_tmp_dir/object_created" -} - -__cdist_has_new_objects() -{ - touch "$__cdist_tmp_dir/object_created" -} - ################################################################################ # Object # From 5024c4bf580141e049bc30e825c660306295eeb5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:45:16 +0200 Subject: [PATCH 0438/5465] more changes, quote author correctly Signed-off-by: Nico Schottelius --- doc/changelog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/changelog b/doc/changelog index 20c59b93..5e0e2314 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,11 +1,11 @@ 1.5.0: - * Add cache functionality + * Add basic cache functionality * New type __process * Restructured execution: (Steven Armstrong) Process each object as a whole, resolve dependencies and ensure correct execution order. - * Documentation: Rewrite stages docs - * Documentation: Remove legacy man pages + * Documentation: Rewrite stages docs (Steven Armstrong) + * Documentation: Remove legacy man pages (Steven Armstrong) 1.4.1: 2011-03-25 * New type __key_value (Steven Armstrong) From 1d057560766e2377e1aa4fa914f0a1d368c321f9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:47:02 +0200 Subject: [PATCH 0439/5465] release 1.5.0 Signed-off-by: Nico Schottelius --- README | 3 ++- bin/cdist-config | 2 +- doc/changelog | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README b/README index c498e3b8..a62ac61c 100644 --- a/README +++ b/README @@ -127,10 +127,11 @@ how to use cdist. There are at least the following branches available: * master: the development branch - * 1.4: Support for redefiniton of objects (if equal) + * 1.5: Focus on object orientation instead of global stage orientation Old versions: + * 1.4: Support for redefiniton of objects (if equal) * 1.3: Support for local and remote code execution (current stable) * 1.2: Dependencies supported * 1.1: __file to __file, __directory, __link migration diff --git a/bin/cdist-config b/bin/cdist-config index eb2a8e90..ae84ced4 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.5.0pre" +__cdist_version="1.5.0" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index 5e0e2314..d3091fd7 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.5.0: +1.5.0: 2011-03-29 * Add basic cache functionality * New type __process * Restructured execution: (Steven Armstrong) From f64c7988de1ecdc1af61be97bc74a47b04e09e88 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 16:52:27 +0200 Subject: [PATCH 0440/5465] document __self Signed-off-by: Steven Armstrong --- doc/man/cdist-reference.text.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index f6840880..48954b8e 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -166,6 +166,9 @@ __object:: __object_id:: The type unique object id. Available for: type manifest, type explorer, type codegen +__self:: + The full qualified name of the current object. + Available for: type manifest, type explorer, type codegen __target_host:: The host we are deploying to. Available for: initial manifest, type manifest, type codegen From a891a951e71736136de2c88855ff0252b11d7fed Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:49:05 +0200 Subject: [PATCH 0441/5465] cleanup todos Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 11 +++++++++++ doc/dev/todo/niconext | 12 +----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index a591038c..7e6a44d9 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -21,3 +21,14 @@ DOCUMENTATION -------------- - asciidoc interprets __, which we use for variables names -> seek through docs and replace with \_\_! +- check all all internal variables are prefixed with __cdist + +Cache: + - add example how to use + - export variable $__cache + -> for current host + -> add function to cdist-config, import from cdist-cache + + +remove --preseed from package_apt and add debconf_set_selection or similar + -> much cleaner! diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index be66a33d..29229d64 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,11 +1 @@ -/ prefix all internal variables with __cdist! -> Nico - -Cache: - - add example how to use - - export variable $__cache - -> for current host - -> add function to cdist-config, import from cdist-cache - - -remove --preseed from package_apt and add debconf_set_selection or similar - -> much cleaner! +Release 1.5.0 correctly :-) From 1ca8aec2066a19e1ec58e59a80a84420f56e81bb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:49:49 +0200 Subject: [PATCH 0442/5465] update web/readme Signed-off-by: Nico Schottelius --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index a62ac61c..3a4b2051 100644 --- a/README +++ b/README @@ -144,7 +144,8 @@ may vanish at any point. To select a specific branch use git checkout -b origin/ # Stay on a specific version - git checkout -b 1.4 origin/1.4 + version=1.5 + git checkout -b $version origin/$version ### Mirrors From dde2f370546e03a1e2a85b11162c20aadd80b87f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:51:11 +0200 Subject: [PATCH 0443/5465] make build.sh die on error Signed-off-by: Nico Schottelius --- build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sh b/build.sh index 335bbe9c..52b3466e 100755 --- a/build.sh +++ b/build.sh @@ -23,6 +23,9 @@ # Pull a directory from a target, both sides have the same name (i.e. explorers) # +# exit on any error +set -e + # Manpage and HTML A2XM="a2x -f manpage --no-xmllint" A2XH="a2x -f xhtml --no-xmllint" From 9a56c5122c86649e6665516c77d82f7668523378 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:52:53 +0200 Subject: [PATCH 0444/5465] +release target in build.sh Signed-off-by: Nico Schottelius --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index 52b3466e..1d02256f 100755 --- a/build.sh +++ b/build.sh @@ -99,6 +99,10 @@ case "$1" in ${MANDIR}/cdist-reference.text.sh ;; + release) + "$0" clean && "$0" man && "$0" web + ;; + web) cp README ${WEBDIR}/${WEBPAGE} rm -rf ${WEBDIR}/${WEBBASE}/man && mkdir ${WEBDIR}/${WEBBASE}/man From bcbabe885b6c8ecfbe0cc346ece8034e658a2374 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:54:11 +0200 Subject: [PATCH 0445/5465] authors on one line Signed-off-by: Nico Schottelius --- doc/man/cdist-stages.text | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/man/cdist-stages.text b/doc/man/cdist-stages.text index 6ac6efe2..cbd541fe 100644 --- a/doc/man/cdist-stages.text +++ b/doc/man/cdist-stages.text @@ -1,7 +1,6 @@ cdist-stages(7) =============== -Nico Schottelius -Steven Armstrong +Nico Schottelius , Steven Armstrong NAME From 022e255d7a0bb497e19cf9f5c48e723c3a0e4f6b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 29 Mar 2011 16:55:40 +0200 Subject: [PATCH 0446/5465] less line breaks in asciidoc Signed-off-by: Nico Schottelius --- doc/man/cdist-object-code-run.text | 3 +-- doc/man/cdist-object-explorer-run.text | 3 +-- doc/man/cdist-object-gencode-run.text | 3 +-- doc/man/cdist-object-push.text | 3 +-- doc/man/cdist-object-run-all.text | 3 +-- doc/man/cdist-object-run.text | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/doc/man/cdist-object-code-run.text b/doc/man/cdist-object-code-run.text index 4d19b5eb..c662d4c3 100644 --- a/doc/man/cdist-object-code-run.text +++ b/doc/man/cdist-object-code-run.text @@ -1,7 +1,6 @@ cdist-object-code-run(1) ======================== -Nico Schottelius -Steven Armstrong +Nico Schottelius , Steven Armstrong NAME diff --git a/doc/man/cdist-object-explorer-run.text b/doc/man/cdist-object-explorer-run.text index a94047c3..a1c87cd6 100644 --- a/doc/man/cdist-object-explorer-run.text +++ b/doc/man/cdist-object-explorer-run.text @@ -1,7 +1,6 @@ cdist-object-explorer-run(1) ============================ -Nico Schottelius -Steven Armstrong +Nico Schottelius , Steven Armstrong NAME diff --git a/doc/man/cdist-object-gencode-run.text b/doc/man/cdist-object-gencode-run.text index d69d1787..fc93ebfd 100644 --- a/doc/man/cdist-object-gencode-run.text +++ b/doc/man/cdist-object-gencode-run.text @@ -1,7 +1,6 @@ cdist-object-gencode-run(1) =========================== -Nico Schottelius -Steven Armstrong +Nico Schottelius , Steven Armstrong NAME diff --git a/doc/man/cdist-object-push.text b/doc/man/cdist-object-push.text index 69648a4d..168f5190 100644 --- a/doc/man/cdist-object-push.text +++ b/doc/man/cdist-object-push.text @@ -1,7 +1,6 @@ cdist-object-push(1) ==================== -Nico Schottelius -Steven Armstrong +Nico Schottelius , Steven Armstrong NAME diff --git a/doc/man/cdist-object-run-all.text b/doc/man/cdist-object-run-all.text index a3a8d56b..2b27347c 100644 --- a/doc/man/cdist-object-run-all.text +++ b/doc/man/cdist-object-run-all.text @@ -1,7 +1,6 @@ cdist-object-run-all(1) ======================= -Nico Schottelius -Steven Armstrong +Nico Schottelius , Steven Armstrong NAME diff --git a/doc/man/cdist-object-run.text b/doc/man/cdist-object-run.text index b527c0e6..b91e50ca 100644 --- a/doc/man/cdist-object-run.text +++ b/doc/man/cdist-object-run.text @@ -1,7 +1,6 @@ cdist-object-run(1) =================== -Nico Schottelius -Steven Armstrong +Nico Schottelius , Steven Armstrong NAME From d27afe352860c366b7c4decddde2a516a4444d35 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 17:24:40 +0200 Subject: [PATCH 0447/5465] move manpages Signed-off-by: Steven Armstrong --- doc/man/{ => man1}/cdist-cache.text | 0 doc/man/{ => man1}/cdist-code-run.text | 0 doc/man/{ => man1}/cdist-config.text | 0 doc/man/{ => man1}/cdist-deploy-to.text | 0 doc/man/{ => man1}/cdist-dir.text | 0 doc/man/{ => man1}/cdist-env.text | 0 doc/man/{ => man1}/cdist-explorer-run-global.text | 0 doc/man/{ => man1}/cdist-manifest-run-init.text | 0 doc/man/{ => man1}/cdist-manifest-run.text | 0 doc/man/{ => man1}/cdist-object-code-run.text | 0 doc/man/{ => man1}/cdist-object-explorer-run.text | 0 doc/man/{ => man1}/cdist-object-gencode-run.text | 0 doc/man/{ => man1}/cdist-object-gencode.text | 0 doc/man/{ => man1}/cdist-object-manifest-run.text | 0 doc/man/{ => man1}/cdist-object-push.text | 0 doc/man/{ => man1}/cdist-object-run-all.text | 0 doc/man/{ => man1}/cdist-object-run.text | 0 doc/man/{ => man1}/cdist-quickstart.text | 0 doc/man/{ => man1}/cdist-remote-explorer-run.text | 0 doc/man/{ => man1}/cdist-run-remote.text | 0 doc/man/{ => man1}/cdist-type-build-emulation.text | 0 doc/man/{ => man1}/cdist-type-emulator.text | 0 doc/man/{ => man1}/cdist-type-template.text | 0 doc/man/{ => man7}/cdist-best-practice.text | 0 doc/man/{ => man7}/cdist-explorer.text | 0 doc/man/{ => man7}/cdist-hacker.text | 0 doc/man/{ => man7}/cdist-manifest.text | 0 doc/man/{ => man7}/cdist-stages.text | 0 doc/man/{ => man7}/cdist-type.text | 0 doc/man/{ => man7}/cdist.text | 0 30 files changed, 0 insertions(+), 0 deletions(-) rename doc/man/{ => man1}/cdist-cache.text (100%) rename doc/man/{ => man1}/cdist-code-run.text (100%) rename doc/man/{ => man1}/cdist-config.text (100%) rename doc/man/{ => man1}/cdist-deploy-to.text (100%) rename doc/man/{ => man1}/cdist-dir.text (100%) rename doc/man/{ => man1}/cdist-env.text (100%) rename doc/man/{ => man1}/cdist-explorer-run-global.text (100%) rename doc/man/{ => man1}/cdist-manifest-run-init.text (100%) rename doc/man/{ => man1}/cdist-manifest-run.text (100%) rename doc/man/{ => man1}/cdist-object-code-run.text (100%) rename doc/man/{ => man1}/cdist-object-explorer-run.text (100%) rename doc/man/{ => man1}/cdist-object-gencode-run.text (100%) rename doc/man/{ => man1}/cdist-object-gencode.text (100%) rename doc/man/{ => man1}/cdist-object-manifest-run.text (100%) rename doc/man/{ => man1}/cdist-object-push.text (100%) rename doc/man/{ => man1}/cdist-object-run-all.text (100%) rename doc/man/{ => man1}/cdist-object-run.text (100%) rename doc/man/{ => man1}/cdist-quickstart.text (100%) rename doc/man/{ => man1}/cdist-remote-explorer-run.text (100%) rename doc/man/{ => man1}/cdist-run-remote.text (100%) rename doc/man/{ => man1}/cdist-type-build-emulation.text (100%) rename doc/man/{ => man1}/cdist-type-emulator.text (100%) rename doc/man/{ => man1}/cdist-type-template.text (100%) rename doc/man/{ => man7}/cdist-best-practice.text (100%) rename doc/man/{ => man7}/cdist-explorer.text (100%) rename doc/man/{ => man7}/cdist-hacker.text (100%) rename doc/man/{ => man7}/cdist-manifest.text (100%) rename doc/man/{ => man7}/cdist-stages.text (100%) rename doc/man/{ => man7}/cdist-type.text (100%) rename doc/man/{ => man7}/cdist.text (100%) diff --git a/doc/man/cdist-cache.text b/doc/man/man1/cdist-cache.text similarity index 100% rename from doc/man/cdist-cache.text rename to doc/man/man1/cdist-cache.text diff --git a/doc/man/cdist-code-run.text b/doc/man/man1/cdist-code-run.text similarity index 100% rename from doc/man/cdist-code-run.text rename to doc/man/man1/cdist-code-run.text diff --git a/doc/man/cdist-config.text b/doc/man/man1/cdist-config.text similarity index 100% rename from doc/man/cdist-config.text rename to doc/man/man1/cdist-config.text diff --git a/doc/man/cdist-deploy-to.text b/doc/man/man1/cdist-deploy-to.text similarity index 100% rename from doc/man/cdist-deploy-to.text rename to doc/man/man1/cdist-deploy-to.text diff --git a/doc/man/cdist-dir.text b/doc/man/man1/cdist-dir.text similarity index 100% rename from doc/man/cdist-dir.text rename to doc/man/man1/cdist-dir.text diff --git a/doc/man/cdist-env.text b/doc/man/man1/cdist-env.text similarity index 100% rename from doc/man/cdist-env.text rename to doc/man/man1/cdist-env.text diff --git a/doc/man/cdist-explorer-run-global.text b/doc/man/man1/cdist-explorer-run-global.text similarity index 100% rename from doc/man/cdist-explorer-run-global.text rename to doc/man/man1/cdist-explorer-run-global.text diff --git a/doc/man/cdist-manifest-run-init.text b/doc/man/man1/cdist-manifest-run-init.text similarity index 100% rename from doc/man/cdist-manifest-run-init.text rename to doc/man/man1/cdist-manifest-run-init.text diff --git a/doc/man/cdist-manifest-run.text b/doc/man/man1/cdist-manifest-run.text similarity index 100% rename from doc/man/cdist-manifest-run.text rename to doc/man/man1/cdist-manifest-run.text diff --git a/doc/man/cdist-object-code-run.text b/doc/man/man1/cdist-object-code-run.text similarity index 100% rename from doc/man/cdist-object-code-run.text rename to doc/man/man1/cdist-object-code-run.text diff --git a/doc/man/cdist-object-explorer-run.text b/doc/man/man1/cdist-object-explorer-run.text similarity index 100% rename from doc/man/cdist-object-explorer-run.text rename to doc/man/man1/cdist-object-explorer-run.text diff --git a/doc/man/cdist-object-gencode-run.text b/doc/man/man1/cdist-object-gencode-run.text similarity index 100% rename from doc/man/cdist-object-gencode-run.text rename to doc/man/man1/cdist-object-gencode-run.text diff --git a/doc/man/cdist-object-gencode.text b/doc/man/man1/cdist-object-gencode.text similarity index 100% rename from doc/man/cdist-object-gencode.text rename to doc/man/man1/cdist-object-gencode.text diff --git a/doc/man/cdist-object-manifest-run.text b/doc/man/man1/cdist-object-manifest-run.text similarity index 100% rename from doc/man/cdist-object-manifest-run.text rename to doc/man/man1/cdist-object-manifest-run.text diff --git a/doc/man/cdist-object-push.text b/doc/man/man1/cdist-object-push.text similarity index 100% rename from doc/man/cdist-object-push.text rename to doc/man/man1/cdist-object-push.text diff --git a/doc/man/cdist-object-run-all.text b/doc/man/man1/cdist-object-run-all.text similarity index 100% rename from doc/man/cdist-object-run-all.text rename to doc/man/man1/cdist-object-run-all.text diff --git a/doc/man/cdist-object-run.text b/doc/man/man1/cdist-object-run.text similarity index 100% rename from doc/man/cdist-object-run.text rename to doc/man/man1/cdist-object-run.text diff --git a/doc/man/cdist-quickstart.text b/doc/man/man1/cdist-quickstart.text similarity index 100% rename from doc/man/cdist-quickstart.text rename to doc/man/man1/cdist-quickstart.text diff --git a/doc/man/cdist-remote-explorer-run.text b/doc/man/man1/cdist-remote-explorer-run.text similarity index 100% rename from doc/man/cdist-remote-explorer-run.text rename to doc/man/man1/cdist-remote-explorer-run.text diff --git a/doc/man/cdist-run-remote.text b/doc/man/man1/cdist-run-remote.text similarity index 100% rename from doc/man/cdist-run-remote.text rename to doc/man/man1/cdist-run-remote.text diff --git a/doc/man/cdist-type-build-emulation.text b/doc/man/man1/cdist-type-build-emulation.text similarity index 100% rename from doc/man/cdist-type-build-emulation.text rename to doc/man/man1/cdist-type-build-emulation.text diff --git a/doc/man/cdist-type-emulator.text b/doc/man/man1/cdist-type-emulator.text similarity index 100% rename from doc/man/cdist-type-emulator.text rename to doc/man/man1/cdist-type-emulator.text diff --git a/doc/man/cdist-type-template.text b/doc/man/man1/cdist-type-template.text similarity index 100% rename from doc/man/cdist-type-template.text rename to doc/man/man1/cdist-type-template.text diff --git a/doc/man/cdist-best-practice.text b/doc/man/man7/cdist-best-practice.text similarity index 100% rename from doc/man/cdist-best-practice.text rename to doc/man/man7/cdist-best-practice.text diff --git a/doc/man/cdist-explorer.text b/doc/man/man7/cdist-explorer.text similarity index 100% rename from doc/man/cdist-explorer.text rename to doc/man/man7/cdist-explorer.text diff --git a/doc/man/cdist-hacker.text b/doc/man/man7/cdist-hacker.text similarity index 100% rename from doc/man/cdist-hacker.text rename to doc/man/man7/cdist-hacker.text diff --git a/doc/man/cdist-manifest.text b/doc/man/man7/cdist-manifest.text similarity index 100% rename from doc/man/cdist-manifest.text rename to doc/man/man7/cdist-manifest.text diff --git a/doc/man/cdist-stages.text b/doc/man/man7/cdist-stages.text similarity index 100% rename from doc/man/cdist-stages.text rename to doc/man/man7/cdist-stages.text diff --git a/doc/man/cdist-type.text b/doc/man/man7/cdist-type.text similarity index 100% rename from doc/man/cdist-type.text rename to doc/man/man7/cdist-type.text diff --git a/doc/man/cdist.text b/doc/man/man7/cdist.text similarity index 100% rename from doc/man/cdist.text rename to doc/man/man7/cdist.text From ac274802dee55104a92ea4bcda8dfe6e0f6d8c94 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 18:12:19 +0200 Subject: [PATCH 0448/5465] update build.sh to work with new man source layout Signed-off-by: Steven Armstrong --- build.sh | 44 ++++++++------------------------------------ 1 file changed, 8 insertions(+), 36 deletions(-) diff --git a/build.sh b/build.sh index 1d02256f..a6a0e7b0 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ # # exit on any error -set -e +#set -e # Manpage and HTML A2XM="a2x -f manpage --no-xmllint" @@ -43,11 +43,8 @@ MAN7DSTDIR=${MANDIR}/man7 case "$1" in man) set -e - "$0" mandirs "$0" mangen "$0" mantype - "$0" man1 - "$0" man7 "$0" manbuild ;; @@ -57,12 +54,6 @@ case "$1" in $A2XM "$src" $A2XH "$src" done - wait - ;; - - mandirs) - # Create destination directories - mkdir -p "${MAN1DSTDIR}" "${MAN7DSTDIR}" ;; mantype) @@ -72,29 +63,6 @@ case "$1" in done ;; - man1) - for man in cdist-code-run.text cdist-config.text \ - cdist-dir.text cdist-env.text cdist-explorer-run-global.text \ - cdist-deploy-to.text cdist-explorer.text cdist-manifest.text \ - cdist-manifest-run.text cdist-manifest-run-init.text \ - cdist-object-gencode.text \ - cdist-remote-explorer-run.text cdist-run-remote.text \ - cdist-type-build-emulation.text cdist-type-emulator.text \ - cdist-type-template.text - do - ln -sf ../$man ${MAN1DSTDIR} - done - ;; - - man7) - for man in cdist.text cdist-best-practice.text cdist-hacker.text \ - cdist-quickstart.text cdist-reference.text cdist-stages.text \ - cdist-type.text cdist-cache.text - do - ln -sf ../$man ${MAN7DSTDIR} - done - ;; - mangen) ${MANDIR}/cdist-reference.text.sh ;; @@ -118,8 +86,13 @@ case "$1" in ;; clean) - rm -rf "$MAN1DSTDIR" "$MAN7DSTDIR" - rm -f ${MANDIR}/cdist-reference.text + rm -f ${MANDIR}/cdist-reference.text + find "${MANDIR}" -mindepth 2 -type l \ + -o -name "*.1" \ + -o -name "*.7" \ + -o -name "*.html" \ + -o -name "*.xml" \ + | xargs rm -f ;; *) @@ -129,7 +102,6 @@ case "$1" in echo 'Here are the possible targets:' echo '' echo ' man: Build manpages (requires Asciidoc)' - echo ' manhtml: Build html-manpages (requires Asciidoc)' echo ' clean: Remove build stuff' echo '' echo '' From fb426bd412ed1e0f1843a0bcad9dde939310e948 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 20:10:40 +0200 Subject: [PATCH 0449/5465] __directory type does not have a destination parameter Signed-off-by: Steven Armstrong --- conf/type/__directory/explorer/exists | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/conf/type/__directory/explorer/exists b/conf/type/__directory/explorer/exists index b0be82fc..f8b85671 100755 --- a/conf/type/__directory/explorer/exists +++ b/conf/type/__directory/explorer/exists @@ -21,11 +21,7 @@ # Check whether file exists or not # -if [ -f "$__object/parameter/destination" ]; then - destination="$(cat "$__object/parameter/destination")" -else - destination="/$__object_id" -fi +destination="/$__object_id" if [ -e "$destination" ]; then echo yes From 2345d6509bc8ba2000c4d88d27f6976c04345325 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 21:20:07 +0200 Subject: [PATCH 0450/5465] add missing function call to __cdist_usage Signed-off-by: Steven Armstrong --- bin/cdist-type-emulator | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index b3ed1f3d..d0464533 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -25,7 +25,7 @@ # . cdist-config -set -eu +set -u ################################################################################ # Prepare object and type @@ -137,7 +137,7 @@ cd "$__cdist_parameter_dir" for parameter in $(ls -1); do is_valid=$(grep "^$parameter\$" "$__cdist_tmp_file") - [ "$is_valid" ] || "Unknown parameter $parameter" + [ "$is_valid" ] || __cdist_usage "Unknown parameter $parameter" done ################################################################################ From fe159eccb2946a85c1b0654a5258c3f45f5c31d5 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 21:47:05 +0200 Subject: [PATCH 0451/5465] prefix all variables with __cdist Signed-off-by: Steven Armstrong --- bin/cdist-code-run | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index e969d942..db1a2378 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -25,22 +25,22 @@ [ $# -eq 2 ] || __cdist_usage " " set -ue -object="$1"; shift +__cdist_object="$1"; shift __cdist_gencode_type="$1"; shift -if [ ! -d "$(__cdist_object_dir "$object")" ]; then - __cdist_exit_err "Object $object is missing." +if [ ! -d "$(__cdist_object_dir "$__cdist_object")" ]; then + __cdist_exit_err "Object $__cdist_object is missing." fi -code="$(__cdist_object_code "$object")-${__cdist_gencode_type}" +code="$(__cdist_object_code "$__cdist_object")-${__cdist_gencode_type}" -echo "Checking code-${__cdist_gencode_type} for $object ..." +echo "Checking code-${__cdist_gencode_type} for $__cdist_object ..." if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then - echo "Executing code-${__cdist_gencode_type} for $object ..." + echo "Executing code-${__cdist_gencode_type} for $__cdist_object ..." "$code" else __cdist_exit_err "$code exists, but is not executable." @@ -49,5 +49,5 @@ if [ -e "$code" ]; then __cdist_exit_err "$code exists, but is not a file." fi else - __cdist_exit_err "Missing code for ${object}." + __cdist_exit_err "Missing code for ${__cdist_object}." fi From 878f7d18ce295126ae4362d368e3a4bc37512fb2 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 21:49:06 +0200 Subject: [PATCH 0452/5465] move export of __cdist_out_object_dir to cdist-run-remote Signed-off-by: Steven Armstrong --- bin/cdist-object-code-run | 1 - bin/cdist-run-remote | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/cdist-object-code-run b/bin/cdist-object-code-run index d0722788..97cb58ac 100755 --- a/bin/cdist-object-code-run +++ b/bin/cdist-object-code-run @@ -36,6 +36,5 @@ cdist-code-run "$__cdist_object" "${__cdist_name_gencode_local}" \ # Code remote cdist-run-remote "$__cdist_target_host" \ - "export __cdist_out_object_dir=\"$__cdist_remote_out_object_dir\";" \ "cdist-code-run" "$__cdist_object" "${__cdist_name_gencode_remote}" \ || __cdist_exit_err "Remote code failed for $__cdist_object" diff --git a/bin/cdist-run-remote b/bin/cdist-run-remote index 93cf9062..4a4452a2 100755 --- a/bin/cdist-run-remote +++ b/bin/cdist-run-remote @@ -28,4 +28,6 @@ set -ue __cdist_target_host="$1"; shift ssh "${__cdist_remote_user}@${__cdist_target_host}" \ - "export PATH=\"${__cdist_remote_bin_dir}:\$PATH\";" "$@" + "export PATH=\"${__cdist_remote_bin_dir}:\$PATH\";" \ + "export __cdist_out_object_dir=\"$__cdist_remote_out_object_dir\";" \ + "$@" From 1cfdc6886f7aeaf1f241a4673b0485e04c4a4917 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 21:51:59 +0200 Subject: [PATCH 0453/5465] fail if a requested object is not defined Signed-off-by: Steven Armstrong --- bin/cdist-object-run | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 450ba361..e3fc1629 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -33,6 +33,9 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" +[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Requested object is not defined: $__cdist_object" + # Export to non-core for use in manifest and gencode scripts export $__cdist_name_var_self=$__cdist_object From e7f7a883575ab7ece200771bda3368fdac34c83a Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 22:00:54 +0200 Subject: [PATCH 0454/5465] prefix error messages with Error: Signed-off-by: Steven Armstrong --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index ae84ced4..9cd3a53c 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -160,7 +160,7 @@ __cdist_exec_fail_on_error() __cdist_exit_err() { - echo "$@" >&2 + echo "Error: $@" >&2 exit 1 } From 90448a479de47aa482e2975471e6edf4e51698bb Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 23:52:31 +0200 Subject: [PATCH 0455/5465] only generate man|html pages when necessery; allow the process to be interrupted Signed-off-by: Steven Armstrong --- build.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index a6a0e7b0..7fbb94cc 100755 --- a/build.sh +++ b/build.sh @@ -49,10 +49,24 @@ case "$1" in ;; manbuild) - for src in ${MAN1DSTDIR}/*.text ${MAN7DSTDIR}/*.text; do - echo "Compiling manpage and html for $src" - $A2XM "$src" - $A2XH "$src" + trap abort INT + abort() { + kill 0 + } + for section in 1 7; do + for src in ${MANDIR}/man${section}/*.text; do + manpage="${src%.text}.$section" + if [ ! -f "$manpage" -o "$manpage" -ot "$src" ]; then + echo "Compiling manpage for $src" + setsid $A2XM "$src" + a2x_pids="" + fi + htmlpage="${src%.text}.html" + if [ ! -f "$htmlpage" -o "$htmlpage" -ot "$src" ]; then + echo "Compiling html for $src" + $A2XH "$src" + fi + done done ;; From d85af22ce3a928246fee7f7579fe80d1bd90a958 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 29 Mar 2011 23:57:37 +0200 Subject: [PATCH 0456/5465] remove second author, asciidoc/docbook cant handle it Signed-off-by: Steven Armstrong --- doc/man/man1/cdist-object-code-run.text | 2 +- doc/man/man1/cdist-object-explorer-run.text | 2 +- doc/man/man1/cdist-object-gencode-run.text | 2 +- doc/man/man1/cdist-object-manifest-run.text | 1 - doc/man/man1/cdist-object-push.text | 2 +- doc/man/man1/cdist-object-run-all.text | 2 +- doc/man/man1/cdist-object-run.text | 2 +- doc/man/man7/cdist-stages.text | 5 ++--- 8 files changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/man/man1/cdist-object-code-run.text b/doc/man/man1/cdist-object-code-run.text index c662d4c3..a055fc97 100644 --- a/doc/man/man1/cdist-object-code-run.text +++ b/doc/man/man1/cdist-object-code-run.text @@ -1,6 +1,6 @@ cdist-object-code-run(1) ======================== -Nico Schottelius , Steven Armstrong +Nico Schottelius NAME diff --git a/doc/man/man1/cdist-object-explorer-run.text b/doc/man/man1/cdist-object-explorer-run.text index a1c87cd6..a791681e 100644 --- a/doc/man/man1/cdist-object-explorer-run.text +++ b/doc/man/man1/cdist-object-explorer-run.text @@ -1,6 +1,6 @@ cdist-object-explorer-run(1) ============================ -Nico Schottelius , Steven Armstrong +Nico Schottelius NAME diff --git a/doc/man/man1/cdist-object-gencode-run.text b/doc/man/man1/cdist-object-gencode-run.text index fc93ebfd..be2d3448 100644 --- a/doc/man/man1/cdist-object-gencode-run.text +++ b/doc/man/man1/cdist-object-gencode-run.text @@ -1,6 +1,6 @@ cdist-object-gencode-run(1) =========================== -Nico Schottelius , Steven Armstrong +Nico Schottelius NAME diff --git a/doc/man/man1/cdist-object-manifest-run.text b/doc/man/man1/cdist-object-manifest-run.text index 76132425..a6f12f78 100644 --- a/doc/man/man1/cdist-object-manifest-run.text +++ b/doc/man/man1/cdist-object-manifest-run.text @@ -1,7 +1,6 @@ cdist-object-manifest-run(1) ============================ Nico Schottelius -Steven Armstrong NAME diff --git a/doc/man/man1/cdist-object-push.text b/doc/man/man1/cdist-object-push.text index 168f5190..5bff71cf 100644 --- a/doc/man/man1/cdist-object-push.text +++ b/doc/man/man1/cdist-object-push.text @@ -1,6 +1,6 @@ cdist-object-push(1) ==================== -Nico Schottelius , Steven Armstrong +Nico Schottelius NAME diff --git a/doc/man/man1/cdist-object-run-all.text b/doc/man/man1/cdist-object-run-all.text index 2b27347c..9e36b3d4 100644 --- a/doc/man/man1/cdist-object-run-all.text +++ b/doc/man/man1/cdist-object-run-all.text @@ -1,6 +1,6 @@ cdist-object-run-all(1) ======================= -Nico Schottelius , Steven Armstrong +Nico Schottelius NAME diff --git a/doc/man/man1/cdist-object-run.text b/doc/man/man1/cdist-object-run.text index b91e50ca..fca6db91 100644 --- a/doc/man/man1/cdist-object-run.text +++ b/doc/man/man1/cdist-object-run.text @@ -1,6 +1,6 @@ cdist-object-run(1) =================== -Nico Schottelius , Steven Armstrong +Nico Schottelius NAME diff --git a/doc/man/man7/cdist-stages.text b/doc/man/man7/cdist-stages.text index cbd541fe..e2eef3da 100644 --- a/doc/man/man7/cdist-stages.text +++ b/doc/man/man7/cdist-stages.text @@ -1,7 +1,6 @@ cdist-stages(7) =============== -Nico Schottelius , Steven Armstrong - +Nico Schottelius NAME ---- @@ -27,7 +26,7 @@ Related documentation: STAGE 1: TARGET INFORMATION RETRIEVAL --------------------------------------- +------------------------------------- In this stage information is collected about the target host using so called explorers. Every existing explorer is run on the target and the output of all explorers are copied back into the local cache. The results can be used by From 61b7b6867167a7d5a377f7ede31b0d92ed3bd47f Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 30 Mar 2011 22:46:49 +0200 Subject: [PATCH 0457/5465] split explorer/manifest and gencode runcode into to 2 steps Signed-off-by: Steven Armstrong --- bin/cdist-config | 6 +++ bin/cdist-deploy-to | 3 +- ...{cdist-object-run-all => cdist-object-all} | 8 ++-- bin/cdist-object-process | 48 +++++++++++++++++++ bin/cdist-object-run | 6 +-- 5 files changed, 62 insertions(+), 9 deletions(-) rename bin/{cdist-object-run-all => cdist-object-all} (88%) create mode 100755 bin/cdist-object-process diff --git a/bin/cdist-config b/bin/cdist-config index 9cd3a53c..393a963b 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -55,6 +55,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_manifest:=manifest} : ${__cdist_name_object:=object} : ${__cdist_name_object_finished:=done} +: ${__cdist_name_object_processed:=processed} : ${__cdist_name_object_id:=object_id} : ${__cdist_name_object_source:=source} : ${__cdist_name_objects_created:=.objects_created} @@ -194,6 +195,11 @@ __cdist_object_code() echo "$(__cdist_object_dir "$1")/${__cdist_name_code}" } +__cdist_object_processed() +{ + echo "$(__cdist_object_dir "$1")/${__cdist_name_object_processed}" +} + __cdist_object_finished() { echo "$(__cdist_object_dir "$1")/${__cdist_name_object_finished}" diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index e44ceff4..aeae3b6c 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -49,7 +49,8 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" -cdist-object-run-all "$__cdist_target_host" +cdist-object-all "$__cdist_target_host" cdist-object-process +cdist-object-all "$__cdist_target_host" cdist-object-run cdist-cache "$__cdist_target_host" echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" diff --git a/bin/cdist-object-run-all b/bin/cdist-object-all similarity index 88% rename from bin/cdist-object-run-all rename to bin/cdist-object-all index c646ab16..28df0613 100755 --- a/bin/cdist-object-run-all +++ b/bin/cdist-object-all @@ -19,14 +19,15 @@ # along with cdist. If not, see . # # -# Run cdist-object-run for each created object. +# Run the given command for each created object. # . cdist-config -[ $# -eq 1 ] || __cdist_usage "" +[ $# -eq 2 ] || __cdist_usage " " set -eu __cdist_target_host="$1"; shift +__cdist_command="$1"; shift __cdist_objects="$__cdist_tmp_dir/objects" @@ -47,7 +48,6 @@ while [ -f "$__cdist_objects_created" ]; do while [ $# -gt 0 ]; do __cdist_object="$1"; shift - # Process the object - cdist-object-run "$__cdist_target_host" "$__cdist_object" + $__cdist_command "$__cdist_target_host" "$__cdist_object" done done diff --git a/bin/cdist-object-process b/bin/cdist-object-process new file mode 100755 index 00000000..371f3737 --- /dev/null +++ b/bin/cdist-object-process @@ -0,0 +1,48 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# For the given object: +# - run type explorers +# - run type manifest +# + +. cdist-config +[ $# -eq 2 ] || __cdist_usage " " +set -eu + +__cdist_target_host="$1"; shift +__cdist_object="$1"; shift +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" +[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Requested object is not defined: $__cdist_object" + +# Export to non-core for use in manifest and gencode scripts +export $__cdist_name_var_self=$__cdist_object + +__cdist_object_processed="$(__cdist_object_processed "$__cdist_object")" +if [ ! -f "$__cdist_object_processed" ]; then + echo + echo "Processing object $__cdist_object" + cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" + cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" + + # Mark this object as done + touch "$__cdist_object_processed" +fi diff --git a/bin/cdist-object-run b/bin/cdist-object-run index e3fc1629..b49c8c2d 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -39,8 +39,6 @@ __cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" # Export to non-core for use in manifest and gencode scripts export $__cdist_name_var_self=$__cdist_object -__cdist_type="$(__cdist_type_from_object "$__cdist_object")" - __cdist_object_finished="$(__cdist_object_finished "$__cdist_object")" if [ ! -f "$__cdist_object_finished" ]; then @@ -62,8 +60,8 @@ if [ ! -f "$__cdist_object_finished" ]; then echo echo "Running object $__cdist_object" - cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" - cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" + #cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" + #cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" cdist-object-push "$__cdist_target_host" "$__cdist_object" cdist-object-code-run "$__cdist_target_host" "$__cdist_object" From e7ff4c37ff555700398a61647dcc2d973845d0e3 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 31 Mar 2011 11:08:10 +0200 Subject: [PATCH 0458/5465] remove legacy commented code Signed-off-by: Steven Armstrong --- bin/cdist-object-process | 2 +- bin/cdist-object-run | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/cdist-object-process b/bin/cdist-object-process index 371f3737..d10840e8 100755 --- a/bin/cdist-object-process +++ b/bin/cdist-object-process @@ -43,6 +43,6 @@ if [ ! -f "$__cdist_object_processed" ]; then cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" - # Mark this object as done + # Mark this object as processed touch "$__cdist_object_processed" fi diff --git a/bin/cdist-object-run b/bin/cdist-object-run index b49c8c2d..6c159ecf 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -60,8 +60,6 @@ if [ ! -f "$__cdist_object_finished" ]; then echo echo "Running object $__cdist_object" - #cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" - #cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" cdist-object-push "$__cdist_target_host" "$__cdist_object" cdist-object-code-run "$__cdist_target_host" "$__cdist_object" From dd176d7a642745ac2f748f81928abc4be88a8cc9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 15:40:08 +0200 Subject: [PATCH 0459/5465] construct cache dir path in cdist-config, not cdist-cache Signed-off-by: Nico Schottelius --- bin/cdist-cache | 12 ++++++------ bin/cdist-config | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/bin/cdist-cache b/bin/cdist-cache index 120b0df2..f9480162 100755 --- a/bin/cdist-cache +++ b/bin/cdist-cache @@ -27,11 +27,11 @@ set -u __cdist_target_host="$1"; shift +__cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")" -mkdir -p "${__cdist_local_base_cache_dir}" -__cdist_abs_cache_dir="$(cd "$__cdist_local_base_cache_dir" && pwd -P)" -__cdist_abs_ddir="$__cdist_abs_cache_dir/$__cdist_target_host" +# Create base to move into +mkdir -p "$(__cdist_cache_dir)" -echo "Saving cache to $__cdist_abs_ddir ..." -rm -rf "$__cdist_abs_ddir" -mv "$__cdist_local_base_dir" "$__cdist_abs_ddir" +echo "Saving cache to $__cdist_ddir ..." +rm -rf "$__cdist_ddir" +mv "$__cdist_local_base_dir" "$__cdist_ddir" diff --git a/bin/cdist-config b/bin/cdist-config index 393a963b..fac1b5c6 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -105,6 +105,8 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") # Local Base # : ${__cdist_local_base_dir:=$__cdist_tmp_dir} + +# Cache may *NOT* be below __cdist_local_base_dir! : ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache} : ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"} @@ -186,6 +188,19 @@ __cdist_init_deploy() ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir" } +################################################################################ +# Cache +# +__cdist_cache_dir() +{ + cd "${__cdist_local_base_cache_dir}" && pwd -P +} + +__cdist_host_cache_dir() +{ + echo "$(__cdist_cache_dir)/$1" +} + ################################################################################ # Object # From 7431802b0357c7a528a33d88f4ec94864e190912 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 15:43:07 +0200 Subject: [PATCH 0460/5465] ++todo Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 7e6a44d9..e85ddebd 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -6,6 +6,10 @@ Feel free to pick one! CORE ---- - Only build manpages if necessary for types as well as for the core! +- Add echo function: + __cdist_echo [level] [messages...] + level := syslog alike: + debug, notice, err TYPES ------ From 9955dc74c670d25270ada8bab2b280753143f33e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 18:43:08 +0200 Subject: [PATCH 0461/5465] cleanups in bin/ Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 1 - bin/cdist-deploy-to | 6 +++--- bin/cdist-dir | 5 +---- doc/dev/todo/TAKEME | 3 +++ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index db1a2378..54cb312f 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -36,7 +36,6 @@ code="$(__cdist_object_code "$__cdist_object")-${__cdist_gencode_type}" echo "Checking code-${__cdist_gencode_type} for $__cdist_object ..." - if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index aeae3b6c..02fd34fa 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -18,7 +18,7 @@ # along with cdist. If not, see . # # -# Apply configuration to a host +# Deploy configuration to a host # . cdist-config @@ -45,8 +45,8 @@ __cdist_init_deploy "$__cdist_target_host" # Transfer cdist executables echo "Transferring cdist binaries to $__cdist_target_host ..." -cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" - +cdist-dir push "$__cdist_target_host" \ + "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" cdist-object-all "$__cdist_target_host" cdist-object-process diff --git a/bin/cdist-dir b/bin/cdist-dir index 72f4730b..0d30e14a 100755 --- a/bin/cdist-dir +++ b/bin/cdist-dir @@ -25,14 +25,11 @@ . cdist-config -if [ $# -ne 4 ]; then - __cdist_usage " " -fi +[ $# -eq 4 ] || __cdist_usage " " set -ue __cdist_action="$1"; shift __cdist_target_host="$1"; shift - __cdist_src_dir="$1"; shift __cdist_dst_dir="$1"; shift diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index e85ddebd..7807c9e0 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -10,6 +10,9 @@ CORE __cdist_echo [level] [messages...] level := syslog alike: debug, notice, err +- Think about moving cdist-type-build-emulation out of cdist-manifest-run to + cdist-deploy-to: more dependency of cdist-manifest-run, but a lot of + less cycles consumed TYPES ------ From b3d7cf31925767be55f6baf399326722eb3c2432 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 19:35:26 +0200 Subject: [PATCH 0462/5465] more cleanups, __cdist prefixes Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 7 +++---- bin/cdist-object-gencode-run | 10 +++++----- doc/dev/todo/TAKEME | 3 +++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index ff0668e5..4d8e2321 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -32,7 +32,6 @@ __cdist_object="$1"; shift __object_id="$(__cdist_object_id_from_object "$__cdist_object")" __cdist_type="$(__cdist_type_from_object "$__cdist_object")" - # Check if type of object has >= 1 explorer __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" # Run the type explorers for the current object if any @@ -47,8 +46,8 @@ if [ "$__cdist_has_explorer" ]; then echo "Running explorers for $__cdist_object ..." # Copy object parameters - cdist-dir push "$__cdist_target_host" \ - "$(__cdist_object_parameter_dir "$__cdist_object")" \ + cdist-dir push "$__cdist_target_host" \ + "$(__cdist_object_parameter_dir "$__cdist_object")" \ "$(__cdist_remote_object_parameter_dir "$__cdist_object")" # Execute explorers @@ -62,7 +61,7 @@ if [ "$__cdist_has_explorer" ]; then "$(__cdist_remote_object_type_explorer_dir "$__cdist_object")" # Copy back results - cdist-dir pull "$__cdist_target_host" \ + cdist-dir pull "$__cdist_target_host" \ "$(__cdist_remote_object_type_explorer_dir "$__cdist_object")" \ "$(__cdist_object_type_explorer_dir "$__cdist_object")" fi diff --git a/bin/cdist-object-gencode-run b/bin/cdist-object-gencode-run index bfc65730..4d21fec9 100755 --- a/bin/cdist-object-gencode-run +++ b/bin/cdist-object-gencode-run @@ -29,15 +29,15 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift -code_local="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_local}" -code_remote="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_remote}" +__cdist_code_local="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_local}" +__cdist_code_remote="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_remote}" echo "Generating local code for $__cdist_object ..." cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ - "${__cdist_name_gencode_local}" > "${code_local}" + "${__cdist_name_gencode_local}" > "${__cdist_code_local}" echo "Generating remote code for $__cdist_object ..." cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ - "${__cdist_name_gencode_remote}" > "${code_remote}" + "${__cdist_name_gencode_remote}" > "${__cdist_code_remote}" -chmod u+x "${code_local}" "${code_remote}" +chmod u+x "${__cdist_code_local}" "${__cdist_code_remote}" diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 7807c9e0..4dc5b53b 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -14,6 +14,9 @@ CORE cdist-deploy-to: more dependency of cdist-manifest-run, but a lot of less cycles consumed +- cdist-object-gencode: remove code if output empty? + - also take care of that in cdist-code-run! + TYPES ------ Types to be written/extended: From 5359ed863cde6f920e0e59ec474e8a3ddbe9dfc6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 20:21:08 +0200 Subject: [PATCH 0463/5465] +cleanups++ Signed-off-by: Nico Schottelius --- bin/cdist-object-manifest-run | 2 +- bin/cdist-object-process | 2 +- doc/dev/todo/TAKEME | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index 25378eb2..74a81469 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -46,12 +46,12 @@ if [ -f "$__cdist_manifest" ]; then export __cdist_manifest echo "Executing manifest ${__cdist_manifest} ..." - # Make variables available to non-core - FIXME: beatify export $__cdist_name_var_object="$__cdist_cur_object_dir" export $__cdist_name_var_object_id="$__cdist_object_id" export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" + # Tell cdist-object-run-all that there may be new objects touch "$__cdist_objects_created" else diff --git a/bin/cdist-object-process b/bin/cdist-object-process index d10840e8..777d2c88 100755 --- a/bin/cdist-object-process +++ b/bin/cdist-object-process @@ -31,7 +31,7 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift __cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" -[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Requested object is not defined: $__cdist_object" +[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Object undefined: $__cdist_object" # Export to non-core for use in manifest and gencode scripts export $__cdist_name_var_self=$__cdist_object diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 4dc5b53b..03c4f244 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -16,6 +16,7 @@ CORE - cdist-object-gencode: remove code if output empty? - also take care of that in cdist-code-run! +- cdist-object-process -> cdist-object-prepare TYPES ------ From 7d0877d8ceb4055e6267632689034fdc65a2a3af Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 20:29:22 +0200 Subject: [PATCH 0464/5465] ++cleanups Signed-off-by: Nico Schottelius --- bin/cdist-object-manifest-run | 3 --- bin/cdist-object-run | 3 +-- bin/cdist-type-emulator | 1 - bin/cdist-type-template | 1 - doc/dev/todo/TAKEME | 9 ++++++++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index 74a81469..ce44cbbc 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -29,10 +29,7 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift -# Full path to current object __cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object")" - -# Only the id __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" echo "Checking manifest for $__cdist_object ..." diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 6c159ecf..667bf386 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -41,8 +41,7 @@ export $__cdist_name_var_self=$__cdist_object __cdist_object_finished="$(__cdist_object_finished "$__cdist_object")" if [ ! -f "$__cdist_object_finished" ]; then - - # Resolve dependencies if any + # Resolve dependencies, if any __cdist_object_require="$(__cdist_object_require "$__cdist_object")" if [ -f "$__cdist_object_require" ]; then echo diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index d0464533..2dcb47b3 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -53,7 +53,6 @@ if [ "$(echo $__cdist_object_id | grep "^/")" ]; then else __cdist_object_self="${__cdist_type}/${__cdist_object_id}" fi - ################################################################################ # Internal quirks # diff --git a/bin/cdist-type-template b/bin/cdist-type-template index cd34027c..dc853614 100755 --- a/bin/cdist-type-template +++ b/bin/cdist-type-template @@ -27,7 +27,6 @@ set -eu __cdist_type="$1"; shift - # Base mkdir -p "$(__cdist_type_dir "$__cdist_type")" diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 03c4f244..e4edeabe 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -6,10 +6,11 @@ Feel free to pick one! CORE ---- - Only build manpages if necessary for types as well as for the core! -- Add echo function: +- Add echo function / beautify output __cdist_echo [level] [messages...] level := syslog alike: debug, notice, err + Include object_self prefixing, if given! - Think about moving cdist-type-build-emulation out of cdist-manifest-run to cdist-deploy-to: more dependency of cdist-manifest-run, but a lot of less cycles consumed @@ -17,6 +18,12 @@ CORE - cdist-object-gencode: remove code if output empty? - also take care of that in cdist-code-run! - cdist-object-process -> cdist-object-prepare +- Remove cdist-object-push, covers only one line and is used only once: + [20:22] kr:bin% grep cdist-object-push * + cdist-object-run: cdist-object-push "$__cdist_target_host" "$__cdist_object" + [20:22] kr:bin% + +- probably remove or improve cdist-type-template TYPES ------ From db1f1d0c2d406c18b2ef26212c261158fac26017 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 31 Mar 2011 20:46:58 +0200 Subject: [PATCH 0465/5465] remove leftovers from experimenting with process group control Signed-off-by: Steven Armstrong --- build.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 7fbb94cc..ab62287e 100755 --- a/build.sh +++ b/build.sh @@ -58,8 +58,7 @@ case "$1" in manpage="${src%.text}.$section" if [ ! -f "$manpage" -o "$manpage" -ot "$src" ]; then echo "Compiling manpage for $src" - setsid $A2XM "$src" - a2x_pids="" + $A2XM "$src" fi htmlpage="${src%.text}.html" if [ ! -f "$htmlpage" -o "$htmlpage" -ot "$src" ]; then From c69feec5a0cfac25541aba7be7661c24f33e3ced Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 31 Mar 2011 20:49:02 +0200 Subject: [PATCH 0466/5465] -todo: conditional manpage building Signed-off-by: Steven Armstrong --- doc/dev/todo/TAKEME | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index e85ddebd..7f319790 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -5,7 +5,6 @@ Feel free to pick one! CORE ---- -- Only build manpages if necessary for types as well as for the core! - Add echo function: __cdist_echo [level] [messages...] level := syslog alike: From dbed2f1f83b0729ca57a57b3c37e269f658bef98 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 21:44:44 +0200 Subject: [PATCH 0467/5465] 1.5 not yet released, correct changelog Signed-off-by: Nico Schottelius --- doc/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index d3091fd7..5e0e2314 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.5.0: 2011-03-29 +1.5.0: * Add basic cache functionality * New type __process * Restructured execution: (Steven Armstrong) From a648aa5333d331123f7e4da00bb562b710ea8d18 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 31 Mar 2011 22:25:56 +0200 Subject: [PATCH 0468/5465] fix cdist-object-all: ensure output directory exists Signed-off-by: Nico Schottelius --- bin/cdist-object-all | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/cdist-object-all b/bin/cdist-object-all index 28df0613..391c9cc7 100755 --- a/bin/cdist-object-all +++ b/bin/cdist-object-all @@ -31,6 +31,9 @@ __cdist_command="$1"; shift __cdist_objects="$__cdist_tmp_dir/objects" +# Ensure object dir exists, so marker can be created +mkdir -p "${__cdist_out_object_dir}" + # Loop until we do not create new objects anymore # which is equal to all objects have been run touch "$__cdist_objects_created" From 1a0ef5ac6328ec8014710ae676a246682ff3cdce Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 09:56:44 +0200 Subject: [PATCH 0469/5465] update changelog Signed-off-by: Nico Schottelius --- doc/changelog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/changelog b/doc/changelog index 5e0e2314..2fcb8b46 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,9 +1,9 @@ -1.5.0: +1.5.0: 2011-04-01 * Add basic cache functionality * New type __process * Restructured execution: (Steven Armstrong) - Process each object as a whole, resolve dependencies and ensure - correct execution order. + Orientate processing on objects, resolve dependencies and + ensure correct execution order. * Documentation: Rewrite stages docs (Steven Armstrong) * Documentation: Remove legacy man pages (Steven Armstrong) From 815d8cc8cdb22a155062afdfc5e87f9bdf2d7830 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 10:03:43 +0200 Subject: [PATCH 0470/5465] no incompat between 1.3 and 1.5 Signed-off-by: Nico Schottelius --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 3a4b2051..1fd28ffd 100644 --- a/README +++ b/README @@ -166,7 +166,7 @@ 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. -### Upgrading from 1.3 to 1.4 +### Upgrading from 1.3 to 1.5 No incompatiblities. From 659bb1d1ac53d0bcab69fec07cd99a8d6180bb72 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 10:47:09 +0200 Subject: [PATCH 0471/5465] create reference in man7 Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 48954b8e..6358db9c 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -28,7 +28,7 @@ __cdist_myname=${0##*/}; __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" filename="${__cdist_myname%.sh}" -dest="$__cdist_abs_mydir/$filename" +dest="$__cdist_abs_mydir/man7/$filename" cd "$__cdist_abs_mydir" From 8828a69d608505d7c52fd6d9f942dcbe259ede46 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 11:04:31 +0200 Subject: [PATCH 0472/5465] unignore doc/man and update cdist-best-practice.text Signed-off-by: Nico Schottelius --- .gitignore | 4 +++- doc/man/man7/cdist-best-practice.text | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 68f829dc..89dba856 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,9 @@ # Ignore generated manpages doc/man/.marker -doc/man/man*/ +doc/man/man1/*.1 +doc/man/man7/*.7 +doc/man/man*/*.html # Ignore cache for version control cache/ diff --git a/doc/man/man7/cdist-best-practice.text b/doc/man/man7/cdist-best-practice.text index febe8f36..666dd414 100644 --- a/doc/man/man7/cdist-best-practice.text +++ b/doc/man/man7/cdist-best-practice.text @@ -60,6 +60,20 @@ machine-a % git clone git://your-git-server/cdist machine-b % git clone git://your-git-server/cdist -------------------------------------------------------------------------------- +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 +their manifests. You can use the following snippet in +**conf/manifests/init**: + +-------------------------------------------------------------------------------- +# Include other groups +sh -e "$__manifest/systems" + +sh -e "$__manifest/cbrg" +-------------------------------------------------------------------------------- + SEE ALSO -------- From 2d30dd6aad6617a0e7ecfba16cece7fdb85cddfa Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 1 Apr 2011 11:12:15 +0200 Subject: [PATCH 0473/5465] update to match new location of cdist-reference.text Signed-off-by: Steven Armstrong --- build.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index ab62287e..2df76539 100755 --- a/build.sh +++ b/build.sh @@ -57,12 +57,12 @@ case "$1" in for src in ${MANDIR}/man${section}/*.text; do manpage="${src%.text}.$section" if [ ! -f "$manpage" -o "$manpage" -ot "$src" ]; then - echo "Compiling manpage for $src" + echo "Compiling man page for $src" $A2XM "$src" fi htmlpage="${src%.text}.html" if [ ! -f "$htmlpage" -o "$htmlpage" -ot "$src" ]; then - echo "Compiling html for $src" + echo "Compiling html page for $src" $A2XH "$src" fi done @@ -99,7 +99,6 @@ case "$1" in ;; clean) - rm -f ${MANDIR}/cdist-reference.text find "${MANDIR}" -mindepth 2 -type l \ -o -name "*.1" \ -o -name "*.7" \ From afb1bf2373ce93b996681e0e5d5945848a894633 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 11:22:35 +0200 Subject: [PATCH 0474/5465] ignore type manpages and docbook stuff Signed-off-by: Nico Schottelius --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 89dba856..57950f3b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ doc/man/.marker doc/man/man1/*.1 doc/man/man7/*.7 doc/man/man*/*.html +doc/man/man7/cdist-type__*.text +doc/man/man*/docbook-xsl.css # Ignore cache for version control cache/ From 422bfd57d4664ab803461d4e45aaa70855f6c978 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 11:30:55 +0200 Subject: [PATCH 0475/5465] document multiple configuration workflow Signed-off-by: Nico Schottelius --- doc/man/man7/cdist-best-practice.text | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/doc/man/man7/cdist-best-practice.text b/doc/man/man7/cdist-best-practice.text index 666dd414..aa499790 100644 --- a/doc/man/man7/cdist-best-practice.text +++ b/doc/man/man7/cdist-best-practice.text @@ -75,6 +75,37 @@ sh -e "$__manifest/cbrg" -------------------------------------------------------------------------------- +MAINTAINING MULTIPLE CONFIGURATIONS +----------------------------------- +When you need to manage multiple sites with cdist, like company_a, company_b +and private for instance, you can easily use git for this purpose. +Including a possible common base that is reused accross the different sites: + +-------------------------------------------------------------------------------- +# create branches +git branch company_a company_b common private + +# make stuff for company a +git checkout company_a +# work, commit, etc. + +# make stuff for company b +git checkout company_b +# work, commit, etc. + +# make stuff relevant for all sites +git checkout common +# work, commit, etc. + +# change to private and include latest common stuff +git checkout private +git merge common +-------------------------------------------------------------------------------- + +Have a look at git-remote(1) to adjust the remote configuration, which allows +you to push certain branches to certain remotes. + + SEE ALSO -------- - cdist(7) From 2c3d71a7e7e43a7af275a93c991dadc51fd95a15 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 12:11:30 +0200 Subject: [PATCH 0476/5465] update todos Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 4 ---- doc/dev/todo/niconext | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 67afba55..7a8c4583 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -45,7 +45,3 @@ Cache: - export variable $__cache -> for current host -> add function to cdist-config, import from cdist-cache - - -remove --preseed from package_apt and add debconf_set_selection or similar - -> much cleaner! diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 29229d64..e7f2c72f 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1 +1,2 @@ -Release 1.5.0 correctly :-) +remove --preseed from package_apt and add debconf_set_selection or similar + -> much cleaner! From 48a96591d14910748744e256975c3fb55795f055 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 12:11:50 +0200 Subject: [PATCH 0477/5465] add template for type __debconf_set_selections/ Signed-off-by: Nico Schottelius --- .../explorer/pkg_status | 31 ++++++++++ .../__debconf_set_selections/gencode-remote | 53 +++++++++++++++++ conf/type/__debconf_set_selections/man.text | 59 +++++++++++++++++++ .../parameter/optional | 3 + .../parameter/required | 1 + 5 files changed, 147 insertions(+) create mode 100755 conf/type/__debconf_set_selections/explorer/pkg_status create mode 100755 conf/type/__debconf_set_selections/gencode-remote create mode 100644 conf/type/__debconf_set_selections/man.text create mode 100644 conf/type/__debconf_set_selections/parameter/optional create mode 100644 conf/type/__debconf_set_selections/parameter/required diff --git a/conf/type/__debconf_set_selections/explorer/pkg_status b/conf/type/__debconf_set_selections/explorer/pkg_status new file mode 100755 index 00000000..86b94825 --- /dev/null +++ b/conf/type/__debconf_set_selections/explorer/pkg_status @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Retrieve the status of a package - parsed dpkg output +# + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +# Except dpkg failing, if package is not known / installed +dpkg -s "$name" 2>/dev/null || exit 0 diff --git a/conf/type/__debconf_set_selections/gencode-remote b/conf/type/__debconf_set_selections/gencode-remote new file mode 100755 index 00000000..b2c7179d --- /dev/null +++ b/conf/type/__debconf_set_selections/gencode-remote @@ -0,0 +1,53 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Manage packages on Debian and co. +# + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +# Check for preseeding and add preseed as here document +if [ -f "$__object/parameter/preseed" ]; then + echo "debconf-set-selections << __file-eof" + cat "$(cat "$__object/parameter/preseed")" + echo "__file-eof" +fi + +state="$(cat "$__object/parameter/state")" +is_installed="$(grep "^Status: install ok installed" "$__object/explorer/pkg_status" || true)" + +case "$state" in + installed) + # Install only if non-existent + if [ -z "$is_installed" ]; then + echo apt-get --quiet --yes install \"$name\" + fi + ;; + uninstalled) + # Remove only if existent + if [ -n "$is_installed" ]; then + echo apt-get --quiet --yes remove \"$name\" + fi + ;; +esac diff --git a/conf/type/__debconf_set_selections/man.text b/conf/type/__debconf_set_selections/man.text new file mode 100644 index 00000000..8b7476b4 --- /dev/null +++ b/conf/type/__debconf_set_selections/man.text @@ -0,0 +1,59 @@ +cdist-type__package_apt(7) +========================== +Nico Schottelius + + +NAME +---- +cdist-type__package_apt - Manage packages with apt-get + + +DESCRIPTION +----------- +apt-get is usually used on Debian and variants (like Ubuntu) to +manage packages. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "installed" or "deinstalled". + + +OPTIONAL PARAMETERS +------------------- +name:: + If supplied, use the name and not the object id as the package name. + +preseed:: + If supplied, use the given filename as input for debconf-set-selections(1) + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Ensure zsh in installed +__package_apt zsh --state installed + +# In case you only want *a* webserver, but don't care which one +__package_apt webserver --state installed --name nginx + +# Install package with defaults (from a type) +__package_apt postfix --state installed --preseed "$__type/files/postfix-seed" + +# Remove obsolete package +__package_apt puppet --state deinstalled +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__package(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__debconf_set_selections/parameter/optional b/conf/type/__debconf_set_selections/parameter/optional new file mode 100644 index 00000000..2dae648e --- /dev/null +++ b/conf/type/__debconf_set_selections/parameter/optional @@ -0,0 +1,3 @@ +name +preseed +version diff --git a/conf/type/__debconf_set_selections/parameter/required b/conf/type/__debconf_set_selections/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__debconf_set_selections/parameter/required @@ -0,0 +1 @@ +state From 0db21eb308135cbc824675bce833a2924f6b6ead Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 12:47:48 +0200 Subject: [PATCH 0478/5465] document, cleanup and theoretically finish __debconf_set_selections Signed-off-by: Nico Schottelius --- .../explorer/pkg_status | 31 ---------------- .../__debconf_set_selections/gencode-remote | 35 +++--------------- conf/type/__debconf_set_selections/man.text | 36 ++++++------------- .../parameter/optional | 3 -- .../parameter/required | 2 +- 5 files changed, 15 insertions(+), 92 deletions(-) delete mode 100755 conf/type/__debconf_set_selections/explorer/pkg_status delete mode 100644 conf/type/__debconf_set_selections/parameter/optional diff --git a/conf/type/__debconf_set_selections/explorer/pkg_status b/conf/type/__debconf_set_selections/explorer/pkg_status deleted file mode 100755 index 86b94825..00000000 --- a/conf/type/__debconf_set_selections/explorer/pkg_status +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Retrieve the status of a package - parsed dpkg output -# - -if [ -f "$__object/parameter/name" ]; then - name="$(cat "$__object/parameter/name")" -else - name="$__object_id" -fi - -# Except dpkg failing, if package is not known / installed -dpkg -s "$name" 2>/dev/null || exit 0 diff --git a/conf/type/__debconf_set_selections/gencode-remote b/conf/type/__debconf_set_selections/gencode-remote index b2c7179d..156fc9f3 100755 --- a/conf/type/__debconf_set_selections/gencode-remote +++ b/conf/type/__debconf_set_selections/gencode-remote @@ -18,36 +18,9 @@ # along with cdist. If not, see . # # -# Manage packages on Debian and co. +# Setup selections # -if [ -f "$__object/parameter/name" ]; then - name="$(cat "$__object/parameter/name")" -else - name="$__object_id" -fi - -# Check for preseeding and add preseed as here document -if [ -f "$__object/parameter/preseed" ]; then - echo "debconf-set-selections << __file-eof" - cat "$(cat "$__object/parameter/preseed")" - echo "__file-eof" -fi - -state="$(cat "$__object/parameter/state")" -is_installed="$(grep "^Status: install ok installed" "$__object/explorer/pkg_status" || true)" - -case "$state" in - installed) - # Install only if non-existent - if [ -z "$is_installed" ]; then - echo apt-get --quiet --yes install \"$name\" - fi - ;; - uninstalled) - # Remove only if existent - if [ -n "$is_installed" ]; then - echo apt-get --quiet --yes remove \"$name\" - fi - ;; -esac +echo "debconf-set-selections << __file-eof" +cat "$__object/parameter/file" +echo "__file-eof" diff --git a/conf/type/__debconf_set_selections/man.text b/conf/type/__debconf_set_selections/man.text index 8b7476b4..b6b2ad18 100644 --- a/conf/type/__debconf_set_selections/man.text +++ b/conf/type/__debconf_set_selections/man.text @@ -1,31 +1,22 @@ -cdist-type__package_apt(7) -========================== +cdist-type__debconf_set_selections(7) +===================================== Nico Schottelius NAME ---- -cdist-type__package_apt - Manage packages with apt-get +cdist-type__debconf_set_selections - Setup debconf selections DESCRIPTION ----------- -apt-get is usually used on Debian and variants (like Ubuntu) to -manage packages. +On Debian and alike systems debconf-set-selections(1) can be used +to setup configuration parameters. REQUIRED PARAMETERS ------------------- -state:: - Either "installed" or "deinstalled". - - -OPTIONAL PARAMETERS -------------------- -name:: - If supplied, use the name and not the object id as the package name. - -preseed:: +file:: If supplied, use the given filename as input for debconf-set-selections(1) @@ -33,24 +24,17 @@ EXAMPLES -------- -------------------------------------------------------------------------------- -# Ensure zsh in installed -__package_apt zsh --state installed +# Setup configuration for nslcd +__debconf_set_selections nslcd --file /path/to/file -# In case you only want *a* webserver, but don't care which one -__package_apt webserver --state installed --name nginx - -# Install package with defaults (from a type) -__package_apt postfix --state installed --preseed "$__type/files/postfix-seed" - -# Remove obsolete package -__package_apt puppet --state deinstalled +# Setup configuration for nslcd from another type +__debconf_set_selections nslcd --file "$__type/files/preseed/nslcd" -------------------------------------------------------------------------------- SEE ALSO -------- - cdist-type(7) -- cdist-type__package(7) COPYING diff --git a/conf/type/__debconf_set_selections/parameter/optional b/conf/type/__debconf_set_selections/parameter/optional deleted file mode 100644 index 2dae648e..00000000 --- a/conf/type/__debconf_set_selections/parameter/optional +++ /dev/null @@ -1,3 +0,0 @@ -name -preseed -version diff --git a/conf/type/__debconf_set_selections/parameter/required b/conf/type/__debconf_set_selections/parameter/required index ff72b5c7..f73f3093 100644 --- a/conf/type/__debconf_set_selections/parameter/required +++ b/conf/type/__debconf_set_selections/parameter/required @@ -1 +1 @@ -state +file From e21283c579ef4e5da7d590a2b0338668cd2f16fc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 13:08:47 +0200 Subject: [PATCH 0479/5465] remove preseeding support from __package_apt Signed-off-by: Nico Schottelius --- conf/type/__package_apt/man.text | 6 ------ conf/type/__package_apt/parameter/optional | 1 - 2 files changed, 7 deletions(-) diff --git a/conf/type/__package_apt/man.text b/conf/type/__package_apt/man.text index 8b7476b4..0780124d 100644 --- a/conf/type/__package_apt/man.text +++ b/conf/type/__package_apt/man.text @@ -25,9 +25,6 @@ OPTIONAL PARAMETERS name:: If supplied, use the name and not the object id as the package name. -preseed:: - If supplied, use the given filename as input for debconf-set-selections(1) - EXAMPLES -------- @@ -39,9 +36,6 @@ __package_apt zsh --state installed # In case you only want *a* webserver, but don't care which one __package_apt webserver --state installed --name nginx -# Install package with defaults (from a type) -__package_apt postfix --state installed --preseed "$__type/files/postfix-seed" - # Remove obsolete package __package_apt puppet --state deinstalled -------------------------------------------------------------------------------- diff --git a/conf/type/__package_apt/parameter/optional b/conf/type/__package_apt/parameter/optional index 2dae648e..a52167d3 100644 --- a/conf/type/__package_apt/parameter/optional +++ b/conf/type/__package_apt/parameter/optional @@ -1,3 +1,2 @@ name -preseed version From 1b87fc7c3f0a6d3e6135d59f8a0452b7cdf3f907 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 13:10:41 +0200 Subject: [PATCH 0480/5465] changes for 1.6.0 Signed-off-by: Nico Schottelius --- doc/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/changelog b/doc/changelog index 2fcb8b46..1b9ede30 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,7 @@ +1.6.0: + * Removed --preseed support from __package_apt + * New type __debconf_set_selections which allows to preseed debian packages + 1.5.0: 2011-04-01 * Add basic cache functionality * New type __process From cee51f00880919638eab04c40dc988c3adf9f81f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 1 Apr 2011 13:12:00 +0200 Subject: [PATCH 0481/5465] make __package_apt use DEBIAN_FRONTEND=noninteractive Signed-off-by: Nico Schottelius --- conf/type/__package_apt/gencode-remote | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/type/__package_apt/gencode-remote b/conf/type/__package_apt/gencode-remote index b2c7179d..e38653e9 100755 --- a/conf/type/__package_apt/gencode-remote +++ b/conf/type/__package_apt/gencode-remote @@ -37,17 +37,19 @@ fi state="$(cat "$__object/parameter/state")" is_installed="$(grep "^Status: install ok installed" "$__object/explorer/pkg_status" || true)" +aptget="DEBIAN_FRONTEND=noninteractive apt-get --quiet --yes" + case "$state" in installed) # Install only if non-existent if [ -z "$is_installed" ]; then - echo apt-get --quiet --yes install \"$name\" + echo $aptget install \"$name\" fi ;; uninstalled) # Remove only if existent if [ -n "$is_installed" ]; then - echo apt-get --quiet --yes remove \"$name\" + echo $aptget remove \"$name\" fi ;; esac From e700437b01f7bebb6496aba9d55b6a0894319ccd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 01:20:24 +0200 Subject: [PATCH 0482/5465] also detect fedora Signed-off-by: Nico Schottelius --- conf/explorer/os | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/conf/explorer/os b/conf/explorer/os index f7481193..b636d980 100755 --- a/conf/explorer/os +++ b/conf/explorer/os @@ -43,6 +43,12 @@ if [ -f /etc/gentoo-release ]; then exit 0 fi +# Fedora is also Redhat, thus return before redhat! +if grep -q ^Fedora /etc/redhat-release 2>/dev/null; then + echo fedora + exit 0 +fi + if [ -f /etc/redhat-release ]; then echo redhat exit 0 From bcfba18e6f15a13bbb7533d9106ad7e65aa0e24d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 01:22:09 +0200 Subject: [PATCH 0483/5465] more upcoming changes Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 1b9ede30..c54a5358 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.6.0: * Removed --preseed support from __package_apt * New type __debconf_set_selections which allows to preseed debian packages + * Explorer/os: Support Fedora 1.5.0: 2011-04-01 * Add basic cache functionality From afc16667f40945b42a493d6610e49495fc13e330 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 01:25:57 +0200 Subject: [PATCH 0484/5465] more production machines Signed-off-by: Nico Schottelius --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 1fd28ffd..18352d5a 100644 --- a/README +++ b/README @@ -230,7 +230,7 @@ Yes, I'm actually eating my own dogfood and currently managing * [xfce](http://www.xfce.org/) (lightweight desktop environment) * [slim](http://slim.berlios.de/) (graphical login manager for X11) -with cdist on a total of **9** production machines of the +with cdist on a total of **20** production machines of the [Systems Group](http://www.systems.ethz.ch) at the [ETH Zurich](http://www.ethz.ch) as well at home. From c617dc0e8fc9e1e1949c40b2eb167957da969991 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 01:49:52 +0200 Subject: [PATCH 0485/5465] cleanup readme Signed-off-by: Nico Schottelius --- README | 65 +++++++++++++++++++--------------------------------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/README b/README index 18352d5a..bb370b35 100644 --- a/README +++ b/README @@ -24,57 +24,34 @@ other configuration management systems like [cfengine](http://www.cfengine.org/), [bcfg2](http://trac.mcs.anl.gov/projects/bcfg2), [chef](http://wiki.opscode.com/display/chef/) -and [puppet](http://www.puppetlabs.com/), but -it ticks differently: +and [puppet](http://www.puppetlabs.com/), but it ticks differently. +Here are some features that makes it unique: - * cdist sticks completly to the KISS (keep it simple and stupid) paradigma - * cdist's core is very small (< 1k lines of code) - * There is only one type to extend cdist called ***type***. - * One main development target: ***It must be incredible easy to add new types.*** - * cdist is UNIX - * It reuses existing tools like cat, find, mv, ... - * cdist's documentation is bundled as manpages - * cdist is written in POSIX shell - * No special requirements like high level interpreters needed on server or target +[[!table data=""" +Simplicity | There is only one type to extend cdist called ***type*** +Design | Type and core cleanly seperated +Design | cdist sticks completly to the KISS (keep it simple and stupid) paradigma +Design | Meaningful error messages - do not lose time debugging error messages +Design | Consistency in behaviour, naming and documentation +Design | No surprise factor: Only do what is obviously clear, no magic +Design | Define target state, do not focus on methods or scripts +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 +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 | cdist requires only SSH and a shell on the target +Requirements | +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 written in POSIX shell +UNIX, simplicity, familar environment | cdist is configured in POSIX shell +"""]] ### Documentation The cdist documentation is included as manpages in the distribution. You can [browse the documentation for the latest version online](man) as well. -### Architecture - - * Push mode (server pushes configuration) - * User defines configuration in shell scripts (called ***manifests***) - * Generates internal configuration (cconfig style) - * Uses ***types*** to generate code be executed on the target - * And finally executes the code on the target / applies the configuration - -### Features - - * Elegant code and clean design - * Type and core cleanly seperated - * Small codebase in core - * Good documentation (man pages) - * Consistency in behaviour, naming and documentation - * Meaningful error messages - * Either standard error messages from tools or added description for clearification - * The no surprise factor - * No magic guessing of what the user wants - * Simple and well-known DSL - * Posix shell - * Easy integration into bare metal installations - * requires only ssh + sh - * Easy upgrade - * ***There is no need to update cdist on target hosts!*** - * cdist only needs to be updated on the master server(s) - * Very easy to extend - * Can be done via types, which can be stacked on top of others - * Reuse of existing functionality - * sh, ssh, find, rm, mv, ... - * Very easy to debug - * Just add set -x in the scripts - ### OS support cdist was tested or is know to run on at least From 77766d29a21da7b7ba0e4a1e00fe1cd42578698f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 01:50:45 +0200 Subject: [PATCH 0486/5465] +header Signed-off-by: Nico Schottelius --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index bb370b35..26cd1ef2 100644 --- a/README +++ b/README @@ -28,6 +28,7 @@ and [puppet](http://www.puppetlabs.com/), but it ticks differently. Here are some features that makes it unique: [[!table data=""" +Keywords | Description Simplicity | There is only one type to extend cdist called ***type*** Design | Type and core cleanly seperated Design | cdist sticks completly to the KISS (keep it simple and stupid) paradigma From e19c079f24113f46cd006e37e47730ccf014c948 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:00:20 +0200 Subject: [PATCH 0487/5465] add template for new type __package_yum Signed-off-by: Nico Schottelius --- conf/type/__package_yum/explorer/pkg_version | 30 +++++++++++ conf/type/__package_yum/gencode-remote | 52 +++++++++++++++++++ conf/type/__package_yum/man.text | 53 ++++++++++++++++++++ conf/type/__package_yum/parameter/optional | 1 + conf/type/__package_yum/parameter/required | 1 + 5 files changed, 137 insertions(+) create mode 100755 conf/type/__package_yum/explorer/pkg_version create mode 100755 conf/type/__package_yum/gencode-remote create mode 100644 conf/type/__package_yum/man.text create mode 100644 conf/type/__package_yum/parameter/optional create mode 100644 conf/type/__package_yum/parameter/required diff --git a/conf/type/__package_yum/explorer/pkg_version b/conf/type/__package_yum/explorer/pkg_version new file mode 100755 index 00000000..4f612423 --- /dev/null +++ b/conf/type/__package_yum/explorer/pkg_version @@ -0,0 +1,30 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Retrieve the status of a package - parsed dpkg output +# + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +pacman -Q "$name" 2>/dev/null | awk '{ print $2 }' diff --git a/conf/type/__package_yum/gencode-remote b/conf/type/__package_yum/gencode-remote new file mode 100755 index 00000000..536b7708 --- /dev/null +++ b/conf/type/__package_yum/gencode-remote @@ -0,0 +1,52 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Manage packages with Pacman (mostly archlinux) +# + +# Debug +# exec >&2 +# set -x + +pacopts="--noconfirm --noprogressbar" + +if [ -f "$__object/parameter/name" ]; then + name="$__object/parameter/name" +else + name="$__object_id" +fi + +state="$(cat "$__object/parameter/state")" +pkg_version="$(cat "$__object/explorer/pkg_version")" + +case "$state" in + installed) + + # Empty? Not installed. + if [ -z "$pkg_version" ]; then + echo pacman "$pacopts" -S \"$name\" + fi + ;; + uninstalled) + if [ "$pkg_version" ]; then + echo pacman "$pacopts" -R \"$name\" + fi + ;; +esac diff --git a/conf/type/__package_yum/man.text b/conf/type/__package_yum/man.text new file mode 100644 index 00000000..35a7e44c --- /dev/null +++ b/conf/type/__package_yum/man.text @@ -0,0 +1,53 @@ +cdist-type__package_pacman(7) +============================= +Nico Schottelius + + +NAME +---- +cdist-type__package_pacman - Manage packages with pacman + + +DESCRIPTION +----------- +Pacman is usually used on the Archlinux distribution to manage +packages. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "installed" or "deinstalled". + + +OPTIONAL PARAMETERS +------------------- +name:: + If supplied, use the name and not the object id as the package name. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Ensure zsh in installed +__package_pacman zsh --state installed + +# If you don't want to follow pythonX packages, but always use python +__package_pacman python --state installed --name python2 + +# Remove obsolete package +__package_pacman puppet --state deinstalled +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__package(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__package_yum/parameter/optional b/conf/type/__package_yum/parameter/optional new file mode 100644 index 00000000..f121bdbf --- /dev/null +++ b/conf/type/__package_yum/parameter/optional @@ -0,0 +1 @@ +name diff --git a/conf/type/__package_yum/parameter/required b/conf/type/__package_yum/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__package_yum/parameter/required @@ -0,0 +1 @@ +state From d9e2493eb996e164a27826779477ce93a84cdda3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:13:44 +0200 Subject: [PATCH 0488/5465] add fedora support to __package Signed-off-by: Nico Schottelius --- conf/type/__package/manifest | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/type/__package/manifest b/conf/type/__package/manifest index d8b55814..f41cceac 100755 --- a/conf/type/__package/manifest +++ b/conf/type/__package/manifest @@ -33,6 +33,7 @@ else archlinux) type="pacman" ;; debian|ubuntu) type="apt" ;; gentoo) type="emerge" ;; + fedora) type="yum" ;; *) echo "Don't know how to manage packages on: $os" >&2 exit 1 From 981df12e9a341c38b279726c62832f1150a2e1f0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:15:26 +0200 Subject: [PATCH 0489/5465] document changes Signed-off-by: Nico Schottelius --- doc/changelog | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/changelog b/doc/changelog index c54a5358..fe22e838 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,7 +1,9 @@ 1.6.0: + * New Type __package_yum + * New type __debconf_set_selections + * Type __package gained Fedora support * Removed --preseed support from __package_apt - * New type __debconf_set_selections which allows to preseed debian packages - * Explorer/os: Support Fedora + * explorer/os: gained Fedora support 1.5.0: 2011-04-01 * Add basic cache functionality From bcc7d0e795360489b61568f6ff108f8799ea2488 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:19:30 +0200 Subject: [PATCH 0490/5465] cleanup of gencode-remote Signed-off-by: Nico Schottelius --- conf/type/__package_yum/gencode-remote | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/conf/type/__package_yum/gencode-remote b/conf/type/__package_yum/gencode-remote index 536b7708..e20e0001 100755 --- a/conf/type/__package_yum/gencode-remote +++ b/conf/type/__package_yum/gencode-remote @@ -18,15 +18,9 @@ # along with cdist. If not, see . # # -# Manage packages with Pacman (mostly archlinux) +# Manage packages with yum (mostly Fedora) # -# Debug -# exec >&2 -# set -x - -pacopts="--noconfirm --noprogressbar" - if [ -f "$__object/parameter/name" ]; then name="$__object/parameter/name" else @@ -34,19 +28,17 @@ else fi state="$(cat "$__object/parameter/state")" -pkg_version="$(cat "$__object/explorer/pkg_version")" +opts="--assumeyes --quiet" case "$state" in installed) - - # Empty? Not installed. - if [ -z "$pkg_version" ]; then - echo pacman "$pacopts" -S \"$name\" + if grep -q "is not installed\$" "$__object/explorer/pkg_version"; then + echo yum $opts install \"$name\" fi ;; uninstalled) - if [ "$pkg_version" ]; then - echo pacman "$pacopts" -R \"$name\" + if ! grep -q "is not installed\$" "$__object/explorer/pkg_version"; then + echo yum $opts remove \"$name\" fi ;; esac From a778dee9fcdbc4d97f15b6a1832e3e1fe97b4ed1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:19:47 +0200 Subject: [PATCH 0491/5465] use rpm -q to get status Signed-off-by: Nico Schottelius --- conf/type/__package_yum/explorer/pkg_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__package_yum/explorer/pkg_version b/conf/type/__package_yum/explorer/pkg_version index 4f612423..66f76f12 100755 --- a/conf/type/__package_yum/explorer/pkg_version +++ b/conf/type/__package_yum/explorer/pkg_version @@ -27,4 +27,4 @@ else name="$__object_id" fi -pacman -Q "$name" 2>/dev/null | awk '{ print $2 }' +rpm -q "$name" 2>/dev/null || true From 740d279753e09c9178cdcc43f4302a86a1d331ba Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:20:19 +0200 Subject: [PATCH 0492/5465] add fedora to readme Signed-off-by: Nico Schottelius --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 26cd1ef2..e8f6e0bf 100644 --- a/README +++ b/README @@ -59,6 +59,7 @@ cdist was tested or is know to run on at least * [Archlinux](http://www.archlinux.org/) * [Debian](http://www.debian.org/) + * [Fedora](http://fedoraproject.org/) * [Gentoo](http://www.gentoo.org/) * [Mac OS X](http://www.apple.com/macosx/) * [OpenBSD](http://www.openbsd.org) From c532a2ccd3d19ebd36466be9231c68be7a68bbb7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:22:08 +0200 Subject: [PATCH 0493/5465] remove one Error of Error: Error: /home/users/nico/oeffentlich/rechner/projekte/cdist-used/conf/type/__nico_desktop/manifest exited non-zero. Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index fac1b5c6..026d8419 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -158,7 +158,7 @@ __cdist_debug_echo() __cdist_exec_fail_on_error() { sh -e "$@" - [ "$?" -eq 0 ] || __cdist_exit_err "Error: $1 exited non-zero." + [ "$?" -eq 0 ] || __cdist_exit_err "$1 exited non-zero." } __cdist_exit_err() From 13f4140b3df9e6204451d444bdb6f504fd81771b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:26:42 +0200 Subject: [PATCH 0494/5465] update manpage for __package_yum Signed-off-by: Nico Schottelius --- conf/type/__package_yum/man.text | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/conf/type/__package_yum/man.text b/conf/type/__package_yum/man.text index 35a7e44c..262068c6 100644 --- a/conf/type/__package_yum/man.text +++ b/conf/type/__package_yum/man.text @@ -1,17 +1,16 @@ -cdist-type__package_pacman(7) -============================= +cdist-type__package_yum(7) +========================== Nico Schottelius NAME ---- -cdist-type__package_pacman - Manage packages with pacman +cdist-type__package_yum - Manage packages with yum DESCRIPTION ----------- -Pacman is usually used on the Archlinux distribution to manage -packages. +Yum is usually used on the Fedora distribution to manage packages. REQUIRED PARAMETERS @@ -31,13 +30,13 @@ EXAMPLES -------------------------------------------------------------------------------- # Ensure zsh in installed -__package_pacman zsh --state installed +__package_yum zsh --state installed # If you don't want to follow pythonX packages, but always use python -__package_pacman python --state installed --name python2 +__package_yum python --state installed --name python2 # Remove obsolete package -__package_pacman puppet --state deinstalled +__package_yum puppet --state deinstalled -------------------------------------------------------------------------------- From 44b11b99198ecdef188fb6819a9ff3a3de7b9d8b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:34:35 +0200 Subject: [PATCH 0495/5465] yum is funny Signed-off-by: Nico Schottelius --- doc/dev/logs/2011-04-02.yum | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/dev/logs/2011-04-02.yum diff --git a/doc/dev/logs/2011-04-02.yum b/doc/dev/logs/2011-04-02.yum new file mode 100644 index 00000000..dd3687c8 --- /dev/null +++ b/doc/dev/logs/2011-04-02.yum @@ -0,0 +1,9 @@ +Fun with yum: + +[root@brett ~]# yum --assumeyes --quiet install "vim" +Package 2:vim-enhanced-7.3.056-1.fc14.x86_64 already installed and latest version +[root@brett ~]# rpm -q vim +package vim is not installed +[root@brett ~]# + +(Me || yum) == dumb? From aedbc263d7325381a8bed03e24c31dbcf810e7d0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:49:57 +0200 Subject: [PATCH 0496/5465] need to use --whatprovides This ensure we also check for other packages which are used instead of the requested one, which does not work with rpm -q: [root@brett ~]# rpm -q vim package vim is not installed [root@brett ~]# yum --assumeyes --quiet install "vim" Package 2:vim-enhanced-7.3.056-1.fc14.x86_64 already installed and latest version [root@brett ~]# rpm -q --whatprovides vim vim-enhanced-7.3.056-1.fc14.x86_64 Signed-off-by: Nico Schottelius --- conf/type/__package_yum/explorer/pkg_version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__package_yum/explorer/pkg_version b/conf/type/__package_yum/explorer/pkg_version index 66f76f12..0e078f68 100755 --- a/conf/type/__package_yum/explorer/pkg_version +++ b/conf/type/__package_yum/explorer/pkg_version @@ -27,4 +27,4 @@ else name="$__object_id" fi -rpm -q "$name" 2>/dev/null || true +rpm -q --whatprovides "$name" 2>/dev/null || true From 0b7024a2cc3449e2610fdd63dd57731ad1ebded5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:53:07 +0200 Subject: [PATCH 0497/5465] adjust grep string Signed-off-by: Nico Schottelius --- conf/type/__package_yum/gencode-remote | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/conf/type/__package_yum/gencode-remote b/conf/type/__package_yum/gencode-remote index e20e0001..7d0d60b8 100755 --- a/conf/type/__package_yum/gencode-remote +++ b/conf/type/__package_yum/gencode-remote @@ -29,15 +29,20 @@ fi state="$(cat "$__object/parameter/state")" +cat "$__object/explorer/pkg_version" + opts="--assumeyes --quiet" + +not_installed="^no package provides" + case "$state" in installed) - if grep -q "is not installed\$" "$__object/explorer/pkg_version"; then + if grep -q "$not_installed" "$__object/explorer/pkg_version"; then echo yum $opts install \"$name\" fi ;; uninstalled) - if ! grep -q "is not installed\$" "$__object/explorer/pkg_version"; then + if ! grep -q "$not_installed" "$__object/explorer/pkg_version"; then echo yum $opts remove \"$name\" fi ;; From 4ab1fdceff36c983f07960d2a151560d668ecb60 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 02:57:02 +0200 Subject: [PATCH 0498/5465] remove evil debug Signed-off-by: Nico Schottelius --- conf/type/__package_yum/gencode-remote | 2 -- 1 file changed, 2 deletions(-) diff --git a/conf/type/__package_yum/gencode-remote b/conf/type/__package_yum/gencode-remote index 7d0d60b8..033298b1 100755 --- a/conf/type/__package_yum/gencode-remote +++ b/conf/type/__package_yum/gencode-remote @@ -29,8 +29,6 @@ fi state="$(cat "$__object/parameter/state")" -cat "$__object/explorer/pkg_version" - opts="--assumeyes --quiet" not_installed="^no package provides" From 5f0ecb0831157bf0b5112afc6c4344adfc05cc3a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 03:12:31 +0200 Subject: [PATCH 0499/5465] yum confuses me, document it, so others are saved Signed-off-by: Nico Schottelius --- conf/type/__package_yum/man.text | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/type/__package_yum/man.text b/conf/type/__package_yum/man.text index 262068c6..b2f57606 100644 --- a/conf/type/__package_yum/man.text +++ b/conf/type/__package_yum/man.text @@ -11,6 +11,8 @@ cdist-type__package_yum - Manage packages with yum DESCRIPTION ----------- Yum is usually used on the Fedora distribution to manage packages. +If you specify an unknown package, yum will display the +slightly confusing error message "Error: Nothing to do". REQUIRED PARAMETERS From 762fa52638c2bd6c080396121377ab3eec005ac4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 03:30:35 +0200 Subject: [PATCH 0500/5465] fixup cdist-reference: match only on .7 now, otherwise .html and .text is shown in manpage Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 6358db9c..936e0bba 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -187,7 +187,7 @@ SEE ALSO -------- - cdist(7) eof -for type in man7/cdist-type__*; do +for type in man7/cdist-type__*.7; do name_1="${type#man7/}" name_2="${name_1%.7}" From 21aacd44b44c70e319c2c4991f9ee998666dfa92 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 03:36:41 +0200 Subject: [PATCH 0501/5465] remove double information from reference Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 936e0bba..8fb24362 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -135,19 +135,8 @@ tmp_dir:: TYPES ----- -The following types are available: - -eof -for type in man7/cdist-type__*; do - name_1="${type#man7/cdist-type}" - name_2="${name_1%.7}" - - name="$name_2" - echo "- $name" -done - -cat << eof - +The available types are listed in the SEE ALSO section +and are referenced as cdist-type__TYPENAME. VARIABLES --------- From 18e433dd859644a8d69c07ff2a22e14c2091d963 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 14:24:20 +0200 Subject: [PATCH 0502/5465] import corrected __group from nico/nico Signed-off-by: Nico Schottelius --- conf/type/__group/gencode-remote | 45 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/conf/type/__group/gencode-remote b/conf/type/__group/gencode-remote index 527a6079..ac7e0ebb 100755 --- a/conf/type/__group/gencode-remote +++ b/conf/type/__group/gencode-remote @@ -1,6 +1,7 @@ #!/bin/sh # # 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# 2011 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -23,16 +24,6 @@ name="$__object_id" -command= -if grep -q "^$name" "$__object/explorer/group"; then - # group exists - command="groupmod" -else - # group does not exist - command="groupadd" -fi - - get_current_value() { local key="$1" local index @@ -46,21 +37,29 @@ get_current_value() { cut -d':' -f $index "$__object/explorer/group" } - set -- "$@" cd "$__object/parameter" -for property in $(ls .); do - current_value=$(get_current_value "$property") - new_value="$(cat "$property")" - if [ "$new_value" != "$current_value" ]; then - # Shedule changed properties for update - set -- "$@" "--$property" \"$new_value\" + +if grep -q "^$name" "$__object/explorer/group"; then + # group exists, only change changed values + for property in $(ls .); do + current_value=$(get_current_value "$property") + new_value="$(cat "$property")" + if [ "$new_value" != "$current_value" ]; then + # Shedule changed properties for update + set -- "$@" "--$property" \"$new_value\" + fi + done + + if [ $# -gt 0 ]; then + # Update changed properties + echo groupmod $@ $name fi -done +else + for property in $(ls .); do + new_value="$(cat "$property")" + set -- "$@" "--$property" \"$new_value\" + done - -if [ $# -gt 0 ]; then - # Update changed properties - echo $command $@ $name + echo groupadd "$@" "$name" fi - From 69a17d0b0e6d9f12cbf743ce739aaef3caf93d65 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 14:25:00 +0200 Subject: [PATCH 0503/5465] remove unecessary set -- "$@" Signed-off-by: Nico Schottelius --- conf/type/__group/gencode-remote | 2 -- 1 file changed, 2 deletions(-) diff --git a/conf/type/__group/gencode-remote b/conf/type/__group/gencode-remote index ac7e0ebb..35df5424 100755 --- a/conf/type/__group/gencode-remote +++ b/conf/type/__group/gencode-remote @@ -37,9 +37,7 @@ get_current_value() { cut -d':' -f $index "$__object/explorer/group" } -set -- "$@" cd "$__object/parameter" - if grep -q "^$name" "$__object/explorer/group"; then # group exists, only change changed values for property in $(ls .); do From 252b511da7c4157b8950364cebc0ad6747965463 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 14:31:50 +0200 Subject: [PATCH 0504/5465] done++ Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index fe22e838..a1f218e8 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.6.0: * New Type __package_yum * New type __debconf_set_selections + * Fix Type __group in case of __group NAME syntax * Type __package gained Fedora support * Removed --preseed support from __package_apt * explorer/os: gained Fedora support From 1310a1e42b3f0af84e7e5b8bb3299bd928ea60a8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 2 Apr 2011 14:40:31 +0200 Subject: [PATCH 0505/5465] ++todo Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 7a8c4583..ad6561a6 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -26,13 +26,14 @@ CORE TYPES ------ -Types to be written/extended: - - __ssh-keys (host/user) - - Think about __service - necessary? - - __file_edit - - regexp replace (can probably cover all?) - -> aka sed. - - __cron +- __ssh-keys (host/user) +- __file_edit + - regexp replace (can probably cover all?) + -> aka sed. +- __cron +- __user: + add option to include --create-home + fix __user NAME case (same issue as __group) DOCUMENTATION -------------- From de879bf5215db28d82631fc3ec495233aad84c8f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 09:45:25 +0200 Subject: [PATCH 0506/5465] emphasise SSH Signed-off-by: Nico Schottelius --- README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README b/README index e8f6e0bf..aba67707 100644 --- a/README +++ b/README @@ -31,7 +31,7 @@ Here are some features that makes it unique: Keywords | Description Simplicity | There is only one type to extend cdist called ***type*** Design | Type and core cleanly seperated -Design | cdist sticks completly to the KISS (keep it simple and stupid) paradigma +Design | Sticks completly to the KISS (keep it simple and stupid) paradigma Design | Meaningful error messages - do not lose time debugging error messages Design | Consistency in behaviour, naming and documentation Design | No surprise factor: Only do what is obviously clear, no magic @@ -40,8 +40,8 @@ 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 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 | cdist requires only SSH and a shell on the target -Requirements | +Requirements, Security | Uses well-know [SSH](http://www.openssh.com/) 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 written in POSIX shell From 674e1f58f8ff8924efe5d322d062451a1fa4b1e2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 09:45:52 +0200 Subject: [PATCH 0507/5465] todo for 1.6 Signed-off-by: Nico Schottelius --- doc/dev/todo/1.6 | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/dev/todo/1.6 diff --git a/doc/dev/todo/1.6 b/doc/dev/todo/1.6 new file mode 100644 index 00000000..1be7274f --- /dev/null +++ b/doc/dev/todo/1.6 @@ -0,0 +1 @@ +- adjust documentation / stages From 4b76d8a7e087fe280cc11d8d91b99359b6fbac89 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 10:45:41 +0200 Subject: [PATCH 0508/5465] __user: remove =~, cleanup and beautify, replace cut with awk Signed-off-by: Nico Schottelius --- conf/type/__user/gencode-remote | 96 +++++++++++++++------------------ 1 file changed, 43 insertions(+), 53 deletions(-) diff --git a/conf/type/__user/gencode-remote b/conf/type/__user/gencode-remote index c53d8c40..c7dbac41 100755 --- a/conf/type/__user/gencode-remote +++ b/conf/type/__user/gencode-remote @@ -23,60 +23,50 @@ name="$__object_id" -command= -if grep -q "^$name" "$__object/explorer/passwd"; then - # user exists - command="usermod" -else - # user does not exist - command="useradd" -fi - - -get_current_value() { - local key="$1" - local new_value="$2" - - local explorer="$__object/explorer/passwd" - local index - case "$key" in - password) - explorer="$__object/explorer/shadow" - index=2 - ;; - uid) index=3;; - gid) - if [[ $new_value =~ ^[0-9]+$ ]]; then - # numeric gid - index=4 - else - # group name - explorer="$__object/explorer/group" - index=1 - fi - ;; - comment) index=5;; - home) index=6;; - shell) index=7;; - esac - cut -d':' -f $index "$explorer" -} - - -set -- "$@" cd "$__object/parameter" -for property in $(ls .); do - new_value="$(cat "$property")" - current_value=$(get_current_value "$property" "$new_value") - if [ "$new_value" != "$current_value" ]; then - # Shedule changed properties for update - set -- "$@" "--$property" \"$new_value\" +if grep -q "^${name}:" "$__object/explorer/passwd"; then + for property in $(ls .); do + new_value="$(cat "$property")" + + file="$__object/explorer/passwd" + + case "$key" in + password) + field=3 + file="$__object/explorer/shadow" + ;; + gid) + if $(echo "$new_value" | grep -q '^[0-9][0-9]*$'); then + field=4 + else + # group name + file="$__object/explorer/group" + field=1 + fi + ;; + uid) field=3 ;; + comment) field=5 ;; + home) field=6 ;; + shell) field=7 ;; + esac + + current_value="$(awk -F: '{ print $ENVIRON["field"] }' < "$file")" + + if [ "$new_value" != "$current_value" ]; then + # Shedule changed properties for update + set -- "$@" "--$property" \"$new_value\" + fi + done + + if [ $# -gt 0 ]; then + # Update changed properties + echo usermod "$@" "$name" fi -done +else + for property in $(ls .); do + new_value="$(cat "$property")" + set -- "$@" "--$property" \"$new_value\" + done - -if [ $# -gt 0 ]; then - # Update changed properties - echo $command $@ $name + echo useradd "$@" "$name" fi - From db425d39254c35c8fa8ba85678dafced87ef64ba Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 10:59:04 +0200 Subject: [PATCH 0509/5465] use property, not key anymore Signed-off-by: Nico Schottelius --- conf/type/__user/gencode-remote | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/conf/type/__user/gencode-remote b/conf/type/__user/gencode-remote index c7dbac41..8f4222c3 100755 --- a/conf/type/__user/gencode-remote +++ b/conf/type/__user/gencode-remote @@ -1,6 +1,7 @@ #!/bin/sh # # 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# 2011 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -30,7 +31,7 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then file="$__object/explorer/passwd" - case "$key" in + case "$property" in password) field=3 file="$__object/explorer/shadow" @@ -50,18 +51,15 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then shell) field=7 ;; esac + export field current_value="$(awk -F: '{ print $ENVIRON["field"] }' < "$file")" if [ "$new_value" != "$current_value" ]; then - # Shedule changed properties for update set -- "$@" "--$property" \"$new_value\" fi done - if [ $# -gt 0 ]; then - # Update changed properties - echo usermod "$@" "$name" - fi + [ $# -gt 0 ] && echo usermod "$@" "$name" else for property in $(ls .); do new_value="$(cat "$property")" From d49e481a87d920fab6dc157e663cdf6d324c61fd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 11:00:15 +0200 Subject: [PATCH 0510/5465] match on name: not name, may be invalid Signed-off-by: Nico Schottelius --- conf/type/__group/gencode-remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__group/gencode-remote b/conf/type/__group/gencode-remote index 35df5424..a8a8397d 100755 --- a/conf/type/__group/gencode-remote +++ b/conf/type/__group/gencode-remote @@ -38,7 +38,7 @@ get_current_value() { } cd "$__object/parameter" -if grep -q "^$name" "$__object/explorer/group"; then +if grep -q "^${name}:" "$__object/explorer/group"; then # group exists, only change changed values for property in $(ls .); do current_value=$(get_current_value "$property") From e464c5aaa223f3cfe80f20c3d42a1eb2b928adad Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 11:04:00 +0200 Subject: [PATCH 0511/5465] simplify Signed-off-by: Nico Schottelius --- conf/type/__group/gencode-remote | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/conf/type/__group/gencode-remote b/conf/type/__group/gencode-remote index a8a8397d..4cb05762 100755 --- a/conf/type/__group/gencode-remote +++ b/conf/type/__group/gencode-remote @@ -24,35 +24,26 @@ name="$__object_id" -get_current_value() { - local key="$1" - local index - case "$key" in - password) - cut -d':' -f 2 "$__object/explorer/gshadow" - break - ;; - gid) index=3;; - esac - cut -d':' -f $index "$__object/explorer/group" -} - cd "$__object/parameter" if grep -q "^${name}:" "$__object/explorer/group"; then - # group exists, only change changed values for property in $(ls .); do - current_value=$(get_current_value "$property") new_value="$(cat "$property")" + + case "$key" in + password) + current_value="$(awk -F: '{ print $2 }' < "$__object/explorer/gshadow")" + ;; + gid) + current_value="$(awk -F: '{ print $3 }' < "$__object/explorer/group")" + ;; + esac + if [ "$new_value" != "$current_value" ]; then - # Shedule changed properties for update set -- "$@" "--$property" \"$new_value\" fi done - if [ $# -gt 0 ]; then - # Update changed properties - echo groupmod $@ $name - fi + [ $# -gt 0 ] && echo groupmod $@ $name else for property in $(ls .); do new_value="$(cat "$property")" From 324fc13927b06ab201042e0e19912dd2e025dcd6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 11:07:15 +0200 Subject: [PATCH 0512/5465] +changes Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index a1f218e8..f0641509 100644 --- a/doc/changelog +++ b/doc/changelog @@ -5,6 +5,7 @@ * Type __package gained Fedora support * Removed --preseed support from __package_apt * explorer/os: gained Fedora support + * Simplified types __user and __group 1.5.0: 2011-04-01 * Add basic cache functionality From a60e2838e324fe92e0bac7c12f46dc81d6509eff Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 4 Apr 2011 11:54:42 +0200 Subject: [PATCH 0513/5465] update .gitignore to match new man page locations Signed-off-by: Steven Armstrong --- .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 68f829dc..778fc944 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,12 @@ # Ignore generated manpages doc/man/.marker -doc/man/man*/ +doc/man/man*/*.1 +doc/man/man*/*.7 +doc/man/man*/*.html +doc/man/man*/*.xml +# Ignore type manpages +doc/man/man*/*__*.text # Ignore cache for version control cache/ From fc1000994677ff1aeeea30a6fa5c5cee03003e0a Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 4 Apr 2011 11:59:30 +0200 Subject: [PATCH 0514/5465] update and merge ignore files Signed-off-by: Steven Armstrong --- .gitignore | 1 + doc/man/.gitignore | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 doc/man/.gitignore diff --git a/.gitignore b/.gitignore index 778fc944..15be6dc2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ doc/man/man*/*.1 doc/man/man*/*.7 doc/man/man*/*.html doc/man/man*/*.xml +doc/man/man*/cdist-reference.text # Ignore type manpages doc/man/man*/*__*.text diff --git a/doc/man/.gitignore b/doc/man/.gitignore deleted file mode 100644 index 8ed9d1e1..00000000 --- a/doc/man/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -cdist.7 -*.html -cdist-design.7 -cdist-reference.text From 74e3447c40cb0497f13ec22f2faf38f80a5be7fe Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 12:04:10 +0200 Subject: [PATCH 0515/5465] add example multi branch .git/config Signed-off-by: Nico Schottelius --- doc/man/man7/cdist-best-practice.text | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/man/man7/cdist-best-practice.text b/doc/man/man7/cdist-best-practice.text index aa499790..5ec01d5f 100644 --- a/doc/man/man7/cdist-best-practice.text +++ b/doc/man/man7/cdist-best-practice.text @@ -102,6 +102,39 @@ git checkout private git merge common -------------------------------------------------------------------------------- +The following **.git/config** is taken from a a real world scenario: +-------------------------------------------------------------------------------- +# Track upstream, merge from time to time +[remote "upstream"] + url = git://git.schottelius.org/cdist + fetch = +refs/heads/*:refs/remotes/upstream/* + +# Same as upstream, but works when being offline +[remote "local"] + fetch = +refs/heads/*:refs/remotes/local/* + url = /home/users/nico/p/cdist + +# Remote containing various ETH internal branches +[remote "eth"] + url = sans.ethz.ch:/home/services/sans/git/cdist-eth + fetch = +refs/heads/*:refs/remotes/eth/* + +# Public remote that contains my private changes to cdist upstream +[remote "nico"] + url = git.schottelius.org:/home/services/git/cdist-nico + fetch = +refs/heads/*:refs/remotes/nico/* + +# The "nico" branch will be synced with the remote nico, branch master +[branch "nico"] + remote = nico + merge = refs/heads/master + +# ETH stable contains rock solid configurations used in various places +[branch "eth-stable"] + remote = eth + merge = refs/heads/stable +-------------------------------------------------------------------------------- + Have a look at git-remote(1) to adjust the remote configuration, which allows you to push certain branches to certain remotes. From a28ac9bedca9581b1c28d8af44f66bf8280094a8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 12:15:13 +0200 Subject: [PATCH 0516/5465] ++todo 1.6 Signed-off-by: Nico Schottelius --- doc/dev/todo/1.6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/1.6 b/doc/dev/todo/1.6 index 1be7274f..12a83e93 100644 --- a/doc/dev/todo/1.6 +++ b/doc/dev/todo/1.6 @@ -1 +1,3 @@ -- adjust documentation / stages +Documentation: + - update stages + - go through all manpages and ensure __ and co are correct From 09bf63ffca43d10320f20fd41dfb0943275ccf9f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 12:19:02 +0200 Subject: [PATCH 0517/5465] [DOC] remove some formatting issues in cdist-reference Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 8fb24362..a5d1698a 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -45,9 +45,11 @@ cdist-reference - Variable, path and type reference for cdist DESCRIPTION ----------- -Various scripts which are not in the core need information on how -to find information. This manpage summarises the available environment -variables, types and paths and clearifies with part may access which variables. +This reference summarises + +- environment variables +- paths +- types PATHS @@ -62,7 +64,6 @@ conf/manifest/init:: It is an executable (+x bit set) shell script that can use values from the explorers to decide which configuration to create for the specified target host. - It should be primary used to define mapping from configurations to hosts. conf/manifest/*:: @@ -103,15 +104,12 @@ conf/type//parameters/optional:: conf/type//explorer:: Location of the type specific explorers. - This directory is referenced by the variable __type_explorer (see below). - See cdist-explorer(7). out/:: This directory contains output of cdist and is usually located in a temporary directory and thus will be removed after the run. - This directory is referenced by the variable __global (see below). out/explorer:: @@ -122,7 +120,6 @@ out/object:: out/object/:: Contains all object specific information. - This directory is referenced by the variable __object (see below). out/object//explorers:: @@ -138,8 +135,8 @@ TYPES The available types are listed in the SEE ALSO section and are referenced as cdist-type__TYPENAME. -VARIABLES ---------- +ENVIRONMENT VARIABLES +--------------------- __explorer:: Directory that contains all explorers. Available for: explorer From 785ec3f36ff7315012cf0ac037a5e01d8a2210cd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 13:20:22 +0200 Subject: [PATCH 0518/5465] sort fields by alphabet Signed-off-by: Nico Schottelius --- conf/type/__user/gencode-remote | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf/type/__user/gencode-remote b/conf/type/__user/gencode-remote index 8f4222c3..7670b943 100755 --- a/conf/type/__user/gencode-remote +++ b/conf/type/__user/gencode-remote @@ -32,10 +32,6 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then file="$__object/explorer/passwd" case "$property" in - password) - field=3 - file="$__object/explorer/shadow" - ;; gid) if $(echo "$new_value" | grep -q '^[0-9][0-9]*$'); then field=4 @@ -45,10 +41,14 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then field=1 fi ;; - uid) field=3 ;; + password) + field=3 + file="$__object/explorer/shadow" + ;; comment) field=5 ;; home) field=6 ;; shell) field=7 ;; + uid) field=3 ;; esac export field From 654512c2096cedff06aa696e407f995034572397 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 23:50:48 +0200 Subject: [PATCH 0519/5465] add template for __package_openbsd_pkg Signed-off-by: Nico Schottelius --- .../explorer/pkg_version | 30 +++++++++++ .../type/__package_openbsd_pkg/gencode-remote | 52 ++++++++++++++++++ conf/type/__package_openbsd_pkg/man.text | 53 +++++++++++++++++++ .../__package_openbsd_pkg/parameter/optional | 1 + .../__package_openbsd_pkg/parameter/required | 1 + 5 files changed, 137 insertions(+) create mode 100755 conf/type/__package_openbsd_pkg/explorer/pkg_version create mode 100755 conf/type/__package_openbsd_pkg/gencode-remote create mode 100644 conf/type/__package_openbsd_pkg/man.text create mode 100644 conf/type/__package_openbsd_pkg/parameter/optional create mode 100644 conf/type/__package_openbsd_pkg/parameter/required diff --git a/conf/type/__package_openbsd_pkg/explorer/pkg_version b/conf/type/__package_openbsd_pkg/explorer/pkg_version new file mode 100755 index 00000000..4f612423 --- /dev/null +++ b/conf/type/__package_openbsd_pkg/explorer/pkg_version @@ -0,0 +1,30 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Retrieve the status of a package - parsed dpkg output +# + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +pacman -Q "$name" 2>/dev/null | awk '{ print $2 }' diff --git a/conf/type/__package_openbsd_pkg/gencode-remote b/conf/type/__package_openbsd_pkg/gencode-remote new file mode 100755 index 00000000..536b7708 --- /dev/null +++ b/conf/type/__package_openbsd_pkg/gencode-remote @@ -0,0 +1,52 @@ +#!/bin/sh +# +# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Manage packages with Pacman (mostly archlinux) +# + +# Debug +# exec >&2 +# set -x + +pacopts="--noconfirm --noprogressbar" + +if [ -f "$__object/parameter/name" ]; then + name="$__object/parameter/name" +else + name="$__object_id" +fi + +state="$(cat "$__object/parameter/state")" +pkg_version="$(cat "$__object/explorer/pkg_version")" + +case "$state" in + installed) + + # Empty? Not installed. + if [ -z "$pkg_version" ]; then + echo pacman "$pacopts" -S \"$name\" + fi + ;; + uninstalled) + if [ "$pkg_version" ]; then + echo pacman "$pacopts" -R \"$name\" + fi + ;; +esac diff --git a/conf/type/__package_openbsd_pkg/man.text b/conf/type/__package_openbsd_pkg/man.text new file mode 100644 index 00000000..35a7e44c --- /dev/null +++ b/conf/type/__package_openbsd_pkg/man.text @@ -0,0 +1,53 @@ +cdist-type__package_pacman(7) +============================= +Nico Schottelius + + +NAME +---- +cdist-type__package_pacman - Manage packages with pacman + + +DESCRIPTION +----------- +Pacman is usually used on the Archlinux distribution to manage +packages. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "installed" or "deinstalled". + + +OPTIONAL PARAMETERS +------------------- +name:: + If supplied, use the name and not the object id as the package name. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Ensure zsh in installed +__package_pacman zsh --state installed + +# If you don't want to follow pythonX packages, but always use python +__package_pacman python --state installed --name python2 + +# Remove obsolete package +__package_pacman puppet --state deinstalled +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__package(7) + + +COPYING +------- +Copyright \(C) 2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__package_openbsd_pkg/parameter/optional b/conf/type/__package_openbsd_pkg/parameter/optional new file mode 100644 index 00000000..f121bdbf --- /dev/null +++ b/conf/type/__package_openbsd_pkg/parameter/optional @@ -0,0 +1 @@ +name diff --git a/conf/type/__package_openbsd_pkg/parameter/required b/conf/type/__package_openbsd_pkg/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__package_openbsd_pkg/parameter/required @@ -0,0 +1 @@ +state From 02da74e4374732ba4e8060ed446e5960ac70d811 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 4 Apr 2011 23:57:36 +0200 Subject: [PATCH 0520/5465] add explorer os_version supporting openbsd Signed-off-by: Nico Schottelius --- conf/explorer/os_version | 97 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100755 conf/explorer/os_version diff --git a/conf/explorer/os_version b/conf/explorer/os_version new file mode 100755 index 00000000..d4dd2bc9 --- /dev/null +++ b/conf/explorer/os_version @@ -0,0 +1,97 @@ +#!/bin/sh +# +# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# All os variables are lower case +# +# + +case "$($__explorer/os)" in + openbsd) + uname -r + ;; +esac + +exit 0 + +# Ubuntu is also Debian, thus return if Ubuntu was found +if grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null; then + echo ubuntu + exit 0 +fi + +if [ -f /etc/arch-release ]; then + echo archlinux + exit 0 +fi + +if [ -f /etc/debian_version ]; then + echo debian + exit 0 +fi + +if [ -f /etc/gentoo-release ]; then + echo gentoo + exit 0 +fi + +# Fedora is also Redhat, thus return before redhat! +if grep -q ^Fedora /etc/redhat-release 2>/dev/null; then + echo fedora + exit 0 +fi + +if [ -f /etc/redhat-release ]; then + echo redhat + exit 0 +fi + +if [ -f /etc/SuSE-release ]; then + echo suse + exit 0 +fi + +uname_s="$(uname -s)" + +# Assume there is no tr on the client -> do lower case ourselves +case "$uname_s" in + Darwin) + echo macosx + exit 0 + ;; + NetBSD) + echo netbsd + exit 0 + ;; + FreeBSD) + echo freebsd + exit 0 + ;; + OpenBSD) + echo openbsd + exit 0 + ;; + SunOS) + echo solaris + exit 0 + ;; +esac + +echo "Unknown OS" >&2 +exit 1 From b474960774607c03e96b967374478a1bb8c79e6e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 00:03:23 +0200 Subject: [PATCH 0521/5465] explorer os_version supports macosx Signed-off-by: Nico Schottelius --- conf/explorer/os_version | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/conf/explorer/os_version b/conf/explorer/os_version index d4dd2bc9..02e2e2cd 100755 --- a/conf/explorer/os_version +++ b/conf/explorer/os_version @@ -23,7 +23,11 @@ # case "$($__explorer/os)" in - openbsd) + archlinux) + # empty, but well... + cat /etc/arch-release + ;; + macosx|openbsd) uname -r ;; esac @@ -36,11 +40,6 @@ if grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null; then exit 0 fi -if [ -f /etc/arch-release ]; then - echo archlinux - exit 0 -fi - if [ -f /etc/debian_version ]; then echo debian exit 0 @@ -71,10 +70,6 @@ uname_s="$(uname -s)" # Assume there is no tr on the client -> do lower case ourselves case "$uname_s" in - Darwin) - echo macosx - exit 0 - ;; NetBSD) echo netbsd exit 0 From edfedc5c064d38157f2abe5306297866e7e74b91 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 00:10:26 +0200 Subject: [PATCH 0522/5465] in theory finish os_version Signed-off-by: Nico Schottelius --- conf/explorer/os_version | 73 +++++++++------------------------------- 1 file changed, 16 insertions(+), 57 deletions(-) diff --git a/conf/explorer/os_version b/conf/explorer/os_version index 02e2e2cd..5f7120c0 100755 --- a/conf/explorer/os_version +++ b/conf/explorer/os_version @@ -27,66 +27,25 @@ case "$($__explorer/os)" in # empty, but well... cat /etc/arch-release ;; - macosx|openbsd) + debian) + cat /etc/debian_version + ;; + fedora) + cat /etc/fedora-release + ;; + gentoo) + cat /etc/gentoo-release + ;; + macosx|*bsd|solaris) uname -r ;; -esac - -exit 0 - -# Ubuntu is also Debian, thus return if Ubuntu was found -if grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null; then - echo ubuntu - exit 0 -fi - -if [ -f /etc/debian_version ]; then - echo debian - exit 0 -fi - -if [ -f /etc/gentoo-release ]; then - echo gentoo - exit 0 -fi - -# Fedora is also Redhat, thus return before redhat! -if grep -q ^Fedora /etc/redhat-release 2>/dev/null; then - echo fedora - exit 0 -fi - -if [ -f /etc/redhat-release ]; then - echo redhat - exit 0 -fi - -if [ -f /etc/SuSE-release ]; then - echo suse - exit 0 -fi - -uname_s="$(uname -s)" - -# Assume there is no tr on the client -> do lower case ourselves -case "$uname_s" in - NetBSD) - echo netbsd - exit 0 + redhat) + cat /etc/redhat-release ;; - FreeBSD) - echo freebsd - exit 0 + suse) + cat /etc/SuSE-release ;; - OpenBSD) - echo openbsd - exit 0 - ;; - SunOS) - echo solaris - exit 0 + ubuntu) + lsb_release -sr ;; esac - -echo "Unknown OS" >&2 -exit 1 From 1a9901989133203d9552b027d66383660efb8148 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 00:11:19 +0200 Subject: [PATCH 0523/5465] more stuff todo Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index ad6561a6..3adf4561 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -24,6 +24,7 @@ CORE - probably remove or improve cdist-type-template + TYPES ------ - __ssh-keys (host/user) @@ -40,6 +41,7 @@ DOCUMENTATION - asciidoc interprets __, which we use for variables names -> seek through docs and replace with \_\_! - check all all internal variables are prefixed with __cdist +- reference explorers in cdist-reference! Cache: - add example how to use From 5710d9a60690656e5d820ef24acce7f104c842a1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 14:57:22 +0200 Subject: [PATCH 0524/5465] delay __package_openbsd_pkg / wait for input of justastudent Signed-off-by: Nico Schottelius --- .../explorer/pkg_version | 30 ----------- .../type/__package_openbsd_pkg/gencode-remote | 52 ------------------ conf/type/__package_openbsd_pkg/man.text | 53 ------------------- .../__package_openbsd_pkg/parameter/optional | 1 - .../__package_openbsd_pkg/parameter/required | 1 - 5 files changed, 137 deletions(-) delete mode 100755 conf/type/__package_openbsd_pkg/explorer/pkg_version delete mode 100755 conf/type/__package_openbsd_pkg/gencode-remote delete mode 100644 conf/type/__package_openbsd_pkg/man.text delete mode 100644 conf/type/__package_openbsd_pkg/parameter/optional delete mode 100644 conf/type/__package_openbsd_pkg/parameter/required diff --git a/conf/type/__package_openbsd_pkg/explorer/pkg_version b/conf/type/__package_openbsd_pkg/explorer/pkg_version deleted file mode 100755 index 4f612423..00000000 --- a/conf/type/__package_openbsd_pkg/explorer/pkg_version +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Retrieve the status of a package - parsed dpkg output -# - -if [ -f "$__object/parameter/name" ]; then - name="$(cat "$__object/parameter/name")" -else - name="$__object_id" -fi - -pacman -Q "$name" 2>/dev/null | awk '{ print $2 }' diff --git a/conf/type/__package_openbsd_pkg/gencode-remote b/conf/type/__package_openbsd_pkg/gencode-remote deleted file mode 100755 index 536b7708..00000000 --- a/conf/type/__package_openbsd_pkg/gencode-remote +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# -# 2011 Nico Schottelius (nico-cdist at schottelius.org) -# -# This file is part of cdist. -# -# cdist is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cdist is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cdist. If not, see . -# -# -# Manage packages with Pacman (mostly archlinux) -# - -# Debug -# exec >&2 -# set -x - -pacopts="--noconfirm --noprogressbar" - -if [ -f "$__object/parameter/name" ]; then - name="$__object/parameter/name" -else - name="$__object_id" -fi - -state="$(cat "$__object/parameter/state")" -pkg_version="$(cat "$__object/explorer/pkg_version")" - -case "$state" in - installed) - - # Empty? Not installed. - if [ -z "$pkg_version" ]; then - echo pacman "$pacopts" -S \"$name\" - fi - ;; - uninstalled) - if [ "$pkg_version" ]; then - echo pacman "$pacopts" -R \"$name\" - fi - ;; -esac diff --git a/conf/type/__package_openbsd_pkg/man.text b/conf/type/__package_openbsd_pkg/man.text deleted file mode 100644 index 35a7e44c..00000000 --- a/conf/type/__package_openbsd_pkg/man.text +++ /dev/null @@ -1,53 +0,0 @@ -cdist-type__package_pacman(7) -============================= -Nico Schottelius - - -NAME ----- -cdist-type__package_pacman - Manage packages with pacman - - -DESCRIPTION ------------ -Pacman is usually used on the Archlinux distribution to manage -packages. - - -REQUIRED PARAMETERS -------------------- -state:: - Either "installed" or "deinstalled". - - -OPTIONAL PARAMETERS -------------------- -name:: - If supplied, use the name and not the object id as the package name. - - -EXAMPLES --------- - --------------------------------------------------------------------------------- -# Ensure zsh in installed -__package_pacman zsh --state installed - -# If you don't want to follow pythonX packages, but always use python -__package_pacman python --state installed --name python2 - -# Remove obsolete package -__package_pacman puppet --state deinstalled --------------------------------------------------------------------------------- - - -SEE ALSO --------- -- cdist-type(7) -- cdist-type__package(7) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__package_openbsd_pkg/parameter/optional b/conf/type/__package_openbsd_pkg/parameter/optional deleted file mode 100644 index f121bdbf..00000000 --- a/conf/type/__package_openbsd_pkg/parameter/optional +++ /dev/null @@ -1 +0,0 @@ -name diff --git a/conf/type/__package_openbsd_pkg/parameter/required b/conf/type/__package_openbsd_pkg/parameter/required deleted file mode 100644 index ff72b5c7..00000000 --- a/conf/type/__package_openbsd_pkg/parameter/required +++ /dev/null @@ -1 +0,0 @@ -state From 33e792540e38168b6f730ead3840809406a3a5bc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 14:57:50 +0200 Subject: [PATCH 0525/5465] more stuff for 1.6.0 Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index f0641509..cec4a11a 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.6.0: * New Type __package_yum * New type __debconf_set_selections + * New explorer os_version * Fix Type __group in case of __group NAME syntax * Type __package gained Fedora support * Removed --preseed support from __package_apt From 1fc90b2d8c5d5f09f14a951d0c21ad3adfcc4cfe Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 14:58:40 +0200 Subject: [PATCH 0526/5465] +obsd pkg tests Signed-off-by: Nico Schottelius --- doc/dev/logs/2011-04-04.openbsd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 doc/dev/logs/2011-04-04.openbsd diff --git a/doc/dev/logs/2011-04-04.openbsd b/doc/dev/logs/2011-04-04.openbsd new file mode 100644 index 00000000..df1732c2 --- /dev/null +++ b/doc/dev/logs/2011-04-04.openbsd @@ -0,0 +1,24 @@ + +Some openbsd experiements: + +# pkg_add foo +Can't find foo +# echo $? +0 +# +# pkg_info foo +# echo $? +0 + +# pkg_add -s vim +Ambiguous: vim could be vim-7.2.444-gtk2 vim-7.2.444-no_x11 +# pkg_add -s vim--no_x11 +# echo $? +0 +# pkg_add -s vimfooooooooo +Can't find vimfooooooooo +# pkg_add -s vim--foooooooo +Can't find vim--foooooooo +# echo $? +0 + From 231d6a49868f7d7d63a1c6959b52a6e7980ed3a8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 15:19:33 +0200 Subject: [PATCH 0527/5465] more ideas for stuff todo Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 3adf4561..ebf506d4 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -23,6 +23,9 @@ CORE [20:22] kr:bin% - probably remove or improve cdist-type-template +- add $__tmp? + - for use in manifest, code, etc.? + - for creating temporary files, etc. TYPES From 4ebcdc3ef1d1126ab7f7b0d1d64f9ce45b297b2f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 16:25:13 +0200 Subject: [PATCH 0528/5465] find __package* -type f -exec sed -i 's/deinstalled/removed/g' {} \; Signed-off-by: Nico Schottelius --- conf/type/__package_apt/man.text | 4 ++-- conf/type/__package_pacman/man.text | 4 ++-- conf/type/__package_yum/man.text | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/type/__package_apt/man.text b/conf/type/__package_apt/man.text index 0780124d..905bfb5f 100644 --- a/conf/type/__package_apt/man.text +++ b/conf/type/__package_apt/man.text @@ -17,7 +17,7 @@ manage packages. REQUIRED PARAMETERS ------------------- state:: - Either "installed" or "deinstalled". + Either "installed" or "removed". OPTIONAL PARAMETERS @@ -37,7 +37,7 @@ __package_apt zsh --state installed __package_apt webserver --state installed --name nginx # Remove obsolete package -__package_apt puppet --state deinstalled +__package_apt puppet --state removed -------------------------------------------------------------------------------- diff --git a/conf/type/__package_pacman/man.text b/conf/type/__package_pacman/man.text index 35a7e44c..28766581 100644 --- a/conf/type/__package_pacman/man.text +++ b/conf/type/__package_pacman/man.text @@ -17,7 +17,7 @@ packages. REQUIRED PARAMETERS ------------------- state:: - Either "installed" or "deinstalled". + Either "installed" or "removed". OPTIONAL PARAMETERS @@ -37,7 +37,7 @@ __package_pacman zsh --state installed __package_pacman python --state installed --name python2 # Remove obsolete package -__package_pacman puppet --state deinstalled +__package_pacman puppet --state removed -------------------------------------------------------------------------------- diff --git a/conf/type/__package_yum/man.text b/conf/type/__package_yum/man.text index b2f57606..c9cad340 100644 --- a/conf/type/__package_yum/man.text +++ b/conf/type/__package_yum/man.text @@ -18,7 +18,7 @@ slightly confusing error message "Error: Nothing to do". REQUIRED PARAMETERS ------------------- state:: - Either "installed" or "deinstalled". + Either "installed" or "removed". OPTIONAL PARAMETERS @@ -38,7 +38,7 @@ __package_yum zsh --state installed __package_yum python --state installed --name python2 # Remove obsolete package -__package_yum puppet --state deinstalled +__package_yum puppet --state removed -------------------------------------------------------------------------------- From ac976c9f703ad319ff246ae0e2778a3f668ed2db Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 16:25:27 +0200 Subject: [PATCH 0529/5465] find __package* -type f -exec sed -i 's/uninstalled/removed/g' {} \; Signed-off-by: Nico Schottelius --- conf/type/__package/man.text | 2 +- conf/type/__package_apt/gencode-remote | 2 +- conf/type/__package_pacman/gencode-remote | 2 +- conf/type/__package_yum/gencode-remote | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/type/__package/man.text b/conf/type/__package/man.text index eeeceba0..46af7b3d 100644 --- a/conf/type/__package/man.text +++ b/conf/type/__package/man.text @@ -17,7 +17,7 @@ It dispatches the actual work to the package system dependant types. REQUIRED PARAMETERS ------------------- state:: - The state the package should be in, either "installed" or "uninstalled" + The state the package should be in, either "installed" or "removed" OPTIONAL PARAMETERS diff --git a/conf/type/__package_apt/gencode-remote b/conf/type/__package_apt/gencode-remote index e38653e9..aac9beb1 100755 --- a/conf/type/__package_apt/gencode-remote +++ b/conf/type/__package_apt/gencode-remote @@ -46,7 +46,7 @@ case "$state" in echo $aptget install \"$name\" fi ;; - uninstalled) + removed) # Remove only if existent if [ -n "$is_installed" ]; then echo $aptget remove \"$name\" diff --git a/conf/type/__package_pacman/gencode-remote b/conf/type/__package_pacman/gencode-remote index 536b7708..b31d097a 100755 --- a/conf/type/__package_pacman/gencode-remote +++ b/conf/type/__package_pacman/gencode-remote @@ -44,7 +44,7 @@ case "$state" in echo pacman "$pacopts" -S \"$name\" fi ;; - uninstalled) + removed) if [ "$pkg_version" ]; then echo pacman "$pacopts" -R \"$name\" fi diff --git a/conf/type/__package_yum/gencode-remote b/conf/type/__package_yum/gencode-remote index 033298b1..215a1ae5 100755 --- a/conf/type/__package_yum/gencode-remote +++ b/conf/type/__package_yum/gencode-remote @@ -39,7 +39,7 @@ case "$state" in echo yum $opts install \"$name\" fi ;; - uninstalled) + removed) if ! grep -q "$not_installed" "$__object/explorer/pkg_version"; then echo yum $opts remove \"$name\" fi From 1687d82c9d88874bda757da031ce32b5379e1a31 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 16:26:56 +0200 Subject: [PATCH 0530/5465] ++changes in 1.6.0 Signed-off-by: Nico Schottelius --- doc/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changelog b/doc/changelog index cec4a11a..9672814f 100644 --- a/doc/changelog +++ b/doc/changelog @@ -3,6 +3,8 @@ * New type __debconf_set_selections * New explorer os_version * Fix Type __group in case of __group NAME syntax + * Fix __package* types: consistently name --state removed instead of + uninstalled or deinstalled * Type __package gained Fedora support * Removed --preseed support from __package_apt * explorer/os: gained Fedora support From 249977cca66bcff51778cf336ff377c076074016 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 16:49:09 +0200 Subject: [PATCH 0531/5465] document upcoming changes for 1.6 Signed-off-by: Nico Schottelius --- README | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README b/README index aba67707..52471068 100644 --- a/README +++ b/README @@ -106,14 +106,15 @@ how to use cdist. There are at least the following branches available: * master: the development branch - * 1.5: Focus on object orientation instead of global stage orientation + * 1.6: New types, cleaned up \_\_package* types, internal cleanup Old versions: + * 1.5: Focus on object orientation instead of global stage orientation * 1.4: Support for redefiniton of objects (if equal) * 1.3: Support for local and remote code execution (current stable) * 1.2: Dependencies supported - * 1.1: __file to __file, __directory, __link migration + * 1.1: \_\_file to \_\_file, \_\_directory, \_\_link migration * 1.0: First official release Other branches may be available for features or bugfixes, but they @@ -123,7 +124,7 @@ may vanish at any point. To select a specific branch use git checkout -b origin/ # Stay on a specific version - version=1.5 + version=1.6 git checkout -b $version origin/$version ### Mirrors @@ -145,6 +146,14 @@ 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. +### Upgrading 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. + ### Upgrading from 1.3 to 1.5 No incompatiblities. From 519212e39684bc3d18e8ba6446496584365d02ca Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 16:53:56 +0200 Subject: [PATCH 0532/5465] error out if state given is unknown Signed-off-by: Nico Schottelius --- conf/type/__package_apt/gencode-remote | 4 ++++ conf/type/__package_pacman/gencode-remote | 4 ++++ conf/type/__package_yum/gencode-remote | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/conf/type/__package_apt/gencode-remote b/conf/type/__package_apt/gencode-remote index aac9beb1..df8fd823 100755 --- a/conf/type/__package_apt/gencode-remote +++ b/conf/type/__package_apt/gencode-remote @@ -52,4 +52,8 @@ case "$state" in echo $aptget remove \"$name\" fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; esac diff --git a/conf/type/__package_pacman/gencode-remote b/conf/type/__package_pacman/gencode-remote index b31d097a..347b037d 100755 --- a/conf/type/__package_pacman/gencode-remote +++ b/conf/type/__package_pacman/gencode-remote @@ -49,4 +49,8 @@ case "$state" in echo pacman "$pacopts" -R \"$name\" fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; esac diff --git a/conf/type/__package_yum/gencode-remote b/conf/type/__package_yum/gencode-remote index 215a1ae5..8bd81ca0 100755 --- a/conf/type/__package_yum/gencode-remote +++ b/conf/type/__package_yum/gencode-remote @@ -44,4 +44,8 @@ case "$state" in echo yum $opts remove \"$name\" fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; esac From c5925ff33153803ec50d718decf1dd4d6fced462 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 17:43:10 +0200 Subject: [PATCH 0533/5465] prepare version change Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 026d8419..2e5c63b1 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.5.0" +__cdist_version="1.6.0pre" # Fail if something bogus is going on set -u From 4fc181273a0d56faaeef18fb762cdbd08cb061c1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 17:58:09 +0200 Subject: [PATCH 0534/5465] ++todo Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index ebf506d4..abae0dcb 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -27,6 +27,7 @@ CORE - for use in manifest, code, etc.? - for creating temporary files, etc. +- How to cleanly implement "restart service if config file changed" TYPES ------ From 8ec728fd4bb24d7de7dd115cc513384c1b743942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=B6nnimann?= Date: Tue, 5 Apr 2011 19:28:18 +0200 Subject: [PATCH 0535/5465] Type pkg_openbsd --- .../explorer/pkg_version | 31 +++++++++ .../type/__package_pkg_openbsd/gencode-remote | 64 +++++++++++++++++++ conf/type/__package_pkg_openbsd/man.text | 58 +++++++++++++++++ .../__package_pkg_openbsd/parameter/optional | 2 + .../__package_pkg_openbsd/parameter/required | 1 + 5 files changed, 156 insertions(+) create mode 100755 conf/type/__package_pkg_openbsd/explorer/pkg_version create mode 100755 conf/type/__package_pkg_openbsd/gencode-remote create mode 100644 conf/type/__package_pkg_openbsd/man.text create mode 100644 conf/type/__package_pkg_openbsd/parameter/optional create mode 100644 conf/type/__package_pkg_openbsd/parameter/required diff --git a/conf/type/__package_pkg_openbsd/explorer/pkg_version b/conf/type/__package_pkg_openbsd/explorer/pkg_version new file mode 100755 index 00000000..bc23a85d --- /dev/null +++ b/conf/type/__package_pkg_openbsd/explorer/pkg_version @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 2011 Andi Brönnimann (andi-cdist at v-net.ch) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Retrieve the status of a package - parsed dpkg output +# + +if [ -f "$__object/parameter/name" ]; then + name="$(cat "$__object/parameter/name")" +else + name="$__object_id" +fi + +#TODO: Is there a better way? +pkg_info | grep "$name" | sed 's .*\(-[0-9.][0-9.]*\).* \1 ' | sed 's/-//' diff --git a/conf/type/__package_pkg_openbsd/gencode-remote b/conf/type/__package_pkg_openbsd/gencode-remote new file mode 100755 index 00000000..a5756c8d --- /dev/null +++ b/conf/type/__package_pkg_openbsd/gencode-remote @@ -0,0 +1,64 @@ +#!/bin/sh +# +# 2011 Andi Brönnimann (andi-cdist at v-net.ch) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Manage packages with Pacman (mostly archlinux) +# + +# Debug +# exec >&2 +# set -x + +os_version="$(cat "$__global/explorer/os_version")" +platform="$(cat "$__global/explorer/platform")" + + +if [ -f "$__object/parameter/flavor" ]; then + flavor="$(cat "$__object/parameter/flavor")" +fi + +# do not show progress bar +pkgopts="-x" + +if [ -f "$__object/parameter/name" ]; then + name="$__object/parameter/name" +else + name="$__object_id" +fi + +state="$(cat "$__object/parameter/state")" +pkg_version="$(cat "$__object/explorer/pkg_version")" + +# TODO: Shouldn't be hardcoded +echo export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/$os_version/packages/$platform/ + +case "$state" in + installed) + + # Empty? Not installed. + if [ -z "$pkg_version" ]; then + echo pkg_add "$pkgopts" \"$name--$flavor\" + fi + ;; + uninstalled) + if [ "$pkg_version" ]; then + echo pkg_delete "$pkgopts" \"$name--$flavor\" + fi + ;; +esac diff --git a/conf/type/__package_pkg_openbsd/man.text b/conf/type/__package_pkg_openbsd/man.text new file mode 100644 index 00000000..613c9045 --- /dev/null +++ b/conf/type/__package_pkg_openbsd/man.text @@ -0,0 +1,58 @@ +cdist-type__package_pkg(7) +============================= +Andreas Brönnimann + + +NAME +---- +cdist-type__package_pkg_openbsd - Manage OpenBSD packages + + +DESCRIPTION +----------- +This type is usually used on OpenBSD to manage packages. + + +REQUIRED PARAMETERS +------------------- +state:: + Either "installed" or "uninstalled". + + +OPTIONAL PARAMETERS +------------------- +name:: + If supplied, use the name and not the object id as the package name. + +flavor:: + If supplied, use to avoid ambigous + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Ensure zsh is installed +__package_pkg_openbsd zsh --state installed + +# Ensure vim is installed, use flavor no_x11 +__package_pkg_openbsd vim --state installed --flavor no_x11 + +# If you don't want to follow pythonX packages, but always use python +__package_pkg_openbsd python --state installed --name python2 + +# Remove obsolete package +__package_pkg_openbsd puppet --state uninstalled +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) +- cdist-type__package(7) + + +COPYING +------- +Copyright \(C) 2011 Andi Brönnimann. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__package_pkg_openbsd/parameter/optional b/conf/type/__package_pkg_openbsd/parameter/optional new file mode 100644 index 00000000..29b123ef --- /dev/null +++ b/conf/type/__package_pkg_openbsd/parameter/optional @@ -0,0 +1,2 @@ +name +flavor diff --git a/conf/type/__package_pkg_openbsd/parameter/required b/conf/type/__package_pkg_openbsd/parameter/required new file mode 100644 index 00000000..ff72b5c7 --- /dev/null +++ b/conf/type/__package_pkg_openbsd/parameter/required @@ -0,0 +1 @@ +state From aebf05001afd4a192bb49d228c7bae21b8c2540c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=B6nnimann?= Date: Tue, 5 Apr 2011 19:40:54 +0200 Subject: [PATCH 0536/5465] Add platform explorer --- conf/explorer/platform | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 conf/explorer/platform diff --git a/conf/explorer/platform b/conf/explorer/platform new file mode 100755 index 00000000..a28f6d08 --- /dev/null +++ b/conf/explorer/platform @@ -0,0 +1,34 @@ +#!/bin/sh +# +# 2010-2011 Andi Brönnimann (andi-cdist at v-net.ch) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# All os variables are lower case +# +# + +os="$(cat "$__global/explorer/os")" + +case "$os" in + archlinux) + echo $(uname -m) + ;; + openbsd) + echo $(uname -m) + ;; +esac From 52fb8d5661d8a1004fcfa2cb45af31f5354bec04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=B6nnimann?= Date: Tue, 5 Apr 2011 19:50:45 +0200 Subject: [PATCH 0537/5465] Change platform to hardware_type --- conf/explorer/{platform => hardware_type} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename conf/explorer/{platform => hardware_type} (100%) diff --git a/conf/explorer/platform b/conf/explorer/hardware_type similarity index 100% rename from conf/explorer/platform rename to conf/explorer/hardware_type From 864d25bd8cb2488be8f6e7964bfe9d7077bdb98e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 20:26:00 +0200 Subject: [PATCH 0538/5465] reorder todos Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index abae0dcb..7e9d2d5d 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -29,6 +29,14 @@ CORE - How to cleanly implement "restart service if config file changed" +- Cache + - add example how to use + - export variable $__cache + -> for current host + -> add function to cdist-config, import from cdist-cache + +- check all all internal variables are prefixed with __cdist + TYPES ------ - __ssh-keys (host/user) @@ -36,19 +44,12 @@ TYPES - regexp replace (can probably cover all?) -> aka sed. - __cron -- __user: +- __user add option to include --create-home - fix __user NAME case (same issue as __group) DOCUMENTATION -------------- - asciidoc interprets __, which we use for variables names -> seek through docs and replace with \_\_! -- check all all internal variables are prefixed with __cdist - reference explorers in cdist-reference! -Cache: - - add example how to use - - export variable $__cache - -> for current host - -> add function to cdist-config, import from cdist-cache From c5675bc35240ba2711bc9e2cc00851ecdc068c90 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 20:38:22 +0200 Subject: [PATCH 0539/5465] add hint on asciidoc errors and how to fix Signed-off-by: Nico Schottelius --- doc/man/man7/cdist-hacker.text | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/man/man7/cdist-hacker.text b/doc/man/man7/cdist-hacker.text index d55f1c2f..03a348ed 100644 --- a/doc/man/man7/cdist-hacker.text +++ b/doc/man/man7/cdist-hacker.text @@ -59,7 +59,8 @@ HOW TO SUBMIT A NEW TYPE Submitting a type works as described above, with the additional requirement that a corresponding manpage named man.text in asciidoc format with the manpage-name "cdist-type__NAME" is included in the type directory -AND asciidoc is able to compile it. +AND asciidoc is able to compile it (i.e. do NOT have to many "=" in the second +line). SEE ALSO From 4701c14045b20681b05a41fb9266ad406e43822f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 20:55:35 +0200 Subject: [PATCH 0540/5465] new todo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index e7f2c72f..1f01ff44 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,2 +1,3 @@ -remove --preseed from package_apt and add debconf_set_selection or similar - -> much cleaner! +Cleanup documentation: + type reference -> add types + manpages + add explorer reference From d8eccddad089c3e07728c706f68805a5e21dcc95 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 21:08:09 +0200 Subject: [PATCH 0541/5465] list types in type section Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index a5d1698a..be9c3bbf 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -132,8 +132,17 @@ tmp_dir:: TYPES ----- -The available types are listed in the SEE ALSO section -and are referenced as cdist-type__TYPENAME. +The following types are available: +eof + +for type in man7/cdist-type__*.text; do + name_1="${type#man7/}"; man="${name_1%.text}(7)" + name_2="${name_1%.7}"; + name="$name_2" + echo "- $name" "($man)" +done + +cat << eof ENVIRONMENT VARIABLES --------------------- @@ -172,16 +181,7 @@ __type_explorers:: SEE ALSO -------- - cdist(7) -eof -for type in man7/cdist-type__*.7; do - name_1="${type#man7/}" - name_2="${name_1%.7}" - name="$name_2" - echo "- ${name}(7)" -done - -cat < Date: Tue, 5 Apr 2011 22:46:51 +0200 Subject: [PATCH 0542/5465] import man pages changes Signed-off-by: Steven Armstrong --- doc/man/man1/cdist-object-all.text | 31 ++++++++++++++++++++++++++++++ doc/man/man7/cdist-stages.text | 22 ++++++++++----------- 2 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 doc/man/man1/cdist-object-all.text diff --git a/doc/man/man1/cdist-object-all.text b/doc/man/man1/cdist-object-all.text new file mode 100644 index 00000000..06d45268 --- /dev/null +++ b/doc/man/man1/cdist-object-all.text @@ -0,0 +1,31 @@ +cdist-object-all(1) +=================== +Steven Armstrong + + +NAME +---- +cdist-object-all - Run the given command on all objects + + +SYNOPSIS +-------- +cdist-object-all HOSTNAME COMMAND + + +DESCRIPTION +----------- +Iterates over all defined objects and executes the given command on each +of them. + + +SEE ALSO +-------- +- cdist(7) +- cdist-type(1) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/doc/man/man7/cdist-stages.text b/doc/man/man7/cdist-stages.text index e2eef3da..b95b58d2 100644 --- a/doc/man/man7/cdist-stages.text +++ b/doc/man/man7/cdist-stages.text @@ -11,8 +11,8 @@ DESCRIPTION ----------- Starting the execution of deployment with cdist-deploy-to(1), cdist passes through different stages, each can be triggered and debugged on its own. -Reading the source of the cdist-deploy-to and cdist-object-run-all executables -shows the scripts responsible for each stage. +Reading the source of the cdist-deploy-to executable shows the scripts +responsible for each stage. STAGE 0: INTERNAL PREPERATION @@ -56,7 +56,7 @@ STAGE 3: OBJECT INFORMATION RETRIEVAL ------------------------------------- Every object is checked whether its type has explorers and if so, these are transfered to the target host and executed. The results are transfered back -and can be used in the following stages to decide what changes need to made +and can be used in the following stages to decide what changes need to be made on the target to implement the desired state. Related documentation: @@ -68,10 +68,9 @@ Related documentation: STAGE 4: RUN THE OBJECT MANIFEST -------------------------------- -Every object is checked whether its type has a manifest file. If the type has -a manifest file and it is executable, it will be executed. The manifest script -may generate and change the created objects. In other words, one type can reuse -other types. +Every object is checked whether its type has a executable manifest. The +manifest script may generate and change the created objects. In other words, +one type can reuse other types. For instance the object __apache/www.test.ch is of type __apache, which may contain a manifest script, which creates new objects of type __file. @@ -88,11 +87,10 @@ Related documentation: STAGE 5: CODE GENERATION ------------------------ -In this stage for every created objects its type is checked whether it has a -gencode script. If the type has a gencode script and it is executable it will -be executed. This executable should create code to be executed on the target -on stdout. If the gencode executable fails, it must print diagnostic messages -on stderr and exit non-zero. +In this stage for every created objects its type is checked for executable +gencode whether scripts. The gencode scripts generate the code to be executed +on the target on stdout. If the gencode executables fail, they must print +diagnostic messages on stderr and exit non-zero. Related documentation: - cdist-object-gencode-run(1) From 3e46d593ae480599342f4a2aa906a921900c9df7 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 22:48:24 +0200 Subject: [PATCH 0543/5465] remove obsolete man page Signed-off-by: Steven Armstrong --- doc/man/man1/cdist-object-run-all.text | 33 -------------------------- 1 file changed, 33 deletions(-) delete mode 100644 doc/man/man1/cdist-object-run-all.text diff --git a/doc/man/man1/cdist-object-run-all.text b/doc/man/man1/cdist-object-run-all.text deleted file mode 100644 index 9e36b3d4..00000000 --- a/doc/man/man1/cdist-object-run-all.text +++ /dev/null @@ -1,33 +0,0 @@ -cdist-object-run-all(1) -======================= -Nico Schottelius - - -NAME ----- -cdist-object-run-all - Run all created objects on the target host - - -SYNOPSIS --------- -cdist-object-run-all HOSTNAME - - -DESCRIPTION ------------ -Transfers type explorers to the target then runs cdist-object-run(1) -for each created object. - - -SEE ALSO --------- -- cdist(7) -- cdist-type-explorer-push(1) -- cdist-object-run(1) -- cdist-type(1) - - -COPYING -------- -Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is -granted under the terms of the GNU General Public License version 3 (GPLv3). From 13ce077e8e5395a137a9935161b548aded6223c5 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 22:50:38 +0200 Subject: [PATCH 0544/5465] docfix Signed-off-by: Steven Armstrong --- doc/man/man7/cdist-stages.text | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/man/man7/cdist-stages.text b/doc/man/man7/cdist-stages.text index b95b58d2..294dffc7 100644 --- a/doc/man/man7/cdist-stages.text +++ b/doc/man/man7/cdist-stages.text @@ -87,10 +87,10 @@ Related documentation: STAGE 5: CODE GENERATION ------------------------ -In this stage for every created objects its type is checked for executable -gencode whether scripts. The gencode scripts generate the code to be executed -on the target on stdout. If the gencode executables fail, they must print -diagnostic messages on stderr and exit non-zero. +In this stage for every created object its type is checked for executable +gencode scripts. The gencode scripts generate the code to be executed on the +target on stdout. If the gencode executables fail, they must print diagnostic +messages on stderr and exit non-zero. Related documentation: - cdist-object-gencode-run(1) From 71765210bb8ac5bf9605abf0e9d9dac564cf831b Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 22:55:46 +0200 Subject: [PATCH 0545/5465] rename cdist-object-process to cdist-object-prepare Signed-off-by: Steven Armstrong --- bin/cdist-config | 6 +++--- bin/cdist-deploy-to | 2 +- bin/{cdist-object-process => cdist-object-prepare} | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) rename bin/{cdist-object-process => cdist-object-prepare} (85%) diff --git a/bin/cdist-config b/bin/cdist-config index 2e5c63b1..e1e82f28 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -55,7 +55,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" : ${__cdist_name_manifest:=manifest} : ${__cdist_name_object:=object} : ${__cdist_name_object_finished:=done} -: ${__cdist_name_object_processed:=processed} +: ${__cdist_name_object_prepared:=prepared} : ${__cdist_name_object_id:=object_id} : ${__cdist_name_object_source:=source} : ${__cdist_name_objects_created:=.objects_created} @@ -210,9 +210,9 @@ __cdist_object_code() echo "$(__cdist_object_dir "$1")/${__cdist_name_code}" } -__cdist_object_processed() +__cdist_object_prepared() { - echo "$(__cdist_object_dir "$1")/${__cdist_name_object_processed}" + echo "$(__cdist_object_dir "$1")/${__cdist_name_object_prepared}" } __cdist_object_finished() diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index 02fd34fa..dab5d9a5 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -49,7 +49,7 @@ cdist-dir push "$__cdist_target_host" \ "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" cdist-explorer-run-global "$__cdist_target_host" cdist-manifest-run-init "$__cdist_target_host" -cdist-object-all "$__cdist_target_host" cdist-object-process +cdist-object-all "$__cdist_target_host" cdist-object-prepare cdist-object-all "$__cdist_target_host" cdist-object-run cdist-cache "$__cdist_target_host" diff --git a/bin/cdist-object-process b/bin/cdist-object-prepare similarity index 85% rename from bin/cdist-object-process rename to bin/cdist-object-prepare index 777d2c88..8c92ff73 100755 --- a/bin/cdist-object-process +++ b/bin/cdist-object-prepare @@ -36,13 +36,13 @@ __cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" # Export to non-core for use in manifest and gencode scripts export $__cdist_name_var_self=$__cdist_object -__cdist_object_processed="$(__cdist_object_processed "$__cdist_object")" -if [ ! -f "$__cdist_object_processed" ]; then +__cdist_object_prepared="$(__cdist_object_prepared "$__cdist_object")" +if [ ! -f "$__cdist_object_prepared" ]; then echo - echo "Processing object $__cdist_object" + echo "Preparing object $__cdist_object" cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" - # Mark this object as processed - touch "$__cdist_object_processed" + # Mark this object as prepared + touch "$__cdist_object_prepared" fi From b226b30dbad977bac321a0b23741584cedd6d1d2 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 23:02:34 +0200 Subject: [PATCH 0546/5465] add man page for cdist-object-prepare Signed-off-by: Steven Armstrong --- doc/man/man1/cdist-object-prepare.text | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/man/man1/cdist-object-prepare.text diff --git a/doc/man/man1/cdist-object-prepare.text b/doc/man/man1/cdist-object-prepare.text new file mode 100644 index 00000000..c91a7b2e --- /dev/null +++ b/doc/man/man1/cdist-object-prepare.text @@ -0,0 +1,35 @@ +cdist-object-prepare(1) +======================= +Steven Armstrong + + +NAME +---- +cdist-object-prepare - Prepare an object + + +SYNOPSIS +-------- +cdist-object-prepare HOSTNAME OBJECT + + +DESCRIPTION +----------- +Prepare the given object by running it through stage 3 (object information +retrieval) and stage 4 (run the object manifest). +See related man pages for details. + + +SEE ALSO +-------- +- cdist(7) +- cdist-stages(7) +- cdist-object-explorer-run(1) +- cdist-object-manifest-run(1) +- cdist-type(1) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is granted +under the terms of the GNU General Public License version 3 (GPLv3). From 40d4b4d1be7a49fed88323bf71644e8062a594df Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 23:10:58 +0200 Subject: [PATCH 0547/5465] update man page for cdist-object-run Signed-off-by: Steven Armstrong --- doc/man/man1/cdist-object-run.text | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/man/man1/cdist-object-run.text b/doc/man/man1/cdist-object-run.text index fca6db91..fc85a05f 100644 --- a/doc/man/man1/cdist-object-run.text +++ b/doc/man/man1/cdist-object-run.text @@ -1,6 +1,6 @@ cdist-object-run(1) =================== -Nico Schottelius +Steven Armstrong NAME @@ -15,15 +15,15 @@ cdist-object-run HOSTNAME OBJECT DESCRIPTION ----------- -Runs the given object on the given target host. -The different subtasks are dispatched to specialized exectuables. +Applies the given object on the target host by running it through stage 5 +(code generation) and stage 6 (code execution). See related man pages for details. SEE ALSO -------- - cdist(7) -- cdist-object-explorer-run(1) +- cdist-stages(7) - cdist-object-gencode-run(1) - cdist-object-push(1) - cdist-object-code-run(1) @@ -32,5 +32,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2011 Nico Schottelius, Steven Armstrong. Free use of this software is +Copyright \(C) 2011 Steven Armstrong. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). From aeb7d34a8e81d829fd8af9c66707a8ebacefdaef Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 23:11:31 +0200 Subject: [PATCH 0548/5465] -todo Signed-off-by: Steven Armstrong --- doc/dev/todo/TAKEME | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 7e9d2d5d..0fcced96 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -16,7 +16,6 @@ CORE - cdist-object-gencode: remove code if output empty? - also take care of that in cdist-code-run! -- cdist-object-process -> cdist-object-prepare - Remove cdist-object-push, covers only one line and is used only once: [20:22] kr:bin% grep cdist-object-push * cdist-object-run: cdist-object-push "$__cdist_target_host" "$__cdist_object" From ab741197ba7f22634090d6fec7b679e7aeaeca1b Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 23:17:37 +0200 Subject: [PATCH 0549/5465] docfix: /etc/cdist is no more Signed-off-by: Steven Armstrong --- doc/man/man1/cdist-deploy-to.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/man/man1/cdist-deploy-to.text b/doc/man/man1/cdist-deploy-to.text index acbb915a..93417a77 100644 --- a/doc/man/man1/cdist-deploy-to.text +++ b/doc/man/man1/cdist-deploy-to.text @@ -23,7 +23,7 @@ called stages. It is intented to run either from the command line or from cron. ENVIRONMENT ----------- If the environment variable **__cdist_conf_dir** is not set, the -configuration is read from /etc/cdist. The local output directory can +configuration is read from /conf. The local output directory can be changed by the variable **__cdist_local_base_dir**. All environment variables are handled by cdist-config. From ff2581a25fe1ce9197ddbc97e811ef6c058c3262 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 23:21:26 +0200 Subject: [PATCH 0550/5465] /cdist-object-run-all/cdist-object-run/ Signed-off-by: Steven Armstrong --- doc/man/man1/cdist-object-code-run.text | 2 +- doc/man/man1/cdist-object-gencode-run.text | 2 +- doc/man/man1/cdist-object-push.text | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/man/man1/cdist-object-code-run.text b/doc/man/man1/cdist-object-code-run.text index a055fc97..f8bae6a4 100644 --- a/doc/man/man1/cdist-object-code-run.text +++ b/doc/man/man1/cdist-object-code-run.text @@ -21,7 +21,7 @@ Execute the local and remote code for the given object. SEE ALSO -------- - cdist(7) -- cdist-object-run-all(1) +- cdist-object-run(1) - cdist-code-run(1) - cdist-run-remote(1) diff --git a/doc/man/man1/cdist-object-gencode-run.text b/doc/man/man1/cdist-object-gencode-run.text index be2d3448..7705815c 100644 --- a/doc/man/man1/cdist-object-gencode-run.text +++ b/doc/man/man1/cdist-object-gencode-run.text @@ -22,7 +22,7 @@ SEE ALSO -------- - cdist(7) - cdist-code-run(1) -- cdist-object-run-all(1) +- cdist-object-run(1) - cdist-object-gencode(1) diff --git a/doc/man/man1/cdist-object-push.text b/doc/man/man1/cdist-object-push.text index 5bff71cf..4c960eaa 100644 --- a/doc/man/man1/cdist-object-push.text +++ b/doc/man/man1/cdist-object-push.text @@ -21,7 +21,7 @@ Transfers the given object to the target host. SEE ALSO -------- - cdist(7) -- cdist-object-run-all(1) +- cdist-object-run(1) - cdist-type(1) From 836c2ae7b8ef412888fc596b6ee38cd32fbb2bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=B6nnimann?= Date: Tue, 5 Apr 2011 23:23:24 +0200 Subject: [PATCH 0551/5465] Add error output to __package_pkg_openbsd --- conf/explorer/hardware_type | 7 ++-- .../type/__package_pkg_openbsd/gencode-remote | 35 +++++++++++++++---- conf/type/__package_pkg_openbsd/man.text | 6 ++-- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/conf/explorer/hardware_type b/conf/explorer/hardware_type index a28f6d08..5966b11e 100755 --- a/conf/explorer/hardware_type +++ b/conf/explorer/hardware_type @@ -22,13 +22,10 @@ # # -os="$(cat "$__global/explorer/os")" +os="$($__explorer/os)" case "$os" in - archlinux) - echo $(uname -m) - ;; - openbsd) + archlinux|*bsd) echo $(uname -m) ;; esac diff --git a/conf/type/__package_pkg_openbsd/gencode-remote b/conf/type/__package_pkg_openbsd/gencode-remote index a5756c8d..0ad85458 100755 --- a/conf/type/__package_pkg_openbsd/gencode-remote +++ b/conf/type/__package_pkg_openbsd/gencode-remote @@ -18,7 +18,7 @@ # along with cdist. If not, see . # # -# Manage packages with Pacman (mostly archlinux) +# Manage packages with pkg on OpenBSD # # Debug @@ -26,7 +26,7 @@ # set -x os_version="$(cat "$__global/explorer/os_version")" -platform="$(cat "$__global/explorer/platform")" +hardware_type="$(cat "$__global/explorer/hardware_type")" if [ -f "$__object/parameter/flavor" ]; then @@ -46,19 +46,40 @@ state="$(cat "$__object/parameter/state")" pkg_version="$(cat "$__object/explorer/pkg_version")" # TODO: Shouldn't be hardcoded -echo export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/$os_version/packages/$platform/ +echo export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/$os_version/packages/$hardware_type/ case "$state" in installed) - # Empty? Not installed. if [ -z "$pkg_version" ]; then - echo pkg_add "$pkgopts" \"$name--$flavor\" + # use this because pkg_add doesn't properly handle errors + cat << eof + status=\$(pkg_add "$pkgopts" "$name--$flavor") + + # no error + if [ -n "\$status" ]; then + echo "Error: \$status" + exit 1 + fi +eof fi ;; - uninstalled) + removed) if [ "$pkg_version" ]; then - echo pkg_delete "$pkgopts" \"$name--$flavor\" + # use this because pkg_add doesn't properly handle errors + cat << eof + status=\$(pkg_delete "$pkgopts" "$name--$flavor") + + # no error + if [ -n "\$status" ]; then + echo "Error: \$status" + exit 1 + fi +eof fi ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; esac diff --git a/conf/type/__package_pkg_openbsd/man.text b/conf/type/__package_pkg_openbsd/man.text index 613c9045..32501ba8 100644 --- a/conf/type/__package_pkg_openbsd/man.text +++ b/conf/type/__package_pkg_openbsd/man.text @@ -1,6 +1,6 @@ cdist-type__package_pkg(7) ============================= -Andreas Brönnimann +Andi Brönnimann NAME @@ -16,7 +16,7 @@ This type is usually used on OpenBSD to manage packages. REQUIRED PARAMETERS ------------------- state:: - Either "installed" or "uninstalled". + Either "installed" or "removed". OPTIONAL PARAMETERS @@ -42,7 +42,7 @@ __package_pkg_openbsd vim --state installed --flavor no_x11 __package_pkg_openbsd python --state installed --name python2 # Remove obsolete package -__package_pkg_openbsd puppet --state uninstalled +__package_pkg_openbsd puppet --state removed -------------------------------------------------------------------------------- From dcd96c04d40b3aed414c94fae0c327d26135fbeb Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 23:27:51 +0200 Subject: [PATCH 0552/5465] explicitly delete generated cdist-reference.text man page Signed-off-by: Steven Armstrong --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 2df76539..e033c007 100755 --- a/build.sh +++ b/build.sh @@ -99,6 +99,7 @@ case "$1" in ;; clean) + rm -f ${MAN7DSTDIR}/cdist-reference.text find "${MANDIR}" -mindepth 2 -type l \ -o -name "*.1" \ -o -name "*.7" \ From d3a376545f291d72323659930a8ee3bac4e0bf27 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 09:32:11 +0200 Subject: [PATCH 0553/5465] generate new type listing Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index be9c3bbf..67e16989 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -21,6 +21,8 @@ # Generate manpage that lists available types # +FIXME: __ breaks again in asciidoc! + __cdist_pwd="$(pwd -P)" __cdist_mydir="${0%/*}"; __cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" @@ -133,12 +135,15 @@ tmp_dir:: TYPES ----- The following types are available: + eof for type in man7/cdist-type__*.text; do - name_1="${type#man7/}"; man="${name_1%.text}(7)" - name_2="${name_1%.7}"; - name="$name_2" + no_dir="${type#man7/}"; + no_type="${no_dir#cdist-type}"; + name="${no_type%.text}"; + man="${no_dir%.text}(7)" + echo "- $name" "($man)" done From 7496639e1fbba99fe98a38916eaffb7541c8346b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 13:56:16 +0200 Subject: [PATCH 0554/5465] add template for cdist-mass-deploy Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 bin/cdist-mass-deploy diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy new file mode 100755 index 00000000..dab5d9a5 --- /dev/null +++ b/bin/cdist-mass-deploy @@ -0,0 +1,56 @@ +#!/bin/sh +# +# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Deploy configuration to a host +# + +. cdist-config +[ $# -eq 1 ] || __cdist_usage "" +set -eu + +__cdist_target_host="$1" + +# Make target host available for non-core +export $__cdist_name_var_target_host="$__cdist_target_host" +export $__cdist_name_var_target_user="$__cdist_remote_user" + +# Export variables for core, which others do not reset +export __cdist_local_base_dir + +echo "cdist $__cdist_version: Configuring $__cdist_target_host" + +################################################################################ +# See cdist-stages(7) +# + +# Prepare local and remote directories +__cdist_init_deploy "$__cdist_target_host" + +# Transfer cdist executables +echo "Transferring cdist binaries to $__cdist_target_host ..." +cdist-dir push "$__cdist_target_host" \ + "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" +cdist-explorer-run-global "$__cdist_target_host" +cdist-manifest-run-init "$__cdist_target_host" +cdist-object-all "$__cdist_target_host" cdist-object-prepare +cdist-object-all "$__cdist_target_host" cdist-object-run +cdist-cache "$__cdist_target_host" + +echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" From e84ab9e14c4d86209c3bc63ec7ad177eca83f5ed Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 13:58:00 +0200 Subject: [PATCH 0555/5465] in theory finish cdist-mass-deploy Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index dab5d9a5..3adb166c 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -1,6 +1,6 @@ #!/bin/sh # -# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -18,39 +18,14 @@ # along with cdist. If not, see . # # -# Deploy configuration to a host +# Deploy configuration to many hosts # . cdist-config -[ $# -eq 1 ] || __cdist_usage "" +[ $# -lt 1 ] || __cdist_usage " [target host ...]" set -eu -__cdist_target_host="$1" - -# Make target host available for non-core -export $__cdist_name_var_target_host="$__cdist_target_host" -export $__cdist_name_var_target_user="$__cdist_remote_user" - -# Export variables for core, which others do not reset -export __cdist_local_base_dir - -echo "cdist $__cdist_version: Configuring $__cdist_target_host" - -################################################################################ -# See cdist-stages(7) -# - -# Prepare local and remote directories -__cdist_init_deploy "$__cdist_target_host" - -# Transfer cdist executables -echo "Transferring cdist binaries to $__cdist_target_host ..." -cdist-dir push "$__cdist_target_host" \ - "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" -cdist-explorer-run-global "$__cdist_target_host" -cdist-manifest-run-init "$__cdist_target_host" -cdist-object-all "$__cdist_target_host" cdist-object-prepare -cdist-object-all "$__cdist_target_host" cdist-object-run -cdist-cache "$__cdist_target_host" - -echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" +while [ $# -ge 1 ]; do + cdist-deploy-to "$1" + shift +done From 32c261293488196dc8f5c28c3fcc0d9bad46452e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 13:59:34 +0200 Subject: [PATCH 0556/5465] ge vs lt Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 3adb166c..84e4376d 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -22,7 +22,7 @@ # . cdist-config -[ $# -lt 1 ] || __cdist_usage " [target host ...]" +[ $# -ge 1 ] || __cdist_usage " [target host ...]" set -eu while [ $# -ge 1 ]; do From 86a6b10ae9dcb2386154e2ba1feb19529f4e2c6b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 14:00:41 +0200 Subject: [PATCH 0557/5465] more stuff for the next wonderful release Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 9672814f..0ba6b2f0 100644 --- a/doc/changelog +++ b/doc/changelog @@ -9,6 +9,7 @@ * Removed --preseed support from __package_apt * explorer/os: gained Fedora support * Simplified types __user and __group + * New helper binary: cdist-mass-deploy 1.5.0: 2011-04-01 * Add basic cache functionality From b9ef12b48d20c284e3cbf986f7ba4ec824a7ee81 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 14:05:47 +0200 Subject: [PATCH 0558/5465] enhance cdist-mass-deploy and add parallel execution Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 84e4376d..f5790c03 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -22,10 +22,25 @@ # . cdist-config -[ $# -ge 1 ] || __cdist_usage " [target host ...]" +[ $# -ge 1 ] || __cdist_usage "[-p] [target host ...]" set -eu +if [ "$1" = "-p" ]; then + parallel=yes +else + parallel="" +fi + while [ $# -ge 1 ]; do - cdist-deploy-to "$1" + if [ "$parallel" ]; then + cdist-deploy-to "$1" & + else + cdist-deploy-to "$1" + fi shift done + +if [ "$parallel" ]; then + echo "Waiting for cdist-deploy-to jobs to finish..." + wait +fi From 5aa32fa42d042e82dc9a69f26ac8fba18ba27f2b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 14:16:33 +0200 Subject: [PATCH 0559/5465] beautify parallel mode Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index f5790c03..f3e526cc 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -25,21 +25,22 @@ [ $# -ge 1 ] || __cdist_usage "[-p] [target host ...]" set -eu +parallel="" if [ "$1" = "-p" ]; then parallel=yes -else - parallel="" + shift fi while [ $# -ge 1 ]; do - if [ "$parallel" ]; then - cdist-deploy-to "$1" & - else - cdist-deploy-to "$1" - fi + # always assume we run parallel + cdist-deploy-to "$1" | awk -v host=$1 '{ print "[" host "]" $0 }"' & shift + + # if not, wait for it _now_ + [ "$parallel" ] || fg done +# else wait after all are started if [ "$parallel" ]; then echo "Waiting for cdist-deploy-to jobs to finish..." wait From 75509dc8a53396dc3af2fb839e0c0163e1b98f9a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 14:18:14 +0200 Subject: [PATCH 0560/5465] PLUS whitespace (not only, but also for Steven) Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index f3e526cc..1bd6939e 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -33,7 +33,7 @@ fi while [ $# -ge 1 ]; do # always assume we run parallel - cdist-deploy-to "$1" | awk -v host=$1 '{ print "[" host "]" $0 }"' & + cdist-deploy-to "$1" | awk -v host=$1 '{ print "[" host "] " $0 }' & shift # if not, wait for it _now_ From 1973ac0787d70f4b164a0f3349a2965c2621ecca Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 14:22:44 +0200 Subject: [PATCH 0561/5465] use wait instead of fg Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 1bd6939e..2753bcab 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -37,7 +37,7 @@ while [ $# -ge 1 ]; do shift # if not, wait for it _now_ - [ "$parallel" ] || fg + [ "$parallel" ] || wait done # else wait after all are started From 7e1b7614b1b07acacc578a430f5040daf5e8bc5a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 14:44:19 +0200 Subject: [PATCH 0562/5465] finish manpage for cdist-mass-deploy Signed-off-by: Nico Schottelius --- doc/man/man1/cdist-mass-deploy.text | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 doc/man/man1/cdist-mass-deploy.text diff --git a/doc/man/man1/cdist-mass-deploy.text b/doc/man/man1/cdist-mass-deploy.text new file mode 100644 index 00000000..ac495b21 --- /dev/null +++ b/doc/man/man1/cdist-mass-deploy.text @@ -0,0 +1,41 @@ +cdist-mass-deploy(1) +==================== +Nico Schottelius + + +NAME +---- +cdist-mass-deploy - Deploy configuration to many hosts + + +SYNOPSIS +-------- +cdist-mass-deploy [-p] HOSTNAME [HOSTNAME ...] + + +DESCRIPTION +----------- +cdist-mass-deploy is essentially a wrapper around cdist-deploy-to to +be able to deploy to many hosts on one command line. + + +EXAMPLES +-------- +Deploy in parallel to all hosts specfied in the dsh group configuration ikr, +which is prefixed by "root@": + +-------------------------------------------------------------------------------- +cdist-mass-deploy -p $(cat ~/.dsh/group/ikr | sed 's/^root@//') +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist(7) +- cdist-deploy-to(1) + + +COPYING +------- +Copyright \(C) 2010-2011 Nico Schottelius. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). From 9c1d6061616af161fc9343a0c59be80201840cac Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 14:47:39 +0200 Subject: [PATCH 0563/5465] -fixme, __ issue needs to be fixed globally Signed-off-by: Nico Schottelius --- doc/man/cdist-reference.text.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 67e16989..51ae2a55 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -21,8 +21,6 @@ # Generate manpage that lists available types # -FIXME: __ breaks again in asciidoc! - __cdist_pwd="$(pwd -P)" __cdist_mydir="${0%/*}"; __cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)" From 4aa0d803109f52054d97e5e65dd1c1a4d79b1dfa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 19:36:57 +0200 Subject: [PATCH 0564/5465] prepare files for 1.6.0 release Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- doc/changelog | 2 +- doc/dev/todo/1.6 | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 doc/dev/todo/1.6 diff --git a/bin/cdist-config b/bin/cdist-config index e1e82f28..96de4664 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.6.0pre" +__cdist_version="1.6.0" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index 0ba6b2f0..9dda1806 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.6.0: +1.6.0: 2011-04-06 * New Type __package_yum * New type __debconf_set_selections * New explorer os_version diff --git a/doc/dev/todo/1.6 b/doc/dev/todo/1.6 deleted file mode 100644 index 12a83e93..00000000 --- a/doc/dev/todo/1.6 +++ /dev/null @@ -1,3 +0,0 @@ -Documentation: - - update stages - - go through all manpages and ensure __ and co are correct From 4165b4fe15605d0fddac6f998b9d8d11e4dd1c75 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 19:40:42 +0200 Subject: [PATCH 0565/5465] rephrase introduction Signed-off-by: Nico Schottelius --- README | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README b/README index 52471068..54f792a7 100644 --- a/README +++ b/README @@ -15,17 +15,16 @@ "P' "" "" -[[!toc levels=2]] +[[!toc levels=2]] ## Introduction -cdist configures your system and is similar to -other configuration management systems like +cdist is an alternative to other configuration management systems like [cfengine](http://www.cfengine.org/), [bcfg2](http://trac.mcs.anl.gov/projects/bcfg2), [chef](http://wiki.opscode.com/display/chef/) -and [puppet](http://www.puppetlabs.com/), but it ticks differently. -Here are some features that makes it unique: +and [puppet](http://www.puppetlabs.com/). +But cdist ticks differently, here is the feature set that makes it unique: [[!table data=""" Keywords | Description From 723046fdd2756bd7a3ed4905b71b3bca40f654d9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:00:36 +0200 Subject: [PATCH 0566/5465] introduce and use __cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-config | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 96de4664..efb8c3c0 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -148,22 +148,37 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") ################################################################################ # Internal functions # -__cdist_debug_echo() +__cdist_echo() { - if [ "$__cdist_debug" ]; then - echo "Debug: $@" - fi + __cdist_echo_type="$1"; shift + + case "$__cdist_echo_type" in + debug) + if [ "$__cdist_debug" ]; then + echo "Debug: $@" + fi + ;; + info) + echo "$@" + ;; + error) + echo "Error: $@" >&2 + ;; + esac } __cdist_exec_fail_on_error() { sh -e "$@" - [ "$?" -eq 0 ] || __cdist_exit_err "$1 exited non-zero." + if [ "$?" -ne 0 ]; then + __cdist_echo error "$1 exited non-zero." + __cdist_exit_err "$1 exited non-zero." + fi } __cdist_exit_err() { - echo "Error: $@" >&2 + __cdist_echo error "$@" exit 1 } From aad8070d266b4efa68310c9151b6ba8bab1e0b55 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:00:53 +0200 Subject: [PATCH 0567/5465] todo/nico++ Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 1f01ff44..5df1cb61 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,3 +1,5 @@ +Introduce better logging + Cleanup documentation: type reference -> add types + manpages add explorer reference From 90f5d4716445cdfc6adc18d210344508dfb494ee Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:04:34 +0200 Subject: [PATCH 0568/5465] add warning level Signed-off-by: Nico Schottelius --- bin/cdist-config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/cdist-config b/bin/cdist-config index efb8c3c0..8195a304 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -161,6 +161,9 @@ __cdist_echo() info) echo "$@" ;; + warning) + echo "Warning: $@" + ;; error) echo "Error: $@" >&2 ;; From 08d18ec1ec029307e988a63137eefe38675226a3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:05:58 +0200 Subject: [PATCH 0569/5465] show broken code Signed-off-by: Nico Schottelius --- bin/cdist-config | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 8195a304..b5e1fe10 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -174,8 +174,9 @@ __cdist_exec_fail_on_error() { sh -e "$@" if [ "$?" -ne 0 ]; then - __cdist_echo error "$1 exited non-zero." - __cdist_exit_err "$1 exited non-zero." + __cdist_echo error "$1 exited non-zero, showing code:" + cat "$1" + __cdist_exit_err "Aborting due to non-zero exit code." fi } From 813b4e1f2be440b960c90c28e7bf62c7c8cc4ca7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:11:39 +0200 Subject: [PATCH 0570/5465] use __cdist_exec_fail_on_error in bin/cdist-code-run Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 2 +- bin/cdist-config | 12 ++++++++---- bin/cdist-object-code-run | 6 ++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 54cb312f..cf7e8e8d 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -40,7 +40,7 @@ if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then echo "Executing code-${__cdist_gencode_type} for $__cdist_object ..." - "$code" + __cdist_exec_fail_on_error "$code" else __cdist_exit_err "$code exists, but is not executable." fi diff --git a/bin/cdist-config b/bin/cdist-config index b5e1fe10..8678d205 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -152,20 +152,24 @@ __cdist_echo() { __cdist_echo_type="$1"; shift + if [ "$__cdist_object_self" ]; then + __cdist_echo_prefix="$__cdist_object_self" + fi + case "$__cdist_echo_type" in debug) if [ "$__cdist_debug" ]; then - echo "Debug: $@" + echo $__cdist_echo_prefix "Debug: $@" fi ;; info) - echo "$@" + echo $__cdist_echo_prefix "$@" ;; warning) - echo "Warning: $@" + echo $__cdist_echo_prefix "Warning: $@" ;; error) - echo "Error: $@" >&2 + echo $__cdist_echo_prefix "Error: $@" >&2 ;; esac } diff --git a/bin/cdist-object-code-run b/bin/cdist-object-code-run index 97cb58ac..fa63aaba 100755 --- a/bin/cdist-object-code-run +++ b/bin/cdist-object-code-run @@ -31,10 +31,8 @@ __cdist_object="$1"; shift # Code local export __cdist_out_object_dir="$__cdist_out_object_dir" -cdist-code-run "$__cdist_object" "${__cdist_name_gencode_local}" \ - || __cdist_exit_err "Local code failed for $__cdist_object" +cdist-code-run "$__cdist_object" "${__cdist_name_gencode_local}" # Code remote cdist-run-remote "$__cdist_target_host" \ - "cdist-code-run" "$__cdist_object" "${__cdist_name_gencode_remote}" \ - || __cdist_exit_err "Remote code failed for $__cdist_object" + "cdist-code-run" "$__cdist_object" "${__cdist_name_gencode_remote}" From d31833a78ebe1f23062b4729edaeb02fcb5ce62a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:16:16 +0200 Subject: [PATCH 0571/5465] begin use of __cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index cf7e8e8d..3259fb1b 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -34,7 +34,7 @@ fi code="$(__cdist_object_code "$__cdist_object")-${__cdist_gencode_type}" -echo "Checking code-${__cdist_gencode_type} for $__cdist_object ..." +__cdist_echo info "Checking code-${__cdist_gencode_type}" if [ -e "$code" ]; then if [ -f "$code" ]; then From e28923558920bbe9bb8461c1710c00a1318c8131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=B6nnimann?= Date: Wed, 6 Apr 2011 20:16:36 +0200 Subject: [PATCH 0572/5465] Fix typo --- conf/type/__package_pkg_openbsd/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__package_pkg_openbsd/man.text b/conf/type/__package_pkg_openbsd/man.text index 32501ba8..c0fae241 100644 --- a/conf/type/__package_pkg_openbsd/man.text +++ b/conf/type/__package_pkg_openbsd/man.text @@ -25,7 +25,7 @@ name:: If supplied, use the name and not the object id as the package name. flavor:: - If supplied, use to avoid ambigous + If supplied, use to avoid ambiguity. EXAMPLES From 3c7a226e0f256f0e825feb1d85b326ffbaf21c3f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:17:00 +0200 Subject: [PATCH 0573/5465] stuff for 1.6.1 Signed-off-by: Nico Schottelius --- doc/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog b/doc/changelog index 9dda1806..0ca26837 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.6.1: + * Logging restructured + 1.6.0: 2011-04-06 * New Type __package_yum * New type __debconf_set_selections From a23c926df75749b18dca1f90e199600f1cd79bfd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:17:28 +0200 Subject: [PATCH 0574/5465] add reference to cdist-mass-deploy in cdist-deploy-to manpage Signed-off-by: Nico Schottelius --- doc/man/man1/cdist-deploy-to.text | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/man/man1/cdist-deploy-to.text b/doc/man/man1/cdist-deploy-to.text index 93417a77..f42a0509 100644 --- a/doc/man/man1/cdist-deploy-to.text +++ b/doc/man/man1/cdist-deploy-to.text @@ -32,6 +32,7 @@ SEE ALSO -------- - cdist(7) - cdist-config(1) +- cdist-mass-deploy(1) - cdist-reference(7) - cdist-stages(7) From e4390da300a87ce4a97ed18985145b2b4adaf41b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:18:31 +0200 Subject: [PATCH 0575/5465] requiring set +e in __cdist_exec_fail_on_error to catch error ourselves Signed-off-by: Nico Schottelius --- bin/cdist-config | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/cdist-config b/bin/cdist-config index 8678d205..82d94753 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -176,6 +176,7 @@ __cdist_echo() __cdist_exec_fail_on_error() { + set +e sh -e "$@" if [ "$?" -ne 0 ]; then __cdist_echo error "$1 exited non-zero, showing code:" From e5d8843eddd5b961c5d9ef9c4da06a1908e0d393 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:21:36 +0200 Subject: [PATCH 0576/5465] [DOC] add hint on FIXME tag Signed-off-by: Nico Schottelius --- doc/man/man7/cdist-hacker.text | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/man/man7/cdist-hacker.text b/doc/man/man7/cdist-hacker.text index 03a348ed..27f92a4a 100644 --- a/doc/man/man7/cdist-hacker.text +++ b/doc/man/man7/cdist-hacker.text @@ -27,6 +27,11 @@ read the scripts bin/cdist-deploy-to calls. The magnificent HACKERS_README may be of great help as well. +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. + CODING CONVENTIONS (CORE) ------------------------- - All variables exported by cdist are prefixed with a double underscore (__) From a4933344311c47dea957396a1da4800c8011ad51 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:24:01 +0200 Subject: [PATCH 0577/5465] [DOC] fixup manpage for type __package_pkg_openbsd Signed-off-by: Nico Schottelius --- conf/type/__package_pkg_openbsd/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__package_pkg_openbsd/man.text b/conf/type/__package_pkg_openbsd/man.text index c0fae241..98aeaccf 100644 --- a/conf/type/__package_pkg_openbsd/man.text +++ b/conf/type/__package_pkg_openbsd/man.text @@ -1,5 +1,5 @@ cdist-type__package_pkg(7) -============================= +========================== Andi Brönnimann From a76a9970a6c45e948ec4edb27bdb35acfb4e625f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:24:18 +0200 Subject: [PATCH 0578/5465] more stuff for 1.6.1 Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 0ca26837..eb3f2184 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.6.1: * Logging restructured + * New Type __package_pkg_openbsd 1.6.0: 2011-04-06 * New Type __package_yum From e3f27f1794e5b1cbae87055ce751c470a4be57d3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:31:19 +0200 Subject: [PATCH 0579/5465] allow empty $__cdist_object_self Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/cdist-config b/bin/cdist-config index 82d94753..a19fdc01 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -152,9 +152,11 @@ __cdist_echo() { __cdist_echo_type="$1"; shift + set +u if [ "$__cdist_object_self" ]; then __cdist_echo_prefix="$__cdist_object_self" fi + set -u case "$__cdist_echo_type" in debug) From 290915ee647c8451066b1abba6cdb572be7b9827 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:34:07 +0200 Subject: [PATCH 0580/5465] __cdist_echo++ Signed-off-by: Nico Schottelius --- bin/cdist-cache | 2 +- bin/cdist-deploy-to | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/cdist-cache b/bin/cdist-cache index f9480162..5ba51442 100755 --- a/bin/cdist-cache +++ b/bin/cdist-cache @@ -32,6 +32,6 @@ __cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")" # Create base to move into mkdir -p "$(__cdist_cache_dir)" -echo "Saving cache to $__cdist_ddir ..." +__cdist_echo info "Saving cache to $__cdist_ddir ..." rm -rf "$__cdist_ddir" mv "$__cdist_local_base_dir" "$__cdist_ddir" diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index dab5d9a5..ddb36fca 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -34,7 +34,7 @@ export $__cdist_name_var_target_user="$__cdist_remote_user" # Export variables for core, which others do not reset export __cdist_local_base_dir -echo "cdist $__cdist_version: Configuring $__cdist_target_host" +__cdist_echo info "cdist $__cdist_version: Configuring $__cdist_target_host ..." ################################################################################ # See cdist-stages(7) @@ -44,7 +44,7 @@ echo "cdist $__cdist_version: Configuring $__cdist_target_host" __cdist_init_deploy "$__cdist_target_host" # Transfer cdist executables -echo "Transferring cdist binaries to $__cdist_target_host ..." +__cdist_echo info "Transferring cdist binaries to the target host ..." cdist-dir push "$__cdist_target_host" \ "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" cdist-explorer-run-global "$__cdist_target_host" @@ -53,4 +53,4 @@ cdist-object-all "$__cdist_target_host" cdist-object-prepare cdist-object-all "$__cdist_target_host" cdist-object-run cdist-cache "$__cdist_target_host" -echo "cdist $__cdist_version: Successfully finished run on $__cdist_target_host" +__cdist_echo info "cdist $__cdist_version: Successfully finished run" From 9d5d0b8cdd9b0572bcda496079e6e6ff0a7b2fca Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:34:46 +0200 Subject: [PATCH 0581/5465] always setup __cdist_echo_prefix Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/cdist-config b/bin/cdist-config index a19fdc01..755a3e60 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -155,6 +155,8 @@ __cdist_echo() set +u if [ "$__cdist_object_self" ]; then __cdist_echo_prefix="$__cdist_object_self" + else + __cdist_echo_prefix="" fi set -u From f08a9eaaa93f0624785382906000461de252bff1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:35:27 +0200 Subject: [PATCH 0582/5465] +: after object_self Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 755a3e60..ba45e927 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -154,7 +154,7 @@ __cdist_echo() set +u if [ "$__cdist_object_self" ]; then - __cdist_echo_prefix="$__cdist_object_self" + __cdist_echo_prefix="${__cdist_object_self}:" else __cdist_echo_prefix="" fi From d000de2be904d4c947a693584da9e70c62dcf073 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:36:21 +0200 Subject: [PATCH 0583/5465] code, not gencode Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 3259fb1b..2aeefddd 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -26,20 +26,20 @@ set -ue __cdist_object="$1"; shift -__cdist_gencode_type="$1"; shift +__cdist_code_type="$1"; shift if [ ! -d "$(__cdist_object_dir "$__cdist_object")" ]; then __cdist_exit_err "Object $__cdist_object is missing." fi -code="$(__cdist_object_code "$__cdist_object")-${__cdist_gencode_type}" +code="$(__cdist_object_code "$__cdist_object")-${__cdist_code_type}" -__cdist_echo info "Checking code-${__cdist_gencode_type}" +__cdist_echo info "Checking code-${__cdist_code_type}" if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then - echo "Executing code-${__cdist_gencode_type} for $__cdist_object ..." + echo "Executing code-${__cdist_code_type} for $__cdist_object ..." __cdist_exec_fail_on_error "$code" else __cdist_exit_err "$code exists, but is not executable." From d75f2d4d29cfa2f7e84aff29dee896fbbc1e3703 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:38:31 +0200 Subject: [PATCH 0584/5465] ++__cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 2aeefddd..8a121a08 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -39,7 +39,7 @@ __cdist_echo info "Checking code-${__cdist_code_type}" if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then - echo "Executing code-${__cdist_code_type} for $__cdist_object ..." + __cdist_echo info "Executing code-${__cdist_code_type}" __cdist_exec_fail_on_error "$code" else __cdist_exit_err "$code exists, but is not executable." From 9610dbf10f53f247485dcb52fbb59ef6cee5c85f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:40:18 +0200 Subject: [PATCH 0585/5465] __debconf_set_selections: cat the file referenced, not the parameter! Signed-off-by: Nico Schottelius --- conf/type/__debconf_set_selections/gencode-remote | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__debconf_set_selections/gencode-remote b/conf/type/__debconf_set_selections/gencode-remote index 156fc9f3..62be6a12 100755 --- a/conf/type/__debconf_set_selections/gencode-remote +++ b/conf/type/__debconf_set_selections/gencode-remote @@ -22,5 +22,5 @@ # echo "debconf-set-selections << __file-eof" -cat "$__object/parameter/file" +cat "$(cat "$__object/parameter/file")" echo "__file-eof" From af0afcb55fdd395e7f9982065a40c5ed6b0c8c82 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:41:25 +0200 Subject: [PATCH 0586/5465] 1.6.1 contains __debconf_set_selections bugfix Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index eb3f2184..7b4052c2 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.6.1: * Logging restructured * New Type __package_pkg_openbsd + * Bugfix: Type __debconf_set_selections used wrong contens for selection 1.6.0: 2011-04-06 * New Type __package_yum From cc67dfbfa1c32ddcbc4c45a7685d5b76c1db0cae Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:44:20 +0200 Subject: [PATCH 0587/5465] improved logging Signed-off-by: Nico Schottelius --- doc/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index 7b4052c2..edc797b9 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,5 @@ 1.6.1: - * Logging restructured + * Improved logging: Show code responsible for abort * New Type __package_pkg_openbsd * Bugfix: Type __debconf_set_selections used wrong contens for selection From 88a6ee385b87f31e1ce550742e87827296ceb106 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:46:21 +0200 Subject: [PATCH 0588/5465] always use uname -m, until it breaks Signed-off-by: Nico Schottelius --- conf/explorer/hardware_type | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/conf/explorer/hardware_type b/conf/explorer/hardware_type index 5966b11e..25fc76a9 100755 --- a/conf/explorer/hardware_type +++ b/conf/explorer/hardware_type @@ -22,10 +22,4 @@ # # -os="$($__explorer/os)" - -case "$os" in - archlinux|*bsd) - echo $(uname -m) - ;; -esac +uname -m From d0434ea56b70e4c62886fdd3c002990499c3275b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:46:40 +0200 Subject: [PATCH 0589/5465] 1.6.1++ Signed-off-by: Nico Schottelius --- bin/cdist-explorer-run-global | 2 +- doc/changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-explorer-run-global b/bin/cdist-explorer-run-global index 7a06a982..4b901964 100755 --- a/bin/cdist-explorer-run-global +++ b/bin/cdist-explorer-run-global @@ -27,7 +27,7 @@ set -ue __cdist_target_host="$1"; shift -echo "Running global explorers ..." +__cdist_info "Running global explorers ..." # copy the explorers cdist-dir push "$__cdist_target_host" \ diff --git a/doc/changelog b/doc/changelog index edc797b9..5f47e19f 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,7 @@ * Improved logging: Show code responsible for abort * New Type __package_pkg_openbsd * Bugfix: Type __debconf_set_selections used wrong contens for selection + * New explorer: hardware_type 1.6.0: 2011-04-06 * New Type __package_yum From cb5fc962b3d11f69c82583e110df516baad44f3b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:50:09 +0200 Subject: [PATCH 0590/5465] use __cdist prefix Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 4d8e2321..49480bfd 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -29,7 +29,7 @@ set -eu __cdist_target_host="$1"; shift __cdist_object="$1"; shift -__object_id="$(__cdist_object_id_from_object "$__cdist_object")" +__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" __cdist_type="$(__cdist_type_from_object "$__cdist_object")" # Check if type of object has >= 1 explorer @@ -53,7 +53,7 @@ if [ "$__cdist_has_explorer" ]; then # Execute explorers cdist-run-remote "$__cdist_target_host" \ "$__cdist_name_var_object=\"$(__cdist_remote_object_dir "$__cdist_object")\"" \ - "$__cdist_name_var_object_id=\"$__object_id\"" \ + "$__cdist_name_var_object_id=\"$__cdist_object_id\" \ "$__cdist_name_var_self=\"$__cdist_object\"" \ cdist-remote-explorer-run \ "$__cdist_name_var_type_explorer" \ From ec513eae49ad3a13c6758ee8664fc6dd9ee84b33 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:51:17 +0200 Subject: [PATCH 0591/5465] ++__cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-init | 2 +- bin/cdist-mass-deploy | 2 +- bin/cdist-object-explorer-run | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/cdist-manifest-run-init b/bin/cdist-manifest-run-init index 9f10c12c..da7af6ba 100755 --- a/bin/cdist-manifest-run-init +++ b/bin/cdist-manifest-run-init @@ -30,5 +30,5 @@ __cdist_target_host="$1"; shift eval export $__cdist_name_var_manifest=\"\$__cdist_manifest_dir\" -echo "Running initial manifest for $__cdist_target_host ..." +__cdist_echo info "Running initial manifest for $__cdist_target_host ..." cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 2753bcab..fae9e633 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -42,6 +42,6 @@ done # else wait after all are started if [ "$parallel" ]; then - echo "Waiting for cdist-deploy-to jobs to finish..." + __cdist_echo info "Waiting for cdist-deploy-to jobs to finish..." wait fi diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 49480bfd..1e0fc36f 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -31,6 +31,7 @@ __cdist_object="$1"; shift __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" __cdist_type="$(__cdist_type_from_object "$__cdist_object")" +__cdist_object_self="$__cdist_type/$__cdist_object_id" # Check if type of object has >= 1 explorer __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" From 8924a9583d4390c997ece244641ef1581d4e113e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:52:14 +0200 Subject: [PATCH 0592/5465] ++__cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-config | 4 ++++ bin/cdist-object-explorer-run | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index ba45e927..4bf08511 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -175,6 +175,10 @@ __cdist_echo() error) echo $__cdist_echo_prefix "Error: $@" >&2 ;; + *) + echo "CORE BUG, who created the broken commit?" >&2 + exit 23 + ;; esac } diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 1e0fc36f..7a5068e4 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -40,7 +40,7 @@ if [ "$__cdist_has_explorer" ]; then if ! __cdist_type_explorer_pushed "$__cdist_type"; then src_dir="$(__cdist_type_explorer_dir "$__cdist_type")" dst_dir="$(__cdist_remote_type_explorer_dir "$__cdist_type")" - echo "Transfering explorers for $__cdist_type ..." + __cdist_echo info "Transfering explorers for $__cdist_type ..." cdist-dir push "$__cdist_target_host" "$src_dir" "$dst_dir" __cdist_type_explorer_pushed_add "$__cdist_type" fi From 1f4e8fe5648e8688d465304b2114800a4bc4b4eb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:54:34 +0200 Subject: [PATCH 0593/5465] do not create code if there is no gencode Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index 1ba1116b..465d6f1e 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -44,14 +44,14 @@ export __global="$__cdist_out_dir" cd "$__cdist_local_base_dir" -cat << eof +if [ -x "$gencode" ]; then + cat << eof # # The following code is imported from output of $gencode # eof -if [ -x "$gencode" ]; then __cdist_exec_fail_on_error "$gencode" else if [ -f "$gencode" ]; then From 2162d444b3fd211a26af3c282544c41168402681 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:55:53 +0200 Subject: [PATCH 0594/5465] better logging in __cdist_exec_fail_on_error Signed-off-by: Nico Schottelius --- bin/cdist-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 4bf08511..789f41a8 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -187,7 +187,8 @@ __cdist_exec_fail_on_error() set +e sh -e "$@" if [ "$?" -ne 0 ]; then - __cdist_echo error "$1 exited non-zero, showing code:" + __cdist_echo error "$1 exited non-zero" + __cdist_echo info "Faulty code:" cat "$1" __cdist_exit_err "Aborting due to non-zero exit code." fi From caed694dee937a5302caf5416fb79bd9b22fd3d8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:58:34 +0200 Subject: [PATCH 0595/5465] ++__cdist_echo + FIXME Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 2 +- bin/cdist-object-gencode-run | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 7a5068e4..b782de55 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -45,7 +45,7 @@ if [ "$__cdist_has_explorer" ]; then __cdist_type_explorer_pushed_add "$__cdist_type" fi - echo "Running explorers for $__cdist_object ..." + __cdist_echo info "Running explorers for $__cdist_object ..." # Copy object parameters cdist-dir push "$__cdist_target_host" \ "$(__cdist_object_parameter_dir "$__cdist_object")" \ diff --git a/bin/cdist-object-gencode-run b/bin/cdist-object-gencode-run index 4d21fec9..a24d78bc 100755 --- a/bin/cdist-object-gencode-run +++ b/bin/cdist-object-gencode-run @@ -32,11 +32,14 @@ __cdist_object="$1"; shift __cdist_code_local="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_local}" __cdist_code_remote="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_remote}" -echo "Generating local code for $__cdist_object ..." +# FIXME: check that no file is created if there is no gencode +# probably move output code to cdist-object-gencode + +__cdist_echo info "Generating local code for $__cdist_object ..." cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ "${__cdist_name_gencode_local}" > "${__cdist_code_local}" -echo "Generating remote code for $__cdist_object ..." +__cdist_echo info "Generating remote code for $__cdist_object ..." cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ "${__cdist_name_gencode_remote}" > "${__cdist_code_remote}" From a08bd18f4ec8b51fa7aea2df9385335a992ae2cc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 20:59:57 +0200 Subject: [PATCH 0596/5465] make first real use of new __cdist_echo with __cdist_object_self setup Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode-run | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bin/cdist-object-gencode-run b/bin/cdist-object-gencode-run index a24d78bc..375b7cc1 100755 --- a/bin/cdist-object-gencode-run +++ b/bin/cdist-object-gencode-run @@ -27,20 +27,19 @@ set -eu __cdist_target_host="$1"; shift -__cdist_object="$1"; shift +__cdist_object_self="$1"; shift -__cdist_code_local="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_local}" -__cdist_code_remote="$(__cdist_object_code "$__cdist_object")-${__cdist_name_gencode_remote}" +__cdist_code_local="$(__cdist_object_code "$__cdist_object_self")-${__cdist_name_gencode_local}" +__cdist_code_remote="$(__cdist_object_code "$__cdist_object_self")-${__cdist_name_gencode_remote}" # FIXME: check that no file is created if there is no gencode # probably move output code to cdist-object-gencode - -__cdist_echo info "Generating local code for $__cdist_object ..." -cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ +__cdist_echo info "Generating local code ..." +cdist-object-gencode "$__cdist_target_host" "$__cdist_object_self" \ "${__cdist_name_gencode_local}" > "${__cdist_code_local}" -__cdist_echo info "Generating remote code for $__cdist_object ..." -cdist-object-gencode "$__cdist_target_host" "$__cdist_object" \ +__cdist_echo info "Generating remote code ..." +cdist-object-gencode "$__cdist_target_host" "$__cdist_object_self" \ "${__cdist_name_gencode_remote}" > "${__cdist_code_remote}" chmod u+x "${__cdist_code_local}" "${__cdist_code_remote}" From dfd0eefb917018d5653c2641ddf762d292505ecd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:01:27 +0200 Subject: [PATCH 0597/5465] include version in html directory on web Signed-off-by: Nico Schottelius --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index e033c007..d94b7a5d 100755 --- a/build.sh +++ b/build.sh @@ -88,6 +88,7 @@ case "$1" in cp README ${WEBDIR}/${WEBPAGE} rm -rf ${WEBDIR}/${WEBBASE}/man && mkdir ${WEBDIR}/${WEBBASE}/man cp ${MAN1DSTDIR}/*.html ${MAN7DSTDIR}/*.html ${WEBDIR}/${WEBBASE}/man + git describe > ${WEBDIR}/${WEBBASE}/man/VERSION cd ${WEBDIR} && git add ${WEBBASE}/man cd ${WEBDIR} && git commit -m "cdist update" ${WEBBASE} ${WEBPAGE} cd ${WEBDIR} && make pub From df58c4e5f5a3d6e28899d9fc98bd5f1e71167268 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:03:37 +0200 Subject: [PATCH 0598/5465] echo, not info Signed-off-by: Nico Schottelius --- bin/cdist-explorer-run-global | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-explorer-run-global b/bin/cdist-explorer-run-global index 4b901964..17bc3d79 100755 --- a/bin/cdist-explorer-run-global +++ b/bin/cdist-explorer-run-global @@ -27,7 +27,7 @@ set -ue __cdist_target_host="$1"; shift -__cdist_info "Running global explorers ..." +__cdist_echo info "Running global explorers ..." # copy the explorers cdist-dir push "$__cdist_target_host" \ From 96c4024a51eaff1e16474fe636076fe90a91b0d5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:07:39 +0200 Subject: [PATCH 0599/5465] bugfix + real use of __cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index b782de55..ac39755b 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -27,11 +27,10 @@ set -eu __cdist_target_host="$1"; shift -__cdist_object="$1"; shift +__cdist_object_self="$1"; shift __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" __cdist_type="$(__cdist_type_from_object "$__cdist_object")" -__cdist_object_self="$__cdist_type/$__cdist_object_id" # Check if type of object has >= 1 explorer __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" @@ -45,7 +44,7 @@ if [ "$__cdist_has_explorer" ]; then __cdist_type_explorer_pushed_add "$__cdist_type" fi - __cdist_echo info "Running explorers for $__cdist_object ..." + __cdist_echo info "Running explorers ..." # Copy object parameters cdist-dir push "$__cdist_target_host" \ "$(__cdist_object_parameter_dir "$__cdist_object")" \ @@ -53,9 +52,9 @@ if [ "$__cdist_has_explorer" ]; then # Execute explorers cdist-run-remote "$__cdist_target_host" \ - "$__cdist_name_var_object=\"$(__cdist_remote_object_dir "$__cdist_object")\"" \ - "$__cdist_name_var_object_id=\"$__cdist_object_id\" \ - "$__cdist_name_var_self=\"$__cdist_object\"" \ + "$__cdist_name_var_object=\"$(__cdist_remote_object_dir "$__cdist_object_self")\"" \ + "$__cdist_name_var_object_id=\"$__cdist_object_id\"" \ + "$__cdist_name_var_self=\"$__cdist_object_self\"" \ cdist-remote-explorer-run \ "$__cdist_name_var_type_explorer" \ "$(__cdist_remote_type_explorer_dir "$__cdist_type")" \ From 0580406ff2d35fa4b7ca150f8c25004466adcad2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:08:40 +0200 Subject: [PATCH 0600/5465] there is no __cdist_object in this context Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index ac39755b..ed001e83 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -29,8 +29,8 @@ set -eu __cdist_target_host="$1"; shift __cdist_object_self="$1"; shift -__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" -__cdist_type="$(__cdist_type_from_object "$__cdist_object")" +__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" +__cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" # Check if type of object has >= 1 explorer __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" @@ -47,8 +47,8 @@ if [ "$__cdist_has_explorer" ]; then __cdist_echo info "Running explorers ..." # Copy object parameters cdist-dir push "$__cdist_target_host" \ - "$(__cdist_object_parameter_dir "$__cdist_object")" \ - "$(__cdist_remote_object_parameter_dir "$__cdist_object")" + "$(__cdist_object_parameter_dir "$__cdist_object_self")" \ + "$(__cdist_remote_object_parameter_dir "$__cdist_object_self")" # Execute explorers cdist-run-remote "$__cdist_target_host" \ @@ -58,10 +58,10 @@ if [ "$__cdist_has_explorer" ]; then cdist-remote-explorer-run \ "$__cdist_name_var_type_explorer" \ "$(__cdist_remote_type_explorer_dir "$__cdist_type")" \ - "$(__cdist_remote_object_type_explorer_dir "$__cdist_object")" + "$(__cdist_remote_object_type_explorer_dir "$__cdist_object_self")" # Copy back results cdist-dir pull "$__cdist_target_host" \ - "$(__cdist_remote_object_type_explorer_dir "$__cdist_object")" \ - "$(__cdist_object_type_explorer_dir "$__cdist_object")" + "$(__cdist_remote_object_type_explorer_dir "$__cdist_object_self")" \ + "$(__cdist_object_type_explorer_dir "$__cdist_object_self")" fi From afdecb883686619cca5b39829a91745aa253b4e0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:10:34 +0200 Subject: [PATCH 0601/5465] ++__cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-object-manifest-run | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index ce44cbbc..56aec782 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -27,14 +27,15 @@ set -eu __cdist_target_host="$1"; shift -__cdist_object="$1"; shift +__cdist_object_self="$1"; shift -__cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object")" -__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" +# FIXME: rename to __cdist_object_dir (everywhere!) +__cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object_self")" +__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" -echo "Checking manifest for $__cdist_object ..." +__cdist_echo info "Checking manifest ..." -__cdist_type="$(__cdist_type_from_object "$__cdist_object")" +__cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" __cdist_manifest="$(__cdist_type_manifest "$__cdist_type")" if [ -f "$__cdist_manifest" ]; then @@ -42,7 +43,7 @@ if [ -f "$__cdist_manifest" ]; then # Make __cdist_manifest available for cdist-type-emulator export __cdist_manifest - echo "Executing manifest ${__cdist_manifest} ..." + __cdist_echo "Executing manifest ${__cdist_manifest} ..." export $__cdist_name_var_object="$__cdist_cur_object_dir" export $__cdist_name_var_object_id="$__cdist_object_id" export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" From 4a7c6c2738a7427c01ba607a50333ab7e2b794f3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:12:00 +0200 Subject: [PATCH 0602/5465] ++__cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-object-prepare | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/cdist-object-prepare b/bin/cdist-object-prepare index 8c92ff73..d21d8a63 100755 --- a/bin/cdist-object-prepare +++ b/bin/cdist-object-prepare @@ -29,19 +29,18 @@ set -eu __cdist_target_host="$1"; shift -__cdist_object="$1"; shift -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" -[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Object undefined: $__cdist_object" +__cdist_object_self="$1"; shift +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" +[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Object undefined" # Export to non-core for use in manifest and gencode scripts -export $__cdist_name_var_self=$__cdist_object +export $__cdist_name_var_self=$__cdist_object_self -__cdist_object_prepared="$(__cdist_object_prepared "$__cdist_object")" +__cdist_object_prepared="$(__cdist_object_prepared "$__cdist_object_self")" if [ ! -f "$__cdist_object_prepared" ]; then - echo - echo "Preparing object $__cdist_object" - cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object" - cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object" + __cdist_echo info "Preparing object" + cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object_self" + cdist-object-manifest-run "$__cdist_target_host" "$__cdist_object_self" # Mark this object as prepared touch "$__cdist_object_prepared" From 35d4760c13c2532110417f7e318f3bd31f78847f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:15:11 +0200 Subject: [PATCH 0603/5465] ++__cdist_echo ++todo Signed-off-by: Nico Schottelius --- bin/cdist-object-push | 8 ++++---- bin/cdist-object-run | 16 +++++++--------- doc/dev/todo/TAKEME | 2 ++ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/cdist-object-push b/bin/cdist-object-push index f7d46be4..9fda2cea 100755 --- a/bin/cdist-object-push +++ b/bin/cdist-object-push @@ -27,9 +27,9 @@ set -eu __cdist_target_host="$1"; shift -__cdist_object="$1"; shift +__cdist_object_self="$1"; shift -echo "Transferring object $__cdist_object to $__cdist_target_host ..." +__cdist_echo info "Transferring object $__cdist_target_host ..." cdist-dir push "$__cdist_target_host" \ - "$(__cdist_object_dir "$__cdist_object")" \ - "$(__cdist_remote_object_dir "$__cdist_object")" + "$(__cdist_object_dir "$__cdist_object_self")" \ + "$(__cdist_remote_object_dir "$__cdist_object_self")" diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 667bf386..c5f738ca 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -32,17 +32,17 @@ set -eu __cdist_target_host="$1"; shift -__cdist_object="$1"; shift -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" -[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Requested object is not defined: $__cdist_object" +__cdist_object_self="$1"; shift +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" +[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Object undefined" # Export to non-core for use in manifest and gencode scripts -export $__cdist_name_var_self=$__cdist_object +export $__cdist_name_var_self=$__cdist_object_self -__cdist_object_finished="$(__cdist_object_finished "$__cdist_object")" +__cdist_object_finished="$(__cdist_object_finished "$__cdist_object_self")" if [ ! -f "$__cdist_object_finished" ]; then # Resolve dependencies, if any - __cdist_object_require="$(__cdist_object_require "$__cdist_object")" + __cdist_object_require="$(__cdist_object_require "$__cdist_object_self")" if [ -f "$__cdist_object_require" ]; then echo # NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP @@ -52,13 +52,11 @@ if [ ! -f "$__cdist_object_finished" ]; then while [ $# -gt 0 ]; do __cdist_requirement="$1"; shift - echo "Resolving dependency $__cdist_requirement for $__cdist_object ..." + echo "Resolving dependency $__cdist_requirement" cdist-object-run "$__cdist_target_host" "$__cdist_requirement" done fi - echo - echo "Running object $__cdist_object" cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" cdist-object-push "$__cdist_target_host" "$__cdist_object" cdist-object-code-run "$__cdist_target_host" "$__cdist_object" diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index 0fcced96..d456ae35 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -5,6 +5,8 @@ Feel free to pick one! CORE ---- +- Inconsistent error messages if object is not existing! + -> always use "Object undefined" - Add echo function / beautify output __cdist_echo [level] [messages...] level := syslog alike: From 838d43d74c70a301d76a47e271efd1cab2181049 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:17:11 +0200 Subject: [PATCH 0604/5465] do not fail if code is missing, but inform Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 8a121a08..6389a060 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -29,7 +29,7 @@ __cdist_object="$1"; shift __cdist_code_type="$1"; shift if [ ! -d "$(__cdist_object_dir "$__cdist_object")" ]; then - __cdist_exit_err "Object $__cdist_object is missing." + __cdist_exit_err "Object undefined" fi code="$(__cdist_object_code "$__cdist_object")-${__cdist_code_type}" @@ -48,5 +48,5 @@ if [ -e "$code" ]; then __cdist_exit_err "$code exists, but is not a file." fi else - __cdist_exit_err "Missing code for ${__cdist_object}." + __cdist_echo info "No code-${__cdist_code_type}" fi From fb0dafba5c6131ade0f841b22163c86f5d672b6d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:18:15 +0200 Subject: [PATCH 0605/5465] make faulty code a warning Signed-off-by: Nico Schottelius --- bin/cdist-config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 789f41a8..273569a6 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -169,7 +169,7 @@ __cdist_echo() info) echo $__cdist_echo_prefix "$@" ;; - warning) + warn) echo $__cdist_echo_prefix "Warning: $@" ;; error) @@ -188,7 +188,7 @@ __cdist_exec_fail_on_error() sh -e "$@" if [ "$?" -ne 0 ]; then __cdist_echo error "$1 exited non-zero" - __cdist_echo info "Faulty code:" + __cdist_echo warn "Faulty code:" cat "$1" __cdist_exit_err "Aborting due to non-zero exit code." fi From 05c8634f8b3dc20fce2a9cc878deb7abefd8d4a4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:19:21 +0200 Subject: [PATCH 0606/5465] correctly use __cdist_echo Signed-off-by: Nico Schottelius --- bin/cdist-object-manifest-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index 56aec782..bf50fc2c 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -43,7 +43,7 @@ if [ -f "$__cdist_manifest" ]; then # Make __cdist_manifest available for cdist-type-emulator export __cdist_manifest - __cdist_echo "Executing manifest ${__cdist_manifest} ..." + __cdist_echo info "Executing manifest ${__cdist_manifest} ..." export $__cdist_name_var_object="$__cdist_cur_object_dir" export $__cdist_name_var_object_id="$__cdist_object_id" export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" From bb96163315172a1195cb240e713b5dd8ecb4add6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:19:47 +0200 Subject: [PATCH 0607/5465] blame on the right file Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 273569a6..ca8525ea 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -176,7 +176,7 @@ __cdist_echo() echo $__cdist_echo_prefix "Error: $@" >&2 ;; *) - echo "CORE BUG, who created the broken commit?" >&2 + echo "CORE BUG, who created the broken commit in $0?" >&2 exit 23 ;; esac From 49e8efdaf5e62d04f0c7bcdf3f97f24abad3deb0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:20:58 +0200 Subject: [PATCH 0608/5465] object self, not object Signed-off-by: Nico Schottelius --- bin/cdist-object-run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cdist-object-run b/bin/cdist-object-run index c5f738ca..3eb301f3 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -57,9 +57,9 @@ if [ ! -f "$__cdist_object_finished" ]; then done fi - cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object" - cdist-object-push "$__cdist_target_host" "$__cdist_object" - cdist-object-code-run "$__cdist_target_host" "$__cdist_object" + cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object_self" + cdist-object-push "$__cdist_target_host" "$__cdist_object_self" + cdist-object-code-run "$__cdist_target_host" "$__cdist_object_self" # Mark this object as done touch "$__cdist_object_finished" From c0a83f9d854096ccbdd338e8bc35f6b643cfba0b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:22:44 +0200 Subject: [PATCH 0609/5465] ++__cdist_exit_err Signed-off-by: Nico Schottelius --- bin/cdist-object-run | 2 +- bin/cdist-remote-explorer-run | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 3eb301f3..5224637e 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -52,7 +52,7 @@ if [ ! -f "$__cdist_object_finished" ]; then while [ $# -gt 0 ]; do __cdist_requirement="$1"; shift - echo "Resolving dependency $__cdist_requirement" + __cdist_echo info "Resolving dependency $__cdist_requirement" cdist-object-run "$__cdist_target_host" "$__cdist_requirement" done fi diff --git a/bin/cdist-remote-explorer-run b/bin/cdist-remote-explorer-run index cef91e0d..d95913ba 100755 --- a/bin/cdist-remote-explorer-run +++ b/bin/cdist-remote-explorer-run @@ -55,16 +55,14 @@ for explorer in "$__cdist_explorer_dir/"*; do if [ -f "$explorer" ]; then if [ ! -x "$explorer" ]; then - echo "Explorer \"$explorer\" exists, but is not executable." >&2 - exit 1 + __cdist_exit_err "Explorer \"$explorer\" exists, but is not executable." fi # Execute explorers and save results in remote destination directory "$explorer" > "${__cdist_my_out_dir}/$explorer_name" else if [ -e "$explorer" ]; then - echo "Explorer \"$explorer\" exists, but is not a file." >&2 - exit 1 + __cdist_exit_err "Explorer \"$explorer\" exists, but is not a file." fi fi done From 74c1147ec3f89df6eb9619a3f8a6dec761e387da Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:26:10 +0200 Subject: [PATCH 0610/5465] nicotodo++ Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 5df1cb61..2e5a179b 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,5 +1,8 @@ + Introduce better logging +Fix bin/cdist-type-template + Cleanup documentation: type reference -> add types + manpages add explorer reference From b86d3ba26a3a47c2a10c8997585c8f1f3f46cc15 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:38:41 +0200 Subject: [PATCH 0611/5465] remove ugly OBJECT messages Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 2dcb47b3..8ff190ad 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -99,7 +99,7 @@ done set +u for requirement in $require; do echo $requirement >> "$(__cdist_object_require "$__cdist_object_self")" - echo Object $__cdist_object_self requires $requirement + __cdist_echo info "Recording requirement $requirement" done set -u From 315de6fe159853c17f65f4e52cb6a3d18335b311 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:41:40 +0200 Subject: [PATCH 0612/5465] log improvements Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode | 10 +++++----- bin/cdist-object-run | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index 465d6f1e..2c89ce7c 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -27,12 +27,12 @@ set -eu __cdist_target_host="$1"; shift -__cdist_object="$1"; shift +__cdist_object_self="$1"; shift __cdist_gencode_type="$1"; shift -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object")" -__cdist_type="$(__cdist_type_from_object "$__cdist_object")" -__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object")" +__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" +__cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" +__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" # Full path to where the executable of the type should exist, if the type has one gencode="$(__cdist_type_gencode "$__cdist_type")-${__cdist_gencode_type}" @@ -55,7 +55,7 @@ eof __cdist_exec_fail_on_error "$gencode" else if [ -f "$gencode" ]; then - echo "Warning: $gencode exists, but is not executable" >&2 + __cdist_exit_err "$gencode exists, but is not executable" fi # No gencode? also fine! Ensure we exit 0 diff --git a/bin/cdist-object-run b/bin/cdist-object-run index 5224637e..4f40e7c1 100755 --- a/bin/cdist-object-run +++ b/bin/cdist-object-run @@ -44,7 +44,6 @@ if [ ! -f "$__cdist_object_finished" ]; then # Resolve dependencies, if any __cdist_object_require="$(__cdist_object_require "$__cdist_object_self")" if [ -f "$__cdist_object_require" ]; then - echo # NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP while read __cdist_requirement; do set -- "$@" "$__cdist_requirement" @@ -52,7 +51,7 @@ if [ ! -f "$__cdist_object_finished" ]; then while [ $# -gt 0 ]; do __cdist_requirement="$1"; shift - __cdist_echo info "Resolving dependency $__cdist_requirement" + __cdist_echo info "Resolving requirement $__cdist_requirement" cdist-object-run "$__cdist_target_host" "$__cdist_requirement" done fi From e7ad5987e425873c30752fe059f90d1dcad7cab3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:43:32 +0200 Subject: [PATCH 0613/5465] + self variable Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 6389a060..17b7c4a1 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -25,14 +25,14 @@ [ $# -eq 2 ] || __cdist_usage " " set -ue -__cdist_object="$1"; shift +__cdist_object_self="$1"; shift __cdist_code_type="$1"; shift -if [ ! -d "$(__cdist_object_dir "$__cdist_object")" ]; then +if [ ! -d "$(__cdist_object_dir "$__cdist_object_self")" ]; then __cdist_exit_err "Object undefined" fi -code="$(__cdist_object_code "$__cdist_object")-${__cdist_code_type}" +code="$(__cdist_object_code "$__cdist_object_self")-${__cdist_code_type}" __cdist_echo info "Checking code-${__cdist_code_type}" From 31164be1d0c8c1b289c3525f8e36cd9a578e0b93 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:44:41 +0200 Subject: [PATCH 0614/5465] remove full path to manifest in logging (will be presented on error anyway) Signed-off-by: Nico Schottelius --- bin/cdist-object-manifest-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index bf50fc2c..3b1b5254 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -43,7 +43,7 @@ if [ -f "$__cdist_manifest" ]; then # Make __cdist_manifest available for cdist-type-emulator export __cdist_manifest - __cdist_echo info "Executing manifest ${__cdist_manifest} ..." + __cdist_echo info "Executing manifest ..." export $__cdist_name_var_object="$__cdist_cur_object_dir" export $__cdist_name_var_object_id="$__cdist_object_id" export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" From bc1c7f104eb30193df526e5761e3ee048ffb35e6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:50:49 +0200 Subject: [PATCH 0615/5465] core prefix Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- bin/cdist-object-push | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index ca8525ea..a36af881 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -156,7 +156,7 @@ __cdist_echo() if [ "$__cdist_object_self" ]; then __cdist_echo_prefix="${__cdist_object_self}:" else - __cdist_echo_prefix="" + __cdist_echo_prefix="core: " fi set -u diff --git a/bin/cdist-object-push b/bin/cdist-object-push index 9fda2cea..62b00cb2 100755 --- a/bin/cdist-object-push +++ b/bin/cdist-object-push @@ -29,7 +29,7 @@ set -eu __cdist_target_host="$1"; shift __cdist_object_self="$1"; shift -__cdist_echo info "Transferring object $__cdist_target_host ..." +__cdist_echo info "Transferring object" cdist-dir push "$__cdist_target_host" \ "$(__cdist_object_dir "$__cdist_object_self")" \ "$(__cdist_remote_object_dir "$__cdist_object_self")" From 0a3a434269bbc00bcdf21556dc9e92c9a520951f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 21:51:43 +0200 Subject: [PATCH 0616/5465] remove ... dots ... make ... me ...feel ... weired Signed-off-by: Nico Schottelius --- bin/cdist-cache | 2 +- bin/cdist-config | 2 +- bin/cdist-deploy-to | 4 ++-- bin/cdist-explorer-run-global | 2 +- bin/cdist-manifest-run-init | 2 +- bin/cdist-mass-deploy | 4 ++-- bin/cdist-object-explorer-run | 4 ++-- bin/cdist-object-gencode-run | 4 ++-- bin/cdist-object-manifest-run | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/cdist-cache b/bin/cdist-cache index 5ba51442..bfb1a5b3 100755 --- a/bin/cdist-cache +++ b/bin/cdist-cache @@ -32,6 +32,6 @@ __cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")" # Create base to move into mkdir -p "$(__cdist_cache_dir)" -__cdist_echo info "Saving cache to $__cdist_ddir ..." +__cdist_echo info "Saving cache to $__cdist_ddir " rm -rf "$__cdist_ddir" mv "$__cdist_local_base_dir" "$__cdist_ddir" diff --git a/bin/cdist-config b/bin/cdist-config index a36af881..4346c0cb 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -207,7 +207,7 @@ __cdist_usage() __cdist_init_deploy() { - echo "Creating clean directory structure ..." + __cdist_echo info "Creating clean directory structure " # Ensure there is no old stuff, neither local nor remote rm -rf "$__cdist_local_base_dir" diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index ddb36fca..138248d6 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -34,7 +34,7 @@ export $__cdist_name_var_target_user="$__cdist_remote_user" # Export variables for core, which others do not reset export __cdist_local_base_dir -__cdist_echo info "cdist $__cdist_version: Configuring $__cdist_target_host ..." +__cdist_echo info "cdist $__cdist_version: Configuring $__cdist_target_host " ################################################################################ # See cdist-stages(7) @@ -44,7 +44,7 @@ __cdist_echo info "cdist $__cdist_version: Configuring $__cdist_target_host ..." __cdist_init_deploy "$__cdist_target_host" # Transfer cdist executables -__cdist_echo info "Transferring cdist binaries to the target host ..." +__cdist_echo info "Transferring cdist binaries to the target host " cdist-dir push "$__cdist_target_host" \ "${__cdist_abs_mydir}" "${__cdist_remote_bin_dir}" cdist-explorer-run-global "$__cdist_target_host" diff --git a/bin/cdist-explorer-run-global b/bin/cdist-explorer-run-global index 17bc3d79..b0c024f2 100755 --- a/bin/cdist-explorer-run-global +++ b/bin/cdist-explorer-run-global @@ -27,7 +27,7 @@ set -ue __cdist_target_host="$1"; shift -__cdist_echo info "Running global explorers ..." +__cdist_echo info "Running global explorers " # copy the explorers cdist-dir push "$__cdist_target_host" \ diff --git a/bin/cdist-manifest-run-init b/bin/cdist-manifest-run-init index da7af6ba..28acc623 100755 --- a/bin/cdist-manifest-run-init +++ b/bin/cdist-manifest-run-init @@ -30,5 +30,5 @@ __cdist_target_host="$1"; shift eval export $__cdist_name_var_manifest=\"\$__cdist_manifest_dir\" -__cdist_echo info "Running initial manifest for $__cdist_target_host ..." +__cdist_echo info "Running initial manifest for $__cdist_target_host " cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index fae9e633..8a555411 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -22,7 +22,7 @@ # . cdist-config -[ $# -ge 1 ] || __cdist_usage "[-p] [target host ...]" +[ $# -ge 1 ] || __cdist_usage "[-p] [target host ]" set -eu parallel="" @@ -42,6 +42,6 @@ done # else wait after all are started if [ "$parallel" ]; then - __cdist_echo info "Waiting for cdist-deploy-to jobs to finish..." + __cdist_echo info "Waiting for cdist-deploy-to jobs to finish" wait fi diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index ed001e83..79cd2865 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -39,12 +39,12 @@ if [ "$__cdist_has_explorer" ]; then if ! __cdist_type_explorer_pushed "$__cdist_type"; then src_dir="$(__cdist_type_explorer_dir "$__cdist_type")" dst_dir="$(__cdist_remote_type_explorer_dir "$__cdist_type")" - __cdist_echo info "Transfering explorers for $__cdist_type ..." + __cdist_echo info "Transfering explorers for $__cdist_type " cdist-dir push "$__cdist_target_host" "$src_dir" "$dst_dir" __cdist_type_explorer_pushed_add "$__cdist_type" fi - __cdist_echo info "Running explorers ..." + __cdist_echo info "Running explorers " # Copy object parameters cdist-dir push "$__cdist_target_host" \ "$(__cdist_object_parameter_dir "$__cdist_object_self")" \ diff --git a/bin/cdist-object-gencode-run b/bin/cdist-object-gencode-run index 375b7cc1..bada6aee 100755 --- a/bin/cdist-object-gencode-run +++ b/bin/cdist-object-gencode-run @@ -34,11 +34,11 @@ __cdist_code_remote="$(__cdist_object_code "$__cdist_object_self")-${__cdist_nam # FIXME: check that no file is created if there is no gencode # probably move output code to cdist-object-gencode -__cdist_echo info "Generating local code ..." +__cdist_echo info "Generating local code " cdist-object-gencode "$__cdist_target_host" "$__cdist_object_self" \ "${__cdist_name_gencode_local}" > "${__cdist_code_local}" -__cdist_echo info "Generating remote code ..." +__cdist_echo info "Generating remote code " cdist-object-gencode "$__cdist_target_host" "$__cdist_object_self" \ "${__cdist_name_gencode_remote}" > "${__cdist_code_remote}" diff --git a/bin/cdist-object-manifest-run b/bin/cdist-object-manifest-run index 3b1b5254..34d4f867 100755 --- a/bin/cdist-object-manifest-run +++ b/bin/cdist-object-manifest-run @@ -33,7 +33,7 @@ __cdist_object_self="$1"; shift __cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object_self")" __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" -__cdist_echo info "Checking manifest ..." +__cdist_echo info "Checking manifest " __cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" __cdist_manifest="$(__cdist_type_manifest "$__cdist_type")" @@ -43,7 +43,7 @@ if [ -f "$__cdist_manifest" ]; then # Make __cdist_manifest available for cdist-type-emulator export __cdist_manifest - __cdist_echo info "Executing manifest ..." + __cdist_echo info "Executing manifest " export $__cdist_name_var_object="$__cdist_cur_object_dir" export $__cdist_name_var_object_id="$__cdist_object_id" export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")" From b0391ac0c9b8041c59d7aa8b2349bca1e0fbbb7d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 22:09:04 +0200 Subject: [PATCH 0617/5465] BUGFIX: do not fail, if cache/ is missing Signed-off-by: Nico Schottelius --- bin/cdist-cache | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/cdist-cache b/bin/cdist-cache index bfb1a5b3..ee27ffb4 100755 --- a/bin/cdist-cache +++ b/bin/cdist-cache @@ -27,10 +27,12 @@ set -u __cdist_target_host="$1"; shift -__cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")" # Create base to move into -mkdir -p "$(__cdist_cache_dir)" +mkdir -p "${__cdist_local_base_cache_dir}" + +# Now determine absolute path +__cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")" __cdist_echo info "Saving cache to $__cdist_ddir " rm -rf "$__cdist_ddir" From d39457b0a740bff5f2059b9344887d62939a1c01 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 22:13:30 +0200 Subject: [PATCH 0618/5465] document how to report bugs Signed-off-by: Nico Schottelius --- doc/man/man7/cdist-hacker.text | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/man/man7/cdist-hacker.text b/doc/man/man7/cdist-hacker.text index 27f92a4a..f9f08e31 100644 --- a/doc/man/man7/cdist-hacker.text +++ b/doc/man/man7/cdist-hacker.text @@ -19,6 +19,13 @@ twice before merging or implementing a feature: Less features with good usability are far better than the opposite. +REPORTING BUGS +-------------- +If you believe you've found a bug and verified that it is +in the latest version, drop a mail to the cdist mailing list, +subject prefixed with "[BUG] ". + + UNDERSTANDING CDIST INTERNALS ----------------------------- IF you are interested in how cdist internally works, you can open @@ -32,6 +39,7 @@ 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. + CODING CONVENTIONS (CORE) ------------------------- - All variables exported by cdist are prefixed with a double underscore (__) From ad9cac5fb604b7cd910e66ea23a90a7b8412b209 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 22:22:52 +0200 Subject: [PATCH 0619/5465] 1.6.1 has another bugfix Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 5f47e19f..4a9cb2a8 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,7 @@ * Improved logging: Show code responsible for abort * New Type __package_pkg_openbsd * Bugfix: Type __debconf_set_selections used wrong contens for selection + * Bugfix: Don't fail, if cache directory is not existing * New explorer: hardware_type 1.6.0: 2011-04-06 From 3c37ac0b0f9746e3524c009027efd8377a1db609 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 22:24:11 +0200 Subject: [PATCH 0620/5465] do not fail if nothing todo (__user and __group) Signed-off-by: Nico Schottelius --- conf/type/__group/gencode-remote | 6 +++++- conf/type/__user/gencode-remote | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/conf/type/__group/gencode-remote b/conf/type/__group/gencode-remote index 4cb05762..5d43a054 100755 --- a/conf/type/__group/gencode-remote +++ b/conf/type/__group/gencode-remote @@ -43,7 +43,11 @@ if grep -q "^${name}:" "$__object/explorer/group"; then fi done - [ $# -gt 0 ] && echo groupmod $@ $name + if [ $# -gt 0 ]; then + echo groupmod "$@" "$name" + else + true + fi else for property in $(ls .); do new_value="$(cat "$property")" diff --git a/conf/type/__user/gencode-remote b/conf/type/__user/gencode-remote index 7670b943..31c93655 100755 --- a/conf/type/__user/gencode-remote +++ b/conf/type/__user/gencode-remote @@ -59,7 +59,11 @@ if grep -q "^${name}:" "$__object/explorer/passwd"; then fi done - [ $# -gt 0 ] && echo usermod "$@" "$name" + if [ $# -gt 0 ]; then + echo usermod "$@" "$name" + else + true + fi else for property in $(ls .); do new_value="$(cat "$property")" From 152efae913292e80a76c6af8b9a82990000291fb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 22:24:57 +0200 Subject: [PATCH 0621/5465] document bugfix of __user and __group Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 4a9cb2a8..1a38a2bd 100644 --- a/doc/changelog +++ b/doc/changelog @@ -3,6 +3,7 @@ * New Type __package_pkg_openbsd * Bugfix: Type __debconf_set_selections used wrong contens for selection * Bugfix: Don't fail, if cache directory is not existing + * Bugfix: __user and __group exited non-zero if no change was necessary * New explorer: hardware_type 1.6.0: 2011-04-06 From 6648535c6d61755fe95c259da29862a63d97c9ee Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 22:39:00 +0200 Subject: [PATCH 0622/5465] --nicotodo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index 2e5a179b..db1ba10a 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +1,3 @@ - -Introduce better logging - Fix bin/cdist-type-template Cleanup documentation: From b29538a78486b9aac975427c48f110255e3ed1b6 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 6 Apr 2011 23:26:28 +0200 Subject: [PATCH 0623/5465] new types: __autofs_map, __autofs_master Signed-off-by: Steven Armstrong --- conf/type/__autofs_map/man.text | 60 +++++++++++++++++++ conf/type/__autofs_map/manifest | 42 +++++++++++++ conf/type/__autofs_map/parameter/optional | 3 + conf/type/__autofs_map/parameter/required | 1 + .../__autofs_master/files/auto.master.header | 3 + conf/type/__autofs_master/gencode-local | 26 ++++++++ conf/type/__autofs_master/man.text | 47 +++++++++++++++ conf/type/__autofs_master/manifest | 31 ++++++++++ conf/type/__autofs_master/parameter/optional | 1 + conf/type/__autofs_master/singleton | 0 10 files changed, 214 insertions(+) create mode 100644 conf/type/__autofs_map/man.text create mode 100755 conf/type/__autofs_map/manifest create mode 100644 conf/type/__autofs_map/parameter/optional create mode 100644 conf/type/__autofs_map/parameter/required create mode 100644 conf/type/__autofs_master/files/auto.master.header create mode 100755 conf/type/__autofs_master/gencode-local create mode 100644 conf/type/__autofs_master/man.text create mode 100755 conf/type/__autofs_master/manifest create mode 100644 conf/type/__autofs_master/parameter/optional create mode 100644 conf/type/__autofs_master/singleton diff --git a/conf/type/__autofs_map/man.text b/conf/type/__autofs_map/man.text new file mode 100644 index 00000000..fbbd15d6 --- /dev/null +++ b/conf/type/__autofs_map/man.text @@ -0,0 +1,60 @@ +cdist-type__autofs_map(7) +======================== +Steven Armstrong + + +NAME +---- +cdist-type__autofs_map - Manage autofs maps + + +DESCRIPTION +----------- +This cdist type allows you to define maps for autofs. + + +OBJECT ID +--------- +The object_id Is used as the mount-point as described in auto.master(5). + + +REQUIRED PARAMETERS +------------------- +map:: + Name of the map to use. See auto.master(5). + + +OPTIONAL PARAMETERS +------------------- +type:: + Type of map used for this mount point. Defaults to 'file'. + See map-type in auto.master(5) for possible values. +options:: + See auto.master(5). +comment:: + A comment describing this map. Is added to the generated entry in + auto.master. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# Add auto mounter at /net +__autofs_map /net --map /etc/auto.net --type program + +# Add auto mounter at /pub +__autofs_map /pub --map /etc/auto.pub \ + --type file --options nosuid,rw,bg,hard,intr --ghost +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__autofs_map/manifest b/conf/type/__autofs_map/manifest new file mode 100755 index 00000000..74672e46 --- /dev/null +++ b/conf/type/__autofs_map/manifest @@ -0,0 +1,42 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + +name="/$__object_id" +map="$(cat "$__object/parameter/map")" + +if [ -f "$__object/parameter/type" ]; then + type="$(cat "$__object/parameter/type")" +else + type="file" + echo "$type" > "$__object/parameter/type" +fi + +# Generate entry for use in auto.master +entry="${name} ${type}:${map}" +if [ -f "$__object/parameter/options" ]; then + entry="$entry $(cat "$__object/parameter/options")" +fi +if [ -f "$__object/parameter/comment" ]; then + echo "# $(cat "$__object/parameter/comment")" > "$__object/parameter/entry" +fi +echo "$entry" >> "$__object/parameter/entry" + +require="$__self" __autofs_master + diff --git a/conf/type/__autofs_map/parameter/optional b/conf/type/__autofs_map/parameter/optional new file mode 100644 index 00000000..b1aa3a7e --- /dev/null +++ b/conf/type/__autofs_map/parameter/optional @@ -0,0 +1,3 @@ +type +options +comment diff --git a/conf/type/__autofs_map/parameter/required b/conf/type/__autofs_map/parameter/required new file mode 100644 index 00000000..b4a284c5 --- /dev/null +++ b/conf/type/__autofs_map/parameter/required @@ -0,0 +1 @@ +map diff --git a/conf/type/__autofs_master/files/auto.master.header b/conf/type/__autofs_master/files/auto.master.header new file mode 100644 index 00000000..53590257 --- /dev/null +++ b/conf/type/__autofs_master/files/auto.master.header @@ -0,0 +1,3 @@ +# Generated from cdist __autofs_master +# Do not change this file. Changes will be overwritten. + diff --git a/conf/type/__autofs_master/gencode-local b/conf/type/__autofs_master/gencode-local new file mode 100755 index 00000000..701f97a8 --- /dev/null +++ b/conf/type/__autofs_master/gencode-local @@ -0,0 +1,26 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# +# +# Generate auto.master config based on all defined __autofs_map ojbects. +# + +auto_master="$__object/files/auto.master" +cat "$(cat "$__object/parameter/header")" > "$auto_master" +find "$__global/object/__autofs_map" -path "*.cdist/parameter/entry" | xargs cat >> "$auto_master" diff --git a/conf/type/__autofs_master/man.text b/conf/type/__autofs_master/man.text new file mode 100644 index 00000000..d889b1f6 --- /dev/null +++ b/conf/type/__autofs_master/man.text @@ -0,0 +1,47 @@ +cdist-type__autofs_master(7) +======================== +Steven Armstrong + + +NAME +---- +cdist-type__autofs_master - Generate the auto.master file + + +DESCRIPTION +----------- +This cdist type generates a auto.master configuration from given __autofs_map +definitions. See cdist-type__auto_map(7). + + +REQUIRED PARAMETERS +------------------- +None + +OPTIONAL PARAMETERS +------------------- +header:: + Absolute path to a file used as the header for the generated auto.master + file. + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +# auto.master with default header +__autofs_master + +# auto.master with custom header +__autofs_master --header /path/to/header +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2011 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__autofs_master/manifest b/conf/type/__autofs_master/manifest new file mode 100755 index 00000000..e37a5d34 --- /dev/null +++ b/conf/type/__autofs_master/manifest @@ -0,0 +1,31 @@ +#!/bin/sh +# +# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + + +if [ ! -f "$__object/parameter/header" ]; then + echo "$__type/files/auto.master.header" > "$__object/parameter/header" +fi + +[ -d "$__object/files" ] || mkdir "$__object/files" +require="$__self" __file /etc/auto.master --source "$__object/files/auto.master" \ + --mode 644 \ + --owner root \ + --group root + diff --git a/conf/type/__autofs_master/parameter/optional b/conf/type/__autofs_master/parameter/optional new file mode 100644 index 00000000..8e83f898 --- /dev/null +++ b/conf/type/__autofs_master/parameter/optional @@ -0,0 +1 @@ +header diff --git a/conf/type/__autofs_master/singleton b/conf/type/__autofs_master/singleton new file mode 100644 index 00000000..e69de29b From 6784d4ca167902c978346f3f999058a88ef56990 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 6 Apr 2011 23:29:52 +0200 Subject: [PATCH 0624/5465] docfix: add missing = Signed-off-by: Steven Armstrong --- conf/type/__autofs_map/man.text | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/type/__autofs_map/man.text b/conf/type/__autofs_map/man.text index fbbd15d6..1584c16b 100644 --- a/conf/type/__autofs_map/man.text +++ b/conf/type/__autofs_map/man.text @@ -1,5 +1,5 @@ cdist-type__autofs_map(7) -======================== +========================= Steven Armstrong @@ -15,7 +15,7 @@ This cdist type allows you to define maps for autofs. OBJECT ID --------- -The object_id Is used as the mount-point as described in auto.master(5). +The object_id is used as the mount-point as described in auto.master(5). REQUIRED PARAMETERS From df6c2909cb1932364f3b19a2811576d7ba5fac9e Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 6 Apr 2011 23:31:38 +0200 Subject: [PATCH 0625/5465] bow infront of the whitespace nazi Signed-off-by: Steven Armstrong --- conf/type/__autofs_map/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__autofs_map/man.text b/conf/type/__autofs_map/man.text index 1584c16b..941e22da 100644 --- a/conf/type/__autofs_map/man.text +++ b/conf/type/__autofs_map/man.text @@ -41,7 +41,7 @@ EXAMPLES -------------------------------------------------------------------------------- # Add auto mounter at /net -__autofs_map /net --map /etc/auto.net --type program +__autofs_map /net --map /etc/auto.net --type program # Add auto mounter at /pub __autofs_map /pub --map /etc/auto.pub \ From 88a667b17fcddaaaba00d232636e51e340f4ef6a Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 6 Apr 2011 23:42:22 +0200 Subject: [PATCH 0626/5465] docfix: add missing = Signed-off-by: Steven Armstrong --- conf/type/__autofs_master/man.text | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/type/__autofs_master/man.text b/conf/type/__autofs_master/man.text index d889b1f6..641c8393 100644 --- a/conf/type/__autofs_master/man.text +++ b/conf/type/__autofs_master/man.text @@ -1,5 +1,5 @@ cdist-type__autofs_master(7) -======================== +============================ Steven Armstrong From 9c5e7f516164ef9b9caa4030a1ca598911ac872a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 23:43:22 +0200 Subject: [PATCH 0627/5465] much more fun with 1.6.1 Signed-off-by: Nico Schottelius --- doc/changelog | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/changelog b/doc/changelog index 1a38a2bd..b88705f8 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,10 +1,13 @@ 1.6.1: * Improved logging: Show code responsible for abort - * New Type __package_pkg_openbsd + * Improved logging: Consistently prefix with current object or core * Bugfix: Type __debconf_set_selections used wrong contens for selection * Bugfix: Don't fail, if cache directory is not existing * Bugfix: __user and __group exited non-zero if no change was necessary - * New explorer: hardware_type + * New Explorer: hardware_type + * New Type __package_pkg_openbsd (Andi Brönnimann) + * New Type: __autofs_map (Steven Armstrong) + * New Type: __autofs_master (Steven Armstrong) 1.6.0: 2011-04-06 * New Type __package_yum From ff184006cb540b49feb12400a784dd828b280c96 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 6 Apr 2011 23:46:15 +0200 Subject: [PATCH 0628/5465] colon gangster attack Signed-off-by: Nico Schottelius --- doc/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog b/doc/changelog index b88705f8..0560dee0 100644 --- a/doc/changelog +++ b/doc/changelog @@ -5,7 +5,7 @@ * Bugfix: Don't fail, if cache directory is not existing * Bugfix: __user and __group exited non-zero if no change was necessary * New Explorer: hardware_type - * New Type __package_pkg_openbsd (Andi Brönnimann) + * New Type: __package_pkg_openbsd (Andi Brönnimann) * New Type: __autofs_map (Steven Armstrong) * New Type: __autofs_master (Steven Armstrong) From c3341df08d5406bcbd1f49870765d3bb23d49577 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 7 Apr 2011 09:56:59 +0200 Subject: [PATCH 0629/5465] Upgrade to 1.6.1 Signed-off-by: Nico Schottelius --- bin/cdist-config | 2 +- doc/changelog | 82 ++++++++++++++++++++++++------------------------ 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 4346c0cb..5d19f854 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.6.0" +__cdist_version="1.6.1" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index 0560dee0..2fef50ca 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,30 +1,30 @@ -1.6.1: +1.6.1: 2011-04-07 * Improved logging: Show code responsible for abort * Improved logging: Consistently prefix with current object or core * Bugfix: Type __debconf_set_selections used wrong contens for selection * Bugfix: Don't fail, if cache directory is not existing * Bugfix: __user and __group exited non-zero if no change was necessary - * New Explorer: hardware_type - * New Type: __package_pkg_openbsd (Andi Brönnimann) - * New Type: __autofs_map (Steven Armstrong) - * New Type: __autofs_master (Steven Armstrong) + * New Explorer hardware_type + * New Type __package_pkg_openbsd (Andi Brönnimann) + * New Type __autofs_map (Steven Armstrong) + * New Type __autofs_master (Steven Armstrong) 1.6.0: 2011-04-06 - * New Type __package_yum - * New type __debconf_set_selections - * New explorer os_version - * Fix Type __group in case of __group NAME syntax - * Fix __package* types: consistently name --state removed instead of + * New Type: __package_yum + * New type: __debconf_set_selections + * New explorer: os_version + * Bugfix: Type __group failed in case of __group NAME syntax + * Bugfix: __package* types: consistently name --state removed instead of uninstalled or deinstalled - * Type __package gained Fedora support - * Removed --preseed support from __package_apt - * explorer/os: gained Fedora support + * Type __package: Added Fedora support + * Type __package_apt: Removed --preseed support + * Explorer os gained Fedora support * Simplified types __user and __group * New helper binary: cdist-mass-deploy 1.5.0: 2011-04-01 * Add basic cache functionality - * New type __process + * New type: __process * Restructured execution: (Steven Armstrong) Orientate processing on objects, resolve dependencies and ensure correct execution order. @@ -32,8 +32,8 @@ * Documentation: Remove legacy man pages (Steven Armstrong) 1.4.1: 2011-03-25 - * New type __key_value (Steven Armstrong) - * New type __apt_ppa (Steven Armstrong) + * New type: __key_value (Steven Armstrong) + * New type: __apt_ppa (Steven Armstrong) * Documentation: Manpage generation cleanup * Documentation: Manpage fix for __apt_ppa @@ -48,9 +48,9 @@ * Include HTML documentation of manpages and publish them 1.3.1: 2011-03-21 - * Document cdist-type-build-emulation - * Document cdist-type-emulator - * Document cdist-remote-explorer-run + * Document: cdist-type-build-emulation + * Document: cdist-type-emulator + * Document: cdist-remote-explorer-run * Fix dependencies in cdist-code-run * Fix dependencies in cdist-manifest-run-all * Add --source to __issue and fix os check @@ -62,33 +62,33 @@ 1.2.0: 2011-03-19 * Added dependencies (see cdist-type(7)) - * New type __removeline (Daniel Roth) - * New type __group (Steven Armstrong) - * New type __user (Steven Armstrong) - * Document cdist-run-remote - * Document cdist-code-run-all - * Document cdist-object-gencode - * Document cdist-explorer-run-global - * Document cdist-manifest-run-init - * Document cdist-manifest-run-all - * Document cdist-object-gencode-all - * Document cdist-manifest-run + * New type: __removeline (Daniel Roth) + * New type: __group (Steven Armstrong) + * New type: __user (Steven Armstrong) + * Documentation: cdist-run-remote + * Documentation: cdist-code-run-all + * Documentation: cdist-object-gencode + * Documentation: cdist-explorer-run-global + * Documentation: cdist-manifest-run-init + * Documentation: cdist-manifest-run-all + * Documentation: cdist-object-gencode-all + * Documentation: cdist-manifest-run 1.1.0: 2011-03-16 * Replace type __file with __file, __directory, __link - * Document cdist-env - * Document cdist-config - * Document cdist-dir - * Document cdist-quickstart + * Documentation: cdist-env + * Documentation: cdist-config + * Documentation: cdist-dir + * Documentation: cdist-quickstart 1.0.4: 2011-03-15 - * New type __motd - * New type __addifnosuchline (Daniel Roth) - * Document type __issue - * New type __user - * Document type __package - * Document type __package_pacman - * Document type __package_apt + * New type: __motd + * New type: __addifnosuchline (Daniel Roth) + * New type: __user + * Document type: __issue + * Document type: __package + * Document type: __package_pacman + * Document type: __package_apt * New parameter for __file: --owner and --group 1.0.3: 2011-03-11 From 965e80b0ef28d8dbb9ad6e5f0d464c167db7b2fe Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 7 Apr 2011 10:28:08 +0200 Subject: [PATCH 0630/5465] more stuff running in the systems group Signed-off-by: Nico Schottelius --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index 54f792a7..75b36581 100644 --- a/README +++ b/README @@ -211,13 +211,14 @@ Yes, I'm actually eating my own dogfood and currently managing * [moinmoin](http://moinmo.in/) (wiki) * [apache](http://httpd.apache.org/) (webserver) * [kerberos (mit)](http://web.mit.edu/kerberos/) (authentication) + * [nss-pam-ldapd](http://arthurdejong.org/nss-pam-ldapd/) * [ircd-hybrid](http://www.ircd-hybrid.org/) (chat) * [stunnel](http://stunnel.mirt.net/) (SSL tunnel) * [mercurial-server](http://www.lshift.net/mercurial-server.html) (version control) * [xfce](http://www.xfce.org/) (lightweight desktop environment) * [slim](http://slim.berlios.de/) (graphical login manager for X11) -with cdist on a total of **20** production machines of the +with cdist on a total of **50** production machines of the [Systems Group](http://www.systems.ethz.ch) at the [ETH Zurich](http://www.ethz.ch) as well at home. From bc77a637a986f41653e72224580b1920bf8a4f02 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 7 Apr 2011 11:57:50 +0200 Subject: [PATCH 0631/5465] more cdist on more nodes = more fun Signed-off-by: Nico Schottelius --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index 75b36581..350cd3e1 100644 --- a/README +++ b/README @@ -211,14 +211,14 @@ Yes, I'm actually eating my own dogfood and currently managing * [moinmoin](http://moinmo.in/) (wiki) * [apache](http://httpd.apache.org/) (webserver) * [kerberos (mit)](http://web.mit.edu/kerberos/) (authentication) - * [nss-pam-ldapd](http://arthurdejong.org/nss-pam-ldapd/) + * [nss-pam-ldapd](http://arthurdejong.org/nss-pam-ldapd/) (authentication) * [ircd-hybrid](http://www.ircd-hybrid.org/) (chat) * [stunnel](http://stunnel.mirt.net/) (SSL tunnel) * [mercurial-server](http://www.lshift.net/mercurial-server.html) (version control) * [xfce](http://www.xfce.org/) (lightweight desktop environment) * [slim](http://slim.berlios.de/) (graphical login manager for X11) -with cdist on a total of **50** production machines of the +with cdist on more than **60** production machines of the [Systems Group](http://www.systems.ethz.ch) at the [ETH Zurich](http://www.ethz.ch) as well at home. From 4895a92d95c4d2d842100dadace9956634f81fc7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 7 Apr 2011 12:01:55 +0200 Subject: [PATCH 0632/5465] ++doc todo (funny item) Signed-off-by: Nico Schottelius --- doc/dev/todo/TAKEME | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/dev/todo/TAKEME b/doc/dev/todo/TAKEME index d456ae35..871045f2 100644 --- a/doc/dev/todo/TAKEME +++ b/doc/dev/todo/TAKEME @@ -53,4 +53,5 @@ DOCUMENTATION - asciidoc interprets __, which we use for variables names -> seek through docs and replace with \_\_! - reference explorers in cdist-reference! - +- compare running times: + one, 5, 10, 50, 100, 1000 hosts => how does cdist scale? From 59ec60ba0bbe6134609c9bf5571ba7be022475af Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 7 Apr 2011 12:07:06 +0200 Subject: [PATCH 0633/5465] ++todo Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index db1ba10a..a02d7013 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -3,3 +3,6 @@ Fix bin/cdist-type-template Cleanup documentation: type reference -> add types + manpages add explorer reference + +Catch broken instances in cdist-mass-deploy -p and report +broken deployements at the end! From 4873b046ba45527b2fe6685ff6fbfec5cee6b3fd Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 8 Apr 2011 10:51:27 +0200 Subject: [PATCH 0634/5465] allow user to change __cdist_tmp_base_dir to avoid using /tmp Signed-off-by: Nico Schottelius --- bin/cdist-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/cdist-config b/bin/cdist-config index 5d19f854..44a95f01 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -98,7 +98,8 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname" ################################################################################ # Tempfiles # -__cdist_tmp_dir=$(mktemp -d "/tmp/cdist.XXXXXXXXXXXX") +: ${__cdist_tmp_base_dir=/tmp} +__cdist_tmp_dir=$(mktemp -d "$__cdist_tmp_base_dir/cdist.XXXXXXXXXXXX") __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX") ################################################################################ From a4c0b3df1fb23d02b7eaaf1c32be93cbdf764ec1 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 8 Apr 2011 10:56:53 +0200 Subject: [PATCH 0635/5465] [DOC] explain and document __cdist_tmp_base_dir Signed-off-by: Nico Schottelius --- doc/man/man1/cdist-config.text | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/doc/man/man1/cdist-config.text b/doc/man/man1/cdist-config.text index 9d147988..0c8b0735 100644 --- a/doc/man/man1/cdist-config.text +++ b/doc/man/man1/cdist-config.text @@ -15,6 +15,28 @@ types, manifests, etc. Generally speaking, it's just usable from within the core and is only of interest for cdist-developers. +ENVIRONMENT VARIABLES +--------------------- +The following list contains environment variables that are known +to be changed by users in various situations. To change the variable, +use your current shell and export it, so all cdist-binaries know about it. + +__cdist_tmp_base_dir:: + Normally this points to /tmp. In case /tmp is not suitable for + cdist (i.e. has noexec flag setup) you can change this variable + to point to a better location. + + +EXAMPLES +-------- + +If /tmp has the noexec flag, you can use $HOME/.tmp for instance: + +-------------------------------------------------------------------------------- +export __cdist_tmp_base_dir=$HOME/.tmp +-------------------------------------------------------------------------------- + + SEE ALSO -------- cdist(7) From 10cc25330c7e397bf3788d5c49aaafafc4cbbbfb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 8 Apr 2011 10:57:18 +0200 Subject: [PATCH 0636/5465] remove space at the end of the line Signed-off-by: Nico Schottelius --- bin/cdist-object-explorer-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run index 79cd2865..b65c5cc1 100755 --- a/bin/cdist-object-explorer-run +++ b/bin/cdist-object-explorer-run @@ -44,7 +44,7 @@ if [ "$__cdist_has_explorer" ]; then __cdist_type_explorer_pushed_add "$__cdist_type" fi - __cdist_echo info "Running explorers " + __cdist_echo info "Running explorers" # Copy object parameters cdist-dir push "$__cdist_target_host" \ "$(__cdist_object_parameter_dir "$__cdist_object_self")" \ From bdb1c6e7a65e856bf6df121b26bd34d2dc6d065a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 8 Apr 2011 11:01:57 +0200 Subject: [PATCH 0637/5465] stuff for 1.6.2 Signed-off-by: Nico Schottelius --- doc/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/changelog b/doc/changelog index 2fef50ca..83b2b6e3 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.6.2: + * Core: Introduce __cdist_tmp_base_dir + 1.6.1: 2011-04-07 * Improved logging: Show code responsible for abort * Improved logging: Consistently prefix with current object or core From 08f37578fc1a685f60dfb69f14ec96f03b8dfe0d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 11 Apr 2011 11:13:06 +0200 Subject: [PATCH 0638/5465] +linklist Signed-off-by: Nico Schottelius --- doc/dev/logs/linklist | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/dev/logs/linklist diff --git a/doc/dev/logs/linklist b/doc/dev/logs/linklist new file mode 100644 index 00000000..4ec144cb --- /dev/null +++ b/doc/dev/logs/linklist @@ -0,0 +1,2 @@ +http://groups.google.com/group/puppet-users/browse_thread/thread/83801a03c0fea665 +http://lists.debian.org/debian-user/2011/04/msg00818.html From 64826ca5ce29e913ce04ba3628a69bfbbc9a2429 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 12 Apr 2011 12:18:46 +0200 Subject: [PATCH 0639/5465] +links Signed-off-by: Nico Schottelius --- doc/dev/logs/linklist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/dev/logs/linklist b/doc/dev/logs/linklist index 4ec144cb..29d5ab96 100644 --- a/doc/dev/logs/linklist +++ b/doc/dev/logs/linklist @@ -1,2 +1,4 @@ http://groups.google.com/group/puppet-users/browse_thread/thread/83801a03c0fea665 http://lists.debian.org/debian-user/2011/04/msg00818.html +http://sans.ethz.ch/projects/puppet/ +http://www.nico.schottelius.org/eth/puppet/ From 0e42e98bb93ad5361cfd0b56142bb708b804c5c6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:27:01 +0200 Subject: [PATCH 0640/5465] begin to cleanup bin/cdist-type-template Signed-off-by: Nico Schottelius --- bin/cdist-type-template | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/cdist-type-template b/bin/cdist-type-template index dc853614..335a0ed9 100755 --- a/bin/cdist-type-template +++ b/bin/cdist-type-template @@ -26,9 +26,11 @@ set -eu __cdist_type="$1"; shift +__cdist_type_dir="$(__cdist_type_dir "$__cdist_type")" +echo "Creating type $__cdist_type in $__cdist_type_dir ..." # Base -mkdir -p "$(__cdist_type_dir "$__cdist_type")" +mkdir -p "$__cdist_type_dir" # Parameter mkdir -p "$(__cdist_type_parameter_dir "$__cdist_type")" From 10ebdd87d4e21c599dc29db6b604ed6e8d0fff0b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:31:15 +0200 Subject: [PATCH 0641/5465] fixes + local and remote gencode Signed-off-by: Nico Schottelius --- bin/cdist-type-template | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/bin/cdist-type-template b/bin/cdist-type-template index 335a0ed9..772b7486 100755 --- a/bin/cdist-type-template +++ b/bin/cdist-type-template @@ -26,11 +26,11 @@ set -eu __cdist_type="$1"; shift -__cdist_type_dir="$(__cdist_type_dir "$__cdist_type")" +__cdist_my_type_dir="$(__cdist_type_dir "$__cdist_type")" -echo "Creating type $__cdist_type in $__cdist_type_dir ..." +echo "Creating type $__cdist_type in $__cdist_my_type_dir ..." # Base -mkdir -p "$__cdist_type_dir" +mkdir -p "$__cdist_my_type_dir" # Parameter mkdir -p "$(__cdist_type_parameter_dir "$__cdist_type")" @@ -38,11 +38,11 @@ touch "$(__cdist_type_parameter_dir "$__cdist_type")/${__cdist_name_parameter_re touch "$(__cdist_type_parameter_dir "$__cdist_type")/${__cdist_name_parameter_optional}" # Manifest -cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_manifest}" +cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$__cdist_my_type_dir/${__cdist_name_manifest}" # # This is the manifest, which can be used to create other objects like this: -# __file /path/to/destination --source /from/where/ --type file +# __file /path/to/destination --source /from/where/ # # To tell cdist to make use of it, you need to make it executable (chmod +x) # @@ -50,8 +50,8 @@ cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cd eof -# Gencode -cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_gencode}" +# Gencode remote +cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_gencode}-${__cdist_name_gencode_remote}" # # This file should generate code on stdout, which will be collected by cdist @@ -63,5 +63,17 @@ cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cd eof +cat "$__cdist_abs_mydir/../doc/dev/header" - << eof > "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_gencode}-${__cdist_name_gencode_local}" + +# +# This file should generate code on stdout, which will be collected by cdist +# and run on the same machine cdist-deploy-to is executed. +# +# To tell cdist to make use of it, you need to make it executable (chmod +x) +# +# + +eof + # Explorer -mkdir -p "$(__cdist_type_dir "$__cdist_type")/${__cdist_name_explorer}" +mkdir -p "$__cdist_my_type_dir/${__cdist_name_explorer}" From 231eb1214c4de9b284edc84124ba8480901f5aa3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:33:48 +0200 Subject: [PATCH 0642/5465] refuse to try to recreate a type Signed-off-by: Nico Schottelius --- bin/cdist-type-template | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/cdist-type-template b/bin/cdist-type-template index 772b7486..6d8a3f15 100755 --- a/bin/cdist-type-template +++ b/bin/cdist-type-template @@ -28,6 +28,10 @@ set -eu __cdist_type="$1"; shift __cdist_my_type_dir="$(__cdist_type_dir "$__cdist_type")" +if [ -d "$__cdist_my_type_dir" ]; then + __cdist_usage "Type $__cdist_type already exists" +fi + echo "Creating type $__cdist_type in $__cdist_my_type_dir ..." # Base mkdir -p "$__cdist_my_type_dir" From 24428b2070c22e96a8a19c878638610b4f3856bc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:35:07 +0200 Subject: [PATCH 0643/5465] more stuff for 1.6.2 Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 83b2b6e3..2da35ad8 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,5 +1,6 @@ 1.6.2: * Core: Introduce __cdist_tmp_base_dir + * Core: Cleanup and enhance cdist-type-template 1.6.1: 2011-04-07 * Improved logging: Show code responsible for abort From da1d3fbc0469c56b393ee0df1d33096f2cfdb1e4 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:51:24 +0200 Subject: [PATCH 0644/5465] begin new error catching code and make filter a function Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 8a555411..294e1ca1 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -25,23 +25,38 @@ [ $# -ge 1 ] || __cdist_usage "[-p] [target host ]" set -eu +filter() +{ + awk -v host=$1 '{ print "[" host "] " $0 }' +} + parallel="" if [ "$1" = "-p" ]; then parallel=yes shift fi +i=0 while [ $# -ge 1 ]; do - # always assume we run parallel - cdist-deploy-to "$1" | awk -v host=$1 '{ print "[" host "] " $0 }' & - shift + if [ "$parallel" ]; then + cdist-deploy-to "$1" | filter + # Record pid and host for use later + eval pid_$i=$! + eval host_$i=\$1 + i=$((i+1)) + else + cdist-deploy-to "$1" | filter + fi - # if not, wait for it _now_ - [ "$parallel" ] || wait + shift done # else wait after all are started if [ "$parallel" ]; then __cdist_echo info "Waiting for cdist-deploy-to jobs to finish" + while [ $i -gt 0 ]; do + + done + wait fi From 0122ccc3eedabb8fcd07a9eacfe40dff5a7ec001 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:56:10 +0200 Subject: [PATCH 0645/5465] in theory finish new error catching + displaying code Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 294e1ca1..b78c032b 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -39,7 +39,7 @@ fi i=0 while [ $# -ge 1 ]; do if [ "$parallel" ]; then - cdist-deploy-to "$1" | filter + cdist-deploy-to "$1" | filter & # Record pid and host for use later eval pid_$i=$! eval host_$i=\$1 @@ -47,16 +47,20 @@ while [ $# -ge 1 ]; do else cdist-deploy-to "$1" | filter fi - shift done # else wait after all are started if [ "$parallel" ]; then __cdist_echo info "Waiting for cdist-deploy-to jobs to finish" - while [ $i -gt 0 ]; do - + while [ "$i" -gt 0 ]; do + eval pid=\$pid_$i + eval host=\$host_$i + wait "$pid" + if [ $? -ne 0 ]; then + __cdist_echo error "Configuration of host $host failed." + fi + i=$((i-1)) + shift done - - wait fi From 9c60a81d8a9ced7f9266602bc8a53b5ff226f661 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:57:20 +0200 Subject: [PATCH 0646/5465] decrease first, last number is unused Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index b78c032b..3d497436 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -53,14 +53,14 @@ done # else wait after all are started if [ "$parallel" ]; then __cdist_echo info "Waiting for cdist-deploy-to jobs to finish" - while [ "$i" -gt 0 ]; do + while [ "$i" -ge 0 ]; do + i=$((i-1)) eval pid=\$pid_$i eval host=\$host_$i wait "$pid" if [ $? -ne 0 ]; then __cdist_echo error "Configuration of host $host failed." fi - i=$((i-1)) shift done fi From 471b8a73088d0141cba6d59cd5cf04232b1e691b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 16 Apr 2011 23:57:46 +0200 Subject: [PATCH 0647/5465] pass hostname to filter Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 3d497436..b4ccc8ff 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -39,13 +39,13 @@ fi i=0 while [ $# -ge 1 ]; do if [ "$parallel" ]; then - cdist-deploy-to "$1" | filter & + cdist-deploy-to "$1" | filter "$1" & # Record pid and host for use later eval pid_$i=$! eval host_$i=\$1 i=$((i+1)) else - cdist-deploy-to "$1" | filter + cdist-deploy-to "$1" | filter "$1" fi shift done From a51267356297bacf3e90354bf672c246234a0610 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 17 Apr 2011 00:00:55 +0200 Subject: [PATCH 0648/5465] more small things for 1.6.2 Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 2da35ad8..1d2c3565 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,6 +1,7 @@ 1.6.2: * Core: Introduce __cdist_tmp_base_dir * Core: Cleanup and enhance cdist-type-template + * Core: cdist-mass-deploy: Report failed cdist-deploy-to instances 1.6.1: 2011-04-07 * Improved logging: Show code responsible for abort From 01a541d0176ff3d584d4ddc16b1ff85b2fc0366a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 17 Apr 2011 00:10:07 +0200 Subject: [PATCH 0649/5465] use different count to ignore case of 0 hosts Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index b4ccc8ff..bd6bd406 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -41,26 +41,33 @@ while [ $# -ge 1 ]; do if [ "$parallel" ]; then cdist-deploy-to "$1" | filter "$1" & # Record pid and host for use later + i=$((i+1)) eval pid_$i=$! eval host_$i=\$1 - i=$((i+1)) else cdist-deploy-to "$1" | filter "$1" fi shift done -# else wait after all are started +e=0 if [ "$parallel" ]; then __cdist_echo info "Waiting for cdist-deploy-to jobs to finish" - while [ "$i" -ge 0 ]; do - i=$((i-1)) + while [ "$i" -gt 0 ]; do eval pid=\$pid_$i - eval host=\$host_$i wait "$pid" if [ $? -ne 0 ]; then - __cdist_echo error "Configuration of host $host failed." + e=$((e+1)) + eval e_host_$e=\$host_$i fi + i=$((i-1)) shift done fi + +# Display all failed hosts after all runs are done +while [ "$e" -gt 0 ]; do + eval host=\$host_$e + __cdist_echo error "Configuration of host $host failed." + e=$((e-1)) +done From 91106ba0af4f7be86cfe25f3be62d6892eee8bd3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 17 Apr 2011 00:11:23 +0200 Subject: [PATCH 0650/5465] comment for sysadmins Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index bd6bd406..1c6baa69 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -65,7 +65,7 @@ if [ "$parallel" ]; then done fi -# Display all failed hosts after all runs are done +# Display all failed hosts after all runs are done, so the sysadmin gets them while [ "$e" -gt 0 ]; do eval host=\$host_$e __cdist_echo error "Configuration of host $host failed." From 20f0a788b143c45b19c09ae73293e76df3cffaa9 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 17 Apr 2011 11:32:11 +0200 Subject: [PATCH 0651/5465] use -gt consistently Signed-off-by: Nico Schottelius --- bin/cdist-mass-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 1c6baa69..e8e2594f 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -37,7 +37,7 @@ if [ "$1" = "-p" ]; then fi i=0 -while [ $# -ge 1 ]; do +while [ $# -gt 0 ]; do if [ "$parallel" ]; then cdist-deploy-to "$1" | filter "$1" & # Record pid and host for use later From 14cb98b4f980832d19ff193b777aa018e815de48 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 18 Apr 2011 08:35:52 +0200 Subject: [PATCH 0652/5465] seperate branches for more than one feature, please Signed-off-by: Nico Schottelius --- doc/man/man7/cdist-hacker.text | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/man/man7/cdist-hacker.text b/doc/man/man7/cdist-hacker.text index f9f08e31..027f28aa 100644 --- a/doc/man/man7/cdist-hacker.text +++ b/doc/man/man7/cdist-hacker.text @@ -55,12 +55,16 @@ There are though some requirements to ensure your changes don't break others work nor kill the authors brain: - Code submission must be done via git -- Code to be included should be branched of the upstream "master" branch - - Exception: Bugfixes to a version branch -- Code submissions must be in your master branch - - Exception: If you only want a comment on your code, but not an inclusion. - Do not add conf/manifest/init - This file should only be touched in your private branch! +- Code to be included should be branched of the upstream "master" branch + - Exception: Bugfixes to a version branch +- Code submissions should be in your master branch + - Other branches are fine as well, but you need to tell me which branch + your work is in! +- If you developed more than **one** feature, consider submitting them in + seperate branches. This way one feature can already be included, even if + the other needs to be improved. As soon as your work meets these requirements, you can contact me (IRC, Mailinglist, Phone, RFC 1149) and I'll check your code before From c929ce09776e0b335ef1de3bb24ca74e8ac3199e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 13:42:14 +0200 Subject: [PATCH 0653/5465] begin logfile for today Signed-off-by: Nico Schottelius --- doc/dev/logs/2011-04-19 | 67 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 doc/dev/logs/2011-04-19 diff --git a/doc/dev/logs/2011-04-19 b/doc/dev/logs/2011-04-19 new file mode 100644 index 00000000..65b9550b --- /dev/null +++ b/doc/dev/logs/2011-04-19 @@ -0,0 +1,67 @@ +Meeting with: Steven, Thorsten, Nico + +Problem: execute my code only if somebody else's changed something. + +Proposals: + +1) Introduce new binary (Steven) + +gencode: + +if has_changed __file/etc/nginx.conf; then + echo mycode +fi + +2) Use -f plus new variable to cover .cdist/has_code: + +if [ -f $global/objects/__file/etc/nginx.conf/$has_code ]; then + echo mycode +fi + +And $has_code resolves to .cdist/has_code to cover the .cdist +directory. + +3) Create a new tree that contains changed objects + +if [ -e $global/changed/__file/etc/nginx.conf ]; then + echo mycode +fi + +4) Use a \n seperated list + +if grep -q __file/etc/nginx.conf $global/changed; then + echo mycode +fi + +X) General problem (add to FAQ): + + When having "do something only if somebody else did something" + it is possible that users get confused, because code will not + be executed. + + This may especially happen in code development: + + a) User creates __file/etc/nginx.conf + b) User creates a new type __nginx that restarts + nginx, only if __file/etc/nginx.conf changed. + But __file/etc/nginx.conf has already been deployed + and thus will never be restarted. +-------------------------------------------------------------------------------- + +Introduce exclude/conflicts attribute for types? + + Handling in cdist vs. handling in the types themselves? + + Examples: __file, __link, __directory + + Need to handle errors on low level for those anyway. + + Conclusion: Wait until we need exclude in a different type. + + Pro: + Throw error as soon as possible without touching the target. + + Contra: + No needod for most cases. + Very controversal for stuff like __package and __package_gem + for instance: rails; Should those two conflict or not? From 0e5cb9b11f1c2609214711b22691b47b92101545 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 13:43:03 +0200 Subject: [PATCH 0654/5465] cdist type template works Signed-off-by: Nico Schottelius --- doc/dev/todo/niconext | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index a02d7013..887856d5 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,5 +1,3 @@ -Fix bin/cdist-type-template - Cleanup documentation: type reference -> add types + manpages add explorer reference From 4d244e9ea2ff10521a9216166bacf53598f02d20 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:30:06 +0200 Subject: [PATCH 0655/5465] =?UTF-8?q?import=20=5F=5Fssh=5Fauthorized=5Fkey?= =?UTF-8?q?=20from=20Aur=C3=A9lien's=20tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nico Schottelius --- conf/type/__ssh_authorized_key/man.text | 46 ++++++++++++++++ conf/type/__ssh_authorized_key/manifest | 55 +++++++++++++++++++ .../__ssh_authorized_key/parameter/optional | 2 + 3 files changed, 103 insertions(+) create mode 100644 conf/type/__ssh_authorized_key/man.text create mode 100755 conf/type/__ssh_authorized_key/manifest create mode 100644 conf/type/__ssh_authorized_key/parameter/optional diff --git a/conf/type/__ssh_authorized_key/man.text b/conf/type/__ssh_authorized_key/man.text new file mode 100644 index 00000000..af0c2017 --- /dev/null +++ b/conf/type/__ssh_authorized_key/man.text @@ -0,0 +1,46 @@ +cdist-type__ssh_authorized_key(7) +================================= +Aurélien Bondis - aurelien.bondis AT gmail DOT com + + +NAME +---- +cdist-type__ssh_authorized_key - Sends a user's public key to another user's authorized_keys + + +DESCRIPTION +----------- +This type sends a rsa key. By default uses root's key and sends it to root's authorized_keys + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +srcuser:: the user to take the rsa public key from +dstuser:: the user to give the rsa public key to + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +#deploy root's public key +__ssh_authorized_key admin +#deploy bob's public key to alice's authorized_keys +__ssh_authorized_key --srcuser bob --dstuser alice +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/conf/type/__ssh_authorized_key/manifest b/conf/type/__ssh_authorized_key/manifest new file mode 100755 index 00000000..efadc3f6 --- /dev/null +++ b/conf/type/__ssh_authorized_key/manifest @@ -0,0 +1,55 @@ +#!/bin/sh +# +# 2011 Aurélien Bondis aurelien.bondis AT gmail DOT 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 type allows to send a public ssh key from a user to the +# authorized_keys of another +# +#require="__package openssh-server --state installed" +# Get option srcuser if defined +if [ -f "$__object/parameter/srcuser" ]; then + srcuser=`cat "$__object/parameter/srcuser"` +fi +# Get option dstuser if defined +if [ -f "$__object/parameter/dstuser" ]; then + dstuser=`cat "$__object/parameter/dstuser"` +fi + +# if a source user is defined, use it's public key +if [ "$srcuser" ]; then + srcrsa="/home/${srcuser}/.ssh/id_rsa.pub" +# if no source user is defined we use root's public key +else + srcrsa="/root/.ssh/id_rsa.pub" +fi +# if a destination user is defined, insert in it's authorized_keys +if [ "$dstuser" ]; then + sshpath="/home/$dstuser/.ssh" +# if no destination user is defined we use root's home +else + sshpath="/root/.ssh" +fi +rsa=`cat $srcrsa` +__directory $sshpath +# the file authorized_keys depends on the .ssh folder +require="__directory${sshpath}" __file "$sshpath/authorized_keys" --mode 640 +# the line added depends on authorized_keys existence +require="__file${sshpath}/authorized_keys" __addifnosuchline sshkey --file \ + "$sshpath/authorized_keys" --line "$rsa" + diff --git a/conf/type/__ssh_authorized_key/parameter/optional b/conf/type/__ssh_authorized_key/parameter/optional new file mode 100644 index 00000000..4903f5be --- /dev/null +++ b/conf/type/__ssh_authorized_key/parameter/optional @@ -0,0 +1,2 @@ +srcuser +dstuser From c6d7ad31243fd65a0e5127b80a9e87acabfecb27 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:30:56 +0200 Subject: [PATCH 0656/5465] =?UTF-8?q?++changes=20for=201.6.2:=20Imported?= =?UTF-8?q?=20=5F=5Fssh=5Fauthorized=5Fkey=20from=20Aur=C3=A9lien?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nico Schottelius --- doc/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/changelog b/doc/changelog index 1d2c3565..be175ffd 100644 --- a/doc/changelog +++ b/doc/changelog @@ -2,6 +2,7 @@ * Core: Introduce __cdist_tmp_base_dir * Core: Cleanup and enhance cdist-type-template * Core: cdist-mass-deploy: Report failed cdist-deploy-to instances + * New Type __ssh_authorized_key (Aurélien Bondis) 1.6.1: 2011-04-07 * Improved logging: Show code responsible for abort From 08db913134d6c3274c76f9b59cafb7434a1ebd98 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:34:13 +0200 Subject: [PATCH 0657/5465] add releasechecklist Signed-off-by: Nico Schottelius --- doc/dev/releasechecklist | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/dev/releasechecklist diff --git a/doc/dev/releasechecklist b/doc/dev/releasechecklist new file mode 100644 index 00000000..aefbfe4d --- /dev/null +++ b/doc/dev/releasechecklist @@ -0,0 +1,16 @@ +# Stuff to take care of when doing a release + +# adjust version +vi bin/cdist-config + +# adjust release date +vi doc/changelog + +# Import into current version branch +git checkout 1.6 +git merge master + +# Ensure documentation builds cleanly +./build.sh clean && ./build.sh man + + From 458126e700c2211d3b43409bce46d5d28d522716 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:34:47 +0200 Subject: [PATCH 0658/5465] begin to make checklist a script Signed-off-by: Nico Schottelius --- doc/dev/releasechecklist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/dev/releasechecklist b/doc/dev/releasechecklist index aefbfe4d..cbb5bb72 100644 --- a/doc/dev/releasechecklist +++ b/doc/dev/releasechecklist @@ -1,4 +1,7 @@ +#!/bin/sh + # Stuff to take care of when doing a release +echo "Preparing next release" # adjust version vi bin/cdist-config From 7a8559fe52104feaa1a3453ac6ffa6214d28a4ad Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:40:51 +0200 Subject: [PATCH 0659/5465] in theory finish releasechecklistscript Signed-off-by: Nico Schottelius --- doc/dev/releasechecklist | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) mode change 100644 => 100755 doc/dev/releasechecklist diff --git a/doc/dev/releasechecklist b/doc/dev/releasechecklist old mode 100644 new mode 100755 index cbb5bb72..379954e7 --- a/doc/dev/releasechecklist +++ b/doc/dev/releasechecklist @@ -1,19 +1,31 @@ -#!/bin/sh +#!/bin/sh -e + +files="bin/cdist-config doc/changelog" # Stuff to take care of when doing a release echo "Preparing next release" -# adjust version -vi bin/cdist-config - -# adjust release date -vi doc/changelog - -# Import into current version branch -git checkout 1.6 -git merge master - # Ensure documentation builds cleanly ./build.sh clean && ./build.sh man +# get version +version=$(awk -F'=' '/^__cdist_version/ { print $2 }' bin/cdist-config | sed 's/"//g') +# get target branch +branch=${version%.?} + +# adjust version and release date +vi $files + +# Commit stuff +git commit $files + +# Import into current version branch +git checkout $branch +git merge master + +# Publish manpages and sourcecode +./build.sh web +./build.sh pub + +# FIXME: add tagging somewhere! From efe1d3db7984f3715b8b657a2bca7a61ae83d31a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:43:18 +0200 Subject: [PATCH 0660/5465] Prepare files for the next release --- bin/cdist-config | 2 +- doc/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index 44a95f01..366b7993 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -19,7 +19,7 @@ # # -__cdist_version="1.6.1" +__cdist_version="1.6.2" # Fail if something bogus is going on set -u diff --git a/doc/changelog b/doc/changelog index be175ffd..e2d6bb49 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,4 +1,4 @@ -1.6.2: +1.6.2: 2011-04-19 * Core: Introduce __cdist_tmp_base_dir * Core: Cleanup and enhance cdist-type-template * Core: cdist-mass-deploy: Report failed cdist-deploy-to instances From c2454b645b5be1b40c61dceb04a5e2e4f32ca7ba Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:43:49 +0200 Subject: [PATCH 0661/5465] add tag support Signed-off-by: Nico Schottelius --- doc/dev/releasechecklist | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/dev/releasechecklist b/doc/dev/releasechecklist index 379954e7..098ead06 100755 --- a/doc/dev/releasechecklist +++ b/doc/dev/releasechecklist @@ -20,6 +20,11 @@ vi $files # Commit stuff git commit $files +# add tag +printf "Enter description for %s>" "$version" +read tagmessage +git tag "$version" "$tagmessage" + # Import into current version branch git checkout $branch git merge master @@ -27,5 +32,3 @@ git merge master # Publish manpages and sourcecode ./build.sh web ./build.sh pub - -# FIXME: add tagging somewhere! From 3de78bfaed74cc64be364825cf6e20ab4546c583 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:45:05 +0200 Subject: [PATCH 0662/5465] + push architecture in readme Signed-off-by: Nico Schottelius --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index 350cd3e1..2d97f20c 100644 --- a/README +++ b/README @@ -35,6 +35,7 @@ Design | Meaningful error messages - do not lose time debugging error messages Design | Consistency in behaviour, naming and documentation Design | No surprise factor: Only do what is obviously clear, no magic Design | Define target state, do not focus on methods or scripts +Design | 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 Requirements, Scalability | No central server needed, cdist operates in push mode and can be run from any computer From 6d5962826a9bfda60ab914de59cd4d2f15404678 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 22:48:28 +0200 Subject: [PATCH 0663/5465] change back to master after everything is done Signed-off-by: Nico Schottelius --- doc/dev/releasechecklist | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/dev/releasechecklist b/doc/dev/releasechecklist index 098ead06..5568ee35 100755 --- a/doc/dev/releasechecklist +++ b/doc/dev/releasechecklist @@ -28,6 +28,7 @@ git tag "$version" "$tagmessage" # Import into current version branch git checkout $branch git merge master +git checkout master # Publish manpages and sourcecode ./build.sh web From 5cc626a2a10e771e34b2b5a78347ccc4f3a76bea Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 19 Apr 2011 23:47:26 +0200 Subject: [PATCH 0664/5465] add a video showing a cdist installation in less than 60 seconds Signed-off-by: Nico Schottelius --- ...st-installation-in-less-than-60-seconds.mp4 | Bin 0 -> 590996 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/video/cdist-installation-in-less-than-60-seconds.mp4 diff --git a/doc/video/cdist-installation-in-less-than-60-seconds.mp4 b/doc/video/cdist-installation-in-less-than-60-seconds.mp4 new file mode 100644 index 0000000000000000000000000000000000000000..cdccbe43406af40fa498799ffcd727acbba85201 GIT binary patch literal 590996 zcmeFZ1z1;Ivo=n5Bi$iLcXtZXjdXW+N`r``bR!MYDcv2?APv&eoxeW{>hnD3)pNe{ zz5n{Ib6u#Leebnq=AK!zX05f|KtMpi#wS1o#nq7BLA}g`KtP~C-~Iw^U4_s9x(7|R zTg?0K|AhbtOwNgHHLlNy)x=Uy6V8zA?Yl6tG857e>Ra0x5;8D+yA-3nzeOh{EApI% znNUDk=pHjL)V~LWtZiH^42>KJ8R_YnXc*}k818SHI5^mF($P6PJJULu8W>tz=vvWQ z+Zoe+>zCHV!P4UX8EYE{Q)?@GPC|WMJzaes20}YSBOXRV14BIvYkhMb22OfTdO}?* zT?S{WPi zFt8Hpo7h=f>T2IV$w25}XJ}zzYJdL(y9>L4zQg@3eOt@>Ukwa(4cx4)40#wCsPC0G z(zSQcwy`%iwYkS0JFvCUwl*@dH*~naCtAMv2JskdVyDB#n(7roAWY z3%ZyppA+J{-e7YPRF1r$viP(drlW2)c5M={0smU0QPA$GwtUYjdeKcCxO>ndQc}g? zWkcja3?s&5e+_2|KLrk~rW|m$PFrEErs}%7T5a=0d2ouu`K!=tJ=EvH1Pkqy1HzRK zm|X#iiiu^C1QBDOYF}8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