diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to index b6203409..88b7aaf9 100755 --- a/bin/cdist-deploy-to +++ b/bin/cdist-deploy-to @@ -46,12 +46,14 @@ cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir" # Create initial object base cdist-manifest-init "$__cdist_target_host" "$__cdist_out_object_dir" -# Create dependent objects +# Create dependent objects - BUG: does not abort on error in manifest!!!! cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir" +# Run explorer of each type for every object of types with explorer +cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir" + exit 2 -cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir" cdist-object-codegen-all "$__cdist_target_host" "$__cdist_out_object_dir" "$__cdist_out_execs" cdist-exec-transfer "$__cdist_target_host" "$__cdist_out_execs" cdist-exec-run "$__cdist_target_host" diff --git a/bin/cdist-manifest-init b/bin/cdist-manifest-init index 2b9ae00b..9e8a346f 100755 --- a/bin/cdist-manifest-init +++ b/bin/cdist-manifest-init @@ -29,4 +29,5 @@ set -e export __cdist_target_host="$1"; shift export __cdist_output_dir="$1"; shift -cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" "$__cdist_output_dir" +cdist-manifest-run "$__cdist_target_host" "$__cdist_local_base_dir" \ + "$__cdist_manifest_init" "$__cdist_output_dir" diff --git a/bin/cdist-manifest-run b/bin/cdist-manifest-run index 48990edb..892b3a2f 100755 --- a/bin/cdist-manifest-run +++ b/bin/cdist-manifest-run @@ -23,12 +23,13 @@ # . cdist-config -[ $# -ge 3 ] || __cdist_usage " [manifest arguments]" +[ $# -ge 4 ] || __cdist_usage " [manifest arguments]" set -u -export __cdist_target_host="$1"; shift -export __cdist_manifest="$1"; shift -export __cdist_output_dir="$1"; shift +__cdist_target_host="$1"; shift +__cdist_work_dir="$1"; shift +__cdist_manifest="$1"; shift +__cdist_output_dir="$1"; shift # Ensure binaries exist and are up-to-date cdist-type-build-emulation || __cdist_exit_err "Failed to build type emulation binaries" @@ -43,4 +44,5 @@ fi mkdir -p "${__cdist_output_dir}" || __cdist_exit_err "Cannot create output dir ${__cdist_output_dir}" +cd "$__cdist_work_dir" || __cdist_exit_err "Cannot change to work dir \"$__cdist_work_dir\"." __cdist_exec_fail_on_error "${__cdist_manifest}" "$@" diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 038b0dc9..5d21b70c 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -60,17 +60,12 @@ while [ "$__cdist_new_objects_created" = "y" ]; do __cdist_type="$(__cdist_type_from_object "$__cdist_object")" __cdist_manifest="$__cdist_type_dir/${__cdist_type}/${__cdist_name_manifest}" - echo $__cdist_manifest if [ -x "${__cdist_manifest}" ]; then echo "Executing manifest ${__cdist_manifest} ..." - # Safely change directory, convienent for type-writers - ( - cd "$__cdist_cur_object_dir" - cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" \ - "$__cdist_new_objects_dir" "$__cdist_object_id" - ) + cdist-manifest-run "$__cdist_target_host" "$__cdist_cur_object_dir" \ + "$__cdist_manifest" "$__cdist_new_objects_dir" "$__cdist_object_id" __cdist_object_list "${__cdist_new_objects_dir}" > "$__cdist_new_objects_list" diff --git a/bin/cdist-object-explorer-all b/bin/cdist-object-explorer-all index cd4fee6f..45628f4a 100755 --- a/bin/cdist-object-explorer-all +++ b/bin/cdist-object-explorer-all @@ -28,6 +28,23 @@ set -eu __cdist_target_host="$1"; shift __cdist_object_base_dir="$1"; shift +################################################################################ +# New code +# + +# Get listing of objects + +# Get listing of types used + +# For every type that has explorers, Transfer the explorers + +# For every object of a type that has explorers, execute the explorers +# and retrieve the results + +################################################################################ +# Old code +# + __cdist_object_list "$__cdist_object_base_dir" > "$__cdist_tmp_file" # need to create pseudo array, as ssh in cdist-explorer-run will destroy while-read loops diff --git a/conf/types/__issue/manifest b/conf/types/__issue/manifest index d38aeb92..45c3bd98 100755 --- a/conf/types/__issue/manifest +++ b/conf/types/__issue/manifest @@ -20,8 +20,9 @@ # destination=/etc/issue +os="$(cat "out/explorers/os")" -case "$(cat "out/explorers/os")" in +case "$os" in archlinux) source="$(pwd -P)/files/archlinux" ;; diff --git a/doc/dev/logs/2011-02-24 b/doc/dev/logs/2011-02-24 new file mode 100644 index 00000000..7ba6d3de --- /dev/null +++ b/doc/dev/logs/2011-02-24 @@ -0,0 +1,14 @@ +- Steven, Nico + +- all cdist cores change to the local or remote base dir before excution + of non-core (i.e. manifests, gencode, ...) executables + +- non-core executables get helper information via environment variables: + + general explorers: __explorers + initial manifest: __manifests + type manifests: __object, __object_id + type explorers: __object, __object_id, __type_explorers + type codegen: __object, __object_id + type code: - + diff --git a/doc/dev/todo/niconext b/doc/dev/todo/niconext index d6a7e77e..099464f1 100644 --- a/doc/dev/todo/niconext +++ b/doc/dev/todo/niconext @@ -1,6 +1 @@ add explorers per type/object - - create clean trees locally and remote - - define paths in cdist-config - - rewrite cdist-explorer-run - - define helpers on the remote side (like cdist-explorer-coordinator) - - make cdist-config available / put helpers into path