Cleanup local and remote base_dir before execution

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-03 09:43:04 +01:00
commit f75f2a0de5
2 changed files with 20 additions and 10 deletions

View file

@ -33,20 +33,14 @@ export $__cdist_name_var_target_host="$__cdist_target_host"
# Export variables for core, which others do not reset
export __cdist_local_base_dir
echo "cdist $__cdist_version: Configuring $__cdist_target_host"
################################################################################
# See cdist-stages(7)
#
echo "cdist $__cdist_version: Configuring $__cdist_target_host"
# Init base
mkdir -p "$__cdist_local_base_dir"
# Ensure there is no old link, otherwise the new link is created below the old
rm -f "$__cdist_local_base_dir/$__cdist_name_conf_dir"
# Link configuration source directory - consistent with remote
ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir"
# Prepare local and remote directories
__cdist_init_deploy "$__cdist_target_host"
# Transfer cdist "binaries"
cdist-bin-transfer "$__cdist_target_host" "$__cdist_remote_bin_dir"