forked from ungleich-public/cdist
+mass cleanup
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
425f2bb71a
commit
2f926582e0
5 changed files with 16 additions and 11 deletions
|
@ -13,19 +13,21 @@ What you can do so far: (executed from top level directory)
|
|||
|
||||
# prepare use:
|
||||
export PATH="$PATH:$(pwd -P)/bin"
|
||||
object_tmp=/tmp/localhost/objects
|
||||
explorer_tmp=/tmp/localhost/explorers
|
||||
|
||||
# Test first level manifest execution
|
||||
__cdist_config=$(pwd -P)/conf __cdist_target_host=localhost cdist-manifest-init
|
||||
__cdist_config=$(pwd -P)/conf cdist-manifest-init localhost $object_tmp
|
||||
|
||||
# See what it generated
|
||||
find conf/cache
|
||||
find $object_tmp
|
||||
|
||||
# Run explorer on a "remote" host
|
||||
__cdist_config=$(pwd -P)/conf __cdist_target_host=localhost cdist-explorer-run
|
||||
__cdist_config=$(pwd -P)/conf cdist-explorer-run localhost $explorer_tmp
|
||||
|
||||
# Display result
|
||||
find conf/cache/hosts/localhost
|
||||
find $explorer_tmp
|
||||
|
||||
# Soon working:
|
||||
__cdist_config=$(pwd -P)/conf __cdist_target_host=localhost cdist-manifest-recursive-run ~/p/cdist/conf/cache/hosts/localhost/objects
|
||||
__cdist_config=$(pwd -P)/conf cdist-manifest-recursive-run localhost $object_tmp
|
||||
|
||||
|
|
|
@ -29,12 +29,13 @@
|
|||
|
||||
. cdist-config
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
__cdist_usage "<object_dir>"
|
||||
if [ $# -ne 2 ]; then
|
||||
__cdist_usage "<target host> <object_dir>"
|
||||
fi
|
||||
|
||||
set -eu
|
||||
|
||||
__cdist_target_host="$1"; shift
|
||||
__cdist_object_dir="$1"; shift
|
||||
|
||||
# change to directory containing objects
|
||||
|
@ -67,7 +68,7 @@ while [ "$__cdist_object_created_new" = 1 ]; do
|
|||
|
||||
if [ -x "${manifest}" ]; then
|
||||
echo "Running manifest of type ${type} ..."
|
||||
cdist-manifest-run "${__cdist_tmp_dir}" "${manifest}"
|
||||
cdist-manifest-run "$__cdist_target_host" "${manifest}" "${__cdist_tmp_dir}"
|
||||
|
||||
echo "Trying to merge... "
|
||||
|
||||
|
@ -80,8 +81,7 @@ while [ "$__cdist_object_created_new" = 1 ]; do
|
|||
|
||||
while read newobject; do
|
||||
if [ -e "$__cdist_object_dir/${newobject}" ]; then
|
||||
echo FAIIIIIIIIL
|
||||
exit 23
|
||||
__cdist_exit_err "${newobject} already exists, merge failed."
|
||||
else
|
||||
# Fine, merge back!
|
||||
pax -r -w "$newobject" "$__cdist_object_dir"
|
||||
|
|
|
@ -28,7 +28,6 @@ if [ $# -ne 3 ]; then
|
|||
__cdist_usage "<target host> <manifest> <outdir>"
|
||||
fi
|
||||
|
||||
set -x
|
||||
set -aeu
|
||||
|
||||
export __cdist_target_host="$1"; shift
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
# This is a sample manifest, but used in real world
|
||||
#
|
||||
|
||||
set -x
|
||||
|
||||
# All ikqs get a sample file
|
||||
case "$__cdist_target_host" in
|
||||
ikq*|localhost)
|
||||
|
|
|
@ -30,6 +30,8 @@ unsorted: cache / objects
|
|||
myhost/__file/cdist_bin/destination
|
||||
...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
ENVIRONMENT
|
||||
-----------
|
||||
|
|
Loading…
Reference in a new issue