From c5d8eaa63dd7f44990a2e4bf4fe282198adf1131 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 28 Mar 2011 10:54:22 +0200 Subject: [PATCH 01/12] 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 02/12] 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 03/12] 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 04/12] 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 05/12] 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 06/12] 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 07/12] 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 08/12] 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 09/12] 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 10/12] 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 11/12] 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 12/12] 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).