export __manifests

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-24 14:47:52 +01:00
parent 7db5a80831
commit 7d766d5376
7 changed files with 21 additions and 10 deletions

View File

@ -35,15 +35,16 @@ set -u
: ${__cdist_name_gencode:=gencode}
: ${__cdist_name_host:=hosts}
: ${__cdist_name_init:=init}
: ${__cdist_name_manifest:=manifest}
: ${__cdist_name_manifest_dir:=manifests}
: ${__cdist_name_out_dir:=out}
: ${__cdist_name_conf_dir:=conf}
: ${__cdist_name_type_bin:=type_bin}
# Exported variable names
# Exported variable names (usable for non core)
: ${__cdist_name_var_explorer:=__$__cdist_name_explorer}
: ${__cdist_name_var_manifest:=__$__cdist_name_manifest_dir}
# Name of the manifest file in types
: ${__cdist_name_manifest:=manifest}
# Name of the base directory containing the initial manifests
: ${__cdist_name_manifests:=manifests}

View File

@ -44,7 +44,7 @@ cdist-bin-transfer "$__cdist_target_host" "$__cdist_remote_bin_dir"
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"
cdist-manifest-run-init "$__cdist_target_host" "$__cdist_out_object_dir"
# Create dependent objects - BUG: does not abort on error in manifest!!!!
cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir"

View File

@ -23,14 +23,16 @@
#
. cdist-config
[ $# -ge 4 ] || __cdist_usage "<target host> <work dir> <manifest> <out dir> [manifest arguments]"
[ $# -ge 3 ] || __cdist_usage "<target host> <manifest> <out dir> [manifest arguments]"
set -u
__cdist_target_host="$1"; shift
__cdist_work_dir="$1"; shift
__cdist_manifest="$1"; shift
__cdist_output_dir="$1"; shift
# Always start from local base
__cdist_work_dir="$__cdist_local_base_dir"
# Ensure binaries exist and are up-to-date
cdist-type-build-emulation || __cdist_exit_err "Failed to build type emulation binaries"

View File

@ -61,6 +61,9 @@ 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}"
# Make __cdist_manifest available for cdist-type-emulator
export __cdist_manifest
if [ -x "${__cdist_manifest}" ]; then
echo "Executing manifest ${__cdist_manifest} ..."

View File

@ -26,8 +26,9 @@
[ $# -eq 2 ] || __cdist_usage "<target host> <outdir>"
set -e
export __cdist_target_host="$1"; shift
export __cdist_output_dir="$1"; shift
__cdist_target_host="$1"; shift
__cdist_output_dir="$1"; shift
cdist-manifest-run "$__cdist_target_host" "$__cdist_local_base_dir" \
"$__cdist_manifest_init" "$__cdist_output_dir"
eval export $__cdist_name_var_manifest=\"\$__cdist_manifest_dir\"
cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest_init" "$__cdist_output_dir"

View File

@ -2,6 +2,8 @@
# This is a sample manifest, but used in real world
#
echo $__manifests
# All systems get a file /etc/cdist-managed, so the sysadmin knows
# who manages the configuration.
#__file /etc/cdist-managed --type file

View File

@ -1,3 +1,5 @@
add explorers per type/object
- change exec directory for all stages
- create cdist-remote-explorer-run that sets
- iterate over all stages again
- ensure discussed variables are in place