From 44ecd1f056a498d0ffb3d6216d1c75f6653eda7a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 17:27:27 +0100 Subject: [PATCH 01/24] 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 1e66bc43803a5be74e36346944fc00acf847c24f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 23:54:13 +0100 Subject: [PATCH 02/24] 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 03/24] 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 7a294bf41d165eaeac22f3698db4dc2697c95107 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 10:13:52 +0100 Subject: [PATCH 04/24] 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 05/24] 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 06/24] 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 07/24] 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 08/24] 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 09/24] 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 10/24] 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 11/24] 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 12/24] 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 13/24] 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 33552e5930b0958c1d0930cfa5f92ac7abe7532e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 24 Mar 2011 15:26:06 +0100 Subject: [PATCH 14/24] [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 15/24] 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 16/24] 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 17/24] 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 18/24] 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 19/24] 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 20/24] 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 21/24] -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 22/24] 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 23/24] 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 24/24] 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.