From 4b5d7dda25498c7630547d845bc0a59620ec6cb3 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 3 Feb 2011 13:24:56 +0100 Subject: [PATCH] mega cleaunp discussion commit :-) Signed-off-by: Nico Schottelius --- HACKERS_README | 4 +- TODO | 10 ++-- bin/cdist-apply | 41 --------------- ...cdist-template => cdist-template.obsolete} | 0 conf/{explorer => explorers}/hostname | 0 conf/{explorer => explorers}/os | 0 conf/{explorer => explorers}/pkg_system | 0 conf/{lib => lib.obsoleted}/cdist_file.sh | 0 conf/{lib => lib.obsoleted}/cdist_package.sh | 0 .../cdist_package_backend_pacman_install.sh | 0 .../cdist_package_select_backend.sh | 0 .../collectd/manifest | 0 .../efsh/base.sh | 0 .../efsh/test.sh | 0 .../nginx-website/nginx_config.sh | 0 .../postgresql/init | 0 doc/{internal => dev}/git-post-commit-hook | 0 .../cdist-cache.TO_MAN} | 0 .../cdist-hacking.TO_MAN} | 2 + .../cdist-types.CLEANUP+INTEGRATE_MAN} | 0 .../config-layout.TO_MAN} | 7 ++- ...-implementation-ideas.TO_FINISH_AND_DELETE | 22 ++++++++ .../header | 0 .../logs/2010-09-25 | 0 .../logs/2010-11-02.steven | 0 .../logs/2010-11-09 | 0 .../logs/2010-11-21 | 0 .../logs/2010-11-29 | 0 .../logs/2010-12-01 | 0 .../logs/2011-01-17 | 0 .../logs/2011-01-18.type-creation | 0 .../logs/2011-01-24 | 0 doc/internal.REMOVE_PRE_1.0/logs/2011-02-03 | 50 +++++++++++++++++++ .../logs/stevens_ideas | 0 .../puppet-analysis.REMOVE_PRE_1.0} | 0 doc/internal/explorer-implementation-ideas | 12 ----- doc/internal/profile | 2 - doc/internal/shell-hints | 1 - ...st-explorer-coordinator-may-be-bogus.text} | 0 ...ist-explorer.text => cdist-explorers.text} | 0 40 files changed, 84 insertions(+), 67 deletions(-) delete mode 100755 bin/cdist-apply rename bin/{cdist-template => cdist-template.obsolete} (100%) rename conf/{explorer => explorers}/hostname (100%) rename conf/{explorer => explorers}/os (100%) rename conf/{explorer => explorers}/pkg_system (100%) rename conf/{lib => lib.obsoleted}/cdist_file.sh (100%) rename conf/{lib => lib.obsoleted}/cdist_package.sh (100%) rename conf/{lib => lib.obsoleted}/cdist_package_backend_pacman_install.sh (100%) rename conf/{lib => lib.obsoleted}/cdist_package_select_backend.sh (100%) rename conf/{modules => modules.obsoleted}/collectd/manifest (100%) rename conf/{modules => modules.obsoleted}/efsh/base.sh (100%) rename conf/{modules => modules.obsoleted}/efsh/test.sh (100%) rename conf/{modules => modules.obsoleted}/nginx-website/nginx_config.sh (100%) rename conf/{modules => modules.obsoleted}/postgresql/init (100%) rename doc/{internal => dev}/git-post-commit-hook (100%) rename doc/{internal/knowledge-about-other-hosts => internal.REMOVE_PRE_1.0/cdist-cache.TO_MAN} (100%) rename doc/{internal/csh-profile => internal.REMOVE_PRE_1.0/cdist-hacking.TO_MAN} (52%) rename doc/{internal/type-integration => internal.REMOVE_PRE_1.0/cdist-types.CLEANUP+INTEGRATE_MAN} (100%) rename doc/{internal/config-layout => internal.REMOVE_PRE_1.0/config-layout.TO_MAN} (87%) create mode 100644 doc/internal.REMOVE_PRE_1.0/explorer-implementation-ideas.TO_FINISH_AND_DELETE rename doc/{internal => internal.REMOVE_PRE_1.0}/header (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2010-09-25 (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2010-11-02.steven (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2010-11-09 (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2010-11-21 (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2010-11-29 (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2010-12-01 (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2011-01-17 (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2011-01-18.type-creation (100%) rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/2011-01-24 (100%) create mode 100644 doc/internal.REMOVE_PRE_1.0/logs/2011-02-03 rename doc/{internal => internal.REMOVE_PRE_1.0}/logs/stevens_ideas (100%) rename doc/{internal/puppet-analysis => internal.REMOVE_PRE_1.0/puppet-analysis.REMOVE_PRE_1.0} (100%) delete mode 100644 doc/internal/explorer-implementation-ideas delete mode 100644 doc/internal/profile delete mode 100644 doc/internal/shell-hints rename doc/man/{cdist-explorer-coordinator.text => cdist-explorer-coordinator-may-be-bogus.text} (100%) rename doc/man/{cdist-explorer.text => cdist-explorers.text} (100%) diff --git a/HACKERS_README b/HACKERS_README index 1a540f16..4d497573 100644 --- a/HACKERS_README +++ b/HACKERS_README @@ -9,13 +9,13 @@ Do not believe anything written in cdist, besides what's written in this file -- Nico, 20101201 -What you can do so far: +What you can do so far: (executed from top level directory) # prepare use: export PATH="$PATH:$(pwd -P)/bin" # Test first level manifest execution -__cdist_config=$(pwd -P)/conf __cdist_target_host=ikq02.ethz.ch cdist-manifest-init +__cdist_config=$(pwd -P)/conf __cdist_target_host=ikq02.ethz.ch cdist-manifest-init # See what it generated find conf/cache diff --git a/TODO b/TODO index 1a0f2996..4b6c10b3 100644 --- a/TODO +++ b/TODO @@ -6,6 +6,7 @@ - cdist-push-pull - cdist-quickstart - cdist-types [IMPORTANT] + - cdist.text [IMPORTANT] - add terminology - define steps within configuration apply - detect impossible/unsafe things: @@ -14,12 +15,11 @@ - and report location of occurence - parse afterwards? - multi master setups - - - how to define templates - - variable substitution from shell may be problematic + - templating + - how to define templates + - variable substitution from shell may be problematic - SHELL SCRIPTS! (executables? do not support?) - - stdout - - cleanup / integrate doc/man/cdist.text + - stdout == output of template == what will be used - cdist-explore - add more stuff to explore - write manpage diff --git a/bin/cdist-apply b/bin/cdist-apply deleted file mode 100755 index cbe84253..00000000 --- a/bin/cdist-apply +++ /dev/null @@ -1,41 +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 . -# -# -# Apply configuration to local host -# - -. cdist-config - -whereiam="$(cdist_explore_hostname)" -conf="${CDIST_HOSTS}/${whereiam}" - -if [ ! -d "${conf}" ]; then - echo "Sorry, ${whereiam} has no configuration" - exit 1 -fi - -# Run the manifest, but abort on first error -set -e - -# change to config dir, to be able to use relative filenames -cd "${conf}" - -# And apply the stuff -. "${conf}/manifest" diff --git a/bin/cdist-template b/bin/cdist-template.obsolete similarity index 100% rename from bin/cdist-template rename to bin/cdist-template.obsolete diff --git a/conf/explorer/hostname b/conf/explorers/hostname similarity index 100% rename from conf/explorer/hostname rename to conf/explorers/hostname diff --git a/conf/explorer/os b/conf/explorers/os similarity index 100% rename from conf/explorer/os rename to conf/explorers/os diff --git a/conf/explorer/pkg_system b/conf/explorers/pkg_system similarity index 100% rename from conf/explorer/pkg_system rename to conf/explorers/pkg_system diff --git a/conf/lib/cdist_file.sh b/conf/lib.obsoleted/cdist_file.sh similarity index 100% rename from conf/lib/cdist_file.sh rename to conf/lib.obsoleted/cdist_file.sh diff --git a/conf/lib/cdist_package.sh b/conf/lib.obsoleted/cdist_package.sh similarity index 100% rename from conf/lib/cdist_package.sh rename to conf/lib.obsoleted/cdist_package.sh diff --git a/conf/lib/cdist_package_backend_pacman_install.sh b/conf/lib.obsoleted/cdist_package_backend_pacman_install.sh similarity index 100% rename from conf/lib/cdist_package_backend_pacman_install.sh rename to conf/lib.obsoleted/cdist_package_backend_pacman_install.sh diff --git a/conf/lib/cdist_package_select_backend.sh b/conf/lib.obsoleted/cdist_package_select_backend.sh similarity index 100% rename from conf/lib/cdist_package_select_backend.sh rename to conf/lib.obsoleted/cdist_package_select_backend.sh diff --git a/conf/modules/collectd/manifest b/conf/modules.obsoleted/collectd/manifest similarity index 100% rename from conf/modules/collectd/manifest rename to conf/modules.obsoleted/collectd/manifest diff --git a/conf/modules/efsh/base.sh b/conf/modules.obsoleted/efsh/base.sh similarity index 100% rename from conf/modules/efsh/base.sh rename to conf/modules.obsoleted/efsh/base.sh diff --git a/conf/modules/efsh/test.sh b/conf/modules.obsoleted/efsh/test.sh similarity index 100% rename from conf/modules/efsh/test.sh rename to conf/modules.obsoleted/efsh/test.sh diff --git a/conf/modules/nginx-website/nginx_config.sh b/conf/modules.obsoleted/nginx-website/nginx_config.sh similarity index 100% rename from conf/modules/nginx-website/nginx_config.sh rename to conf/modules.obsoleted/nginx-website/nginx_config.sh diff --git a/conf/modules/postgresql/init b/conf/modules.obsoleted/postgresql/init similarity index 100% rename from conf/modules/postgresql/init rename to conf/modules.obsoleted/postgresql/init diff --git a/doc/internal/git-post-commit-hook b/doc/dev/git-post-commit-hook similarity index 100% rename from doc/internal/git-post-commit-hook rename to doc/dev/git-post-commit-hook diff --git a/doc/internal/knowledge-about-other-hosts b/doc/internal.REMOVE_PRE_1.0/cdist-cache.TO_MAN similarity index 100% rename from doc/internal/knowledge-about-other-hosts rename to doc/internal.REMOVE_PRE_1.0/cdist-cache.TO_MAN diff --git a/doc/internal/csh-profile b/doc/internal.REMOVE_PRE_1.0/cdist-hacking.TO_MAN similarity index 52% rename from doc/internal/csh-profile rename to doc/internal.REMOVE_PRE_1.0/cdist-hacking.TO_MAN index 5dd85e2e..c7254168 100644 --- a/doc/internal/csh-profile +++ b/doc/internal.REMOVE_PRE_1.0/cdist-hacking.TO_MAN @@ -1,2 +1,4 @@ setenv PATH ${PATH}:${HOME}/cdist/bin setenv CDIST_CONFIG ${HOME}/cdist/conf +export PATH=$PATH:$HOME/cdist/bin +export CDIST_CONFIG=$HOME/cdist/conf diff --git a/doc/internal/type-integration b/doc/internal.REMOVE_PRE_1.0/cdist-types.CLEANUP+INTEGRATE_MAN similarity index 100% rename from doc/internal/type-integration rename to doc/internal.REMOVE_PRE_1.0/cdist-types.CLEANUP+INTEGRATE_MAN diff --git a/doc/internal/config-layout b/doc/internal.REMOVE_PRE_1.0/config-layout.TO_MAN similarity index 87% rename from doc/internal/config-layout rename to doc/internal.REMOVE_PRE_1.0/config-layout.TO_MAN index 72f1c1f7..97c0c22e 100644 --- a/doc/internal/config-layout +++ b/doc/internal.REMOVE_PRE_1.0/config-layout.TO_MAN @@ -8,7 +8,7 @@ conf/manifests/init will be available for tracking in cdist core functions -core/manifests/* (all other) +conf/manifests/* (all other) - same function as above - but won't be called by cdist - method to seperate configuration parts @@ -26,9 +26,8 @@ conf/types// but more like reusable defines - or may implement some functionality on their own -lib/types// - - same as above, but provided by the cdist distribution - - if name exists in both, conf/ has priority +conf/explorers/ + - explorers to be run on the target hosts Differences manifests vs. types diff --git a/doc/internal.REMOVE_PRE_1.0/explorer-implementation-ideas.TO_FINISH_AND_DELETE b/doc/internal.REMOVE_PRE_1.0/explorer-implementation-ideas.TO_FINISH_AND_DELETE new file mode 100644 index 00000000..31e4c048 --- /dev/null +++ b/doc/internal.REMOVE_PRE_1.0/explorer-implementation-ideas.TO_FINISH_AND_DELETE @@ -0,0 +1,22 @@ +1) safer and fast version + cat blob | ssh host > tmp; + for var in ... + var=grep ^var= tmp +2) slow & secure + for var in ... + eval var=$(cat single_blob | ssh host" + +3) easy & insecure + cat blob | ssh host > tmp; . tmp + +4) - rsync here/explorers target/explorers + - ssh target_host for explorer in target/explorers/; do + target/explorers/$explorer > target/cache/explorers/$explorer + done + - rsync target/cache/explorers here/cache/explorers.... + - MINUS RSYNC!!!!!!!!!?????????? + +-------------------------------------------------------------------------------- + +TO_MAN: EXPLORER VALUES ARE UNTRUSTED (think of webclients and webapps) + diff --git a/doc/internal/header b/doc/internal.REMOVE_PRE_1.0/header similarity index 100% rename from doc/internal/header rename to doc/internal.REMOVE_PRE_1.0/header diff --git a/doc/internal/logs/2010-09-25 b/doc/internal.REMOVE_PRE_1.0/logs/2010-09-25 similarity index 100% rename from doc/internal/logs/2010-09-25 rename to doc/internal.REMOVE_PRE_1.0/logs/2010-09-25 diff --git a/doc/internal/logs/2010-11-02.steven b/doc/internal.REMOVE_PRE_1.0/logs/2010-11-02.steven similarity index 100% rename from doc/internal/logs/2010-11-02.steven rename to doc/internal.REMOVE_PRE_1.0/logs/2010-11-02.steven diff --git a/doc/internal/logs/2010-11-09 b/doc/internal.REMOVE_PRE_1.0/logs/2010-11-09 similarity index 100% rename from doc/internal/logs/2010-11-09 rename to doc/internal.REMOVE_PRE_1.0/logs/2010-11-09 diff --git a/doc/internal/logs/2010-11-21 b/doc/internal.REMOVE_PRE_1.0/logs/2010-11-21 similarity index 100% rename from doc/internal/logs/2010-11-21 rename to doc/internal.REMOVE_PRE_1.0/logs/2010-11-21 diff --git a/doc/internal/logs/2010-11-29 b/doc/internal.REMOVE_PRE_1.0/logs/2010-11-29 similarity index 100% rename from doc/internal/logs/2010-11-29 rename to doc/internal.REMOVE_PRE_1.0/logs/2010-11-29 diff --git a/doc/internal/logs/2010-12-01 b/doc/internal.REMOVE_PRE_1.0/logs/2010-12-01 similarity index 100% rename from doc/internal/logs/2010-12-01 rename to doc/internal.REMOVE_PRE_1.0/logs/2010-12-01 diff --git a/doc/internal/logs/2011-01-17 b/doc/internal.REMOVE_PRE_1.0/logs/2011-01-17 similarity index 100% rename from doc/internal/logs/2011-01-17 rename to doc/internal.REMOVE_PRE_1.0/logs/2011-01-17 diff --git a/doc/internal/logs/2011-01-18.type-creation b/doc/internal.REMOVE_PRE_1.0/logs/2011-01-18.type-creation similarity index 100% rename from doc/internal/logs/2011-01-18.type-creation rename to doc/internal.REMOVE_PRE_1.0/logs/2011-01-18.type-creation diff --git a/doc/internal/logs/2011-01-24 b/doc/internal.REMOVE_PRE_1.0/logs/2011-01-24 similarity index 100% rename from doc/internal/logs/2011-01-24 rename to doc/internal.REMOVE_PRE_1.0/logs/2011-01-24 diff --git a/doc/internal.REMOVE_PRE_1.0/logs/2011-02-03 b/doc/internal.REMOVE_PRE_1.0/logs/2011-02-03 new file mode 100644 index 00000000..b82b4aa5 --- /dev/null +++ b/doc/internal.REMOVE_PRE_1.0/logs/2011-02-03 @@ -0,0 +1,50 @@ +Steven: + +- cdist-deploy-to = main script +- all user usable variables are defined using export __var=... +- cdist-explorer return one line of output (or empty) +- cdist-manifest-init: generates what the user defined to be configured on target host +- HACKERS_README == starting point (until 1.0) + - [12:49] kr:cdist% __cdist_config=$(pwd -P)/conf __cdist_target_host=ikq02.ethz.ch cdist-manifest-init +- cdist_tree_wrapper == non-user-binary => libexec +- conf/explorer collection of explorer +- config-layout: current status of configuration + - needs to go into manpage +- TODO: contains most up-to-date todo stuff, mid-term +- ROADMAP: next steps +- Documentation must be bit better than excellent at first release +- test/: ignore (braindump and pre-braindump) +- conf/ + cache: generated + explorer: ok => contains explores + lib: deprecated (does not exist) + manifests: entry point for config2host + types: cdist-types(7) +- alternative names for explorer: + - probe + - fact + - ... + - => STEVEN TO DECIDE +- explorer / execution: + - see explorer-implementation-ideas.TO_FINISH_AND_DELETE + +Todo: +- cdist-preprocess: + - fix call to cdist-build-explorer and transfer explorer to target host +- cdist-manifest-init/ cdist_tree_wrapper: + - fails on second run => use different cache! (old cache exists until new is valid!) +- .source in cdist_tree_wrapper records wrong source! +- cdist-config: + - use export to mark user available variables! +- doc/man/* => defined in TODO + + +Future: +- ids containing slashes for easier use in types? + - a) __file abc --source /path/from/abc --destination /path/to/abc + - b) id=abc + __file $id --source /path/from/$id --destination /path/to/$id + - c) __file abc --sourcedir /path/from/ --destination_dir /path/to/ + - type file defines that id is implicitly used when --...dir variants used + - d) __file /path/to/abc --source ? --destination ? + - reusing id with slashes would be nice diff --git a/doc/internal/logs/stevens_ideas b/doc/internal.REMOVE_PRE_1.0/logs/stevens_ideas similarity index 100% rename from doc/internal/logs/stevens_ideas rename to doc/internal.REMOVE_PRE_1.0/logs/stevens_ideas diff --git a/doc/internal/puppet-analysis b/doc/internal.REMOVE_PRE_1.0/puppet-analysis.REMOVE_PRE_1.0 similarity index 100% rename from doc/internal/puppet-analysis rename to doc/internal.REMOVE_PRE_1.0/puppet-analysis.REMOVE_PRE_1.0 diff --git a/doc/internal/explorer-implementation-ideas b/doc/internal/explorer-implementation-ideas deleted file mode 100644 index 9006b66f..00000000 --- a/doc/internal/explorer-implementation-ideas +++ /dev/null @@ -1,12 +0,0 @@ -1) safer and fast version - cat blob | ssh host > tmp; - for var in ... - var=grep ^var= tmp -2) slow & secure - for var in ... - eval var=$(cat single_blob | ssh host" - -3) easy & insecure - cat blob | ssh host > tmp; . tmp - - diff --git a/doc/internal/profile b/doc/internal/profile deleted file mode 100644 index e18cf3e3..00000000 --- a/doc/internal/profile +++ /dev/null @@ -1,2 +0,0 @@ -export PATH=$PATH:$HOME/cdist/bin -export CDIST_CONFIG=$HOME/cdist/conf diff --git a/doc/internal/shell-hints b/doc/internal/shell-hints deleted file mode 100644 index 0ad888d6..00000000 --- a/doc/internal/shell-hints +++ /dev/null @@ -1 +0,0 @@ -$0 evaluated in a sourced script returns name of the caller. diff --git a/doc/man/cdist-explorer-coordinator.text b/doc/man/cdist-explorer-coordinator-may-be-bogus.text similarity index 100% rename from doc/man/cdist-explorer-coordinator.text rename to doc/man/cdist-explorer-coordinator-may-be-bogus.text diff --git a/doc/man/cdist-explorer.text b/doc/man/cdist-explorers.text similarity index 100% rename from doc/man/cdist-explorer.text rename to doc/man/cdist-explorers.text