From 2d30dd6aad6617a0e7ecfba16cece7fdb85cddfa Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 1 Apr 2011 11:12:15 +0200 Subject: [PATCH 01/28] 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 a60e2838e324fe92e0bac7c12f46dc81d6509eff Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 4 Apr 2011 11:54:42 +0200 Subject: [PATCH 02/28] 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 03/28] 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 4701c14045b20681b05a41fb9266ad406e43822f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 5 Apr 2011 20:55:35 +0200 Subject: [PATCH 04/28] 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 05/28] 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 06/28] 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 07/28] 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 08/28] 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 09/28] 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 10/28] 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 11/28] 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 12/28] -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 13/28] 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 14/28] /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 dcd96c04d40b3aed414c94fae0c327d26135fbeb Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 5 Apr 2011 23:27:51 +0200 Subject: [PATCH 15/28] 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 16/28] 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 17/28] 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 18/28] 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 19/28] 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 20/28] 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 21/28] 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 22/28] 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 23/28] 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 24/28] 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 25/28] 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 26/28] -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 27/28] 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 28/28] 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