strip one parameter from cdist-bin-transfer

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-17 20:33:26 +01:00
parent 5b82a0fcda
commit 96c9ecf6fe
2 changed files with 5 additions and 6 deletions

View file

@ -22,11 +22,10 @@
#
. cdist-config
[ $# -eq 2 ] || __cdist_usage "<target host> <remote bin dir>"
[ $# -eq 1 ] || __cdist_usage "<target host>"
set -eu
__cdist_target_host="$1"; shift
__cdist_my_remote_out_dir="$1"; shift
# Find directory that contains cdist binaries
__cdist_conf_dir_path=$(which cdist-config)
@ -37,15 +36,15 @@ echo "Transferring cdist binaries ..."
# re-create basedir so it's clean
ssh "${__cdist_remote_user}@${__cdist_target_host}" \
"rm -rf \"${__cdist_my_remote_out_dir}\" && mkdir -p \"${__cdist_my_remote_out_dir}\""
"rm -rf \"${__cdist_remote_bin_dir}\" && mkdir -p \"${__cdist_remote_bin_dir}\""
# Transfer cdist-* to the remote host
scp -qr "${__cdist_src_base}"* \
"${__cdist_remote_user}@${__cdist_target_host}:${__cdist_my_remote_out_dir}"
"${__cdist_remote_user}@${__cdist_target_host}:${__cdist_remote_bin_dir}"
# Adjust cdist-config to contain static version string
tmp_version="$__cdist_version"
sed "s/^: \${\(__cdist_version\):=.*/\1=\"$tmp_version\"/" "$(which cdist-config)" | \
ssh -q "${__cdist_remote_user}@${__cdist_target_host}" \
"cat > \"${__cdist_my_remote_out_dir}\"/cdist-config"
"cat > \"${__cdist_remote_bin_dir}\"/cdist-config"

View file

@ -43,7 +43,7 @@ echo "cdist $__cdist_version: Configuring $__cdist_target_host"
__cdist_init_deploy "$__cdist_target_host"
# Transfer cdist "binaries"
cdist-bin-transfer "$__cdist_target_host" "$__cdist_remote_bin_dir"
cdist-bin-transfer "$__cdist_target_host"
# Execute general explorers
cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir"