forked from ungleich-public/cdist
Finish bin/cdist-exec-run
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
7ad15d6733
commit
bb00bc93ef
2 changed files with 6 additions and 11 deletions
|
@ -18,21 +18,16 @@
|
||||||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Transfer executables
|
# Exec executables on the remote side
|
||||||
#
|
#
|
||||||
|
|
||||||
. cdist-config
|
. cdist-config
|
||||||
|
[ $# -eq 1 ] || __cdist_usage "<target host>"
|
||||||
[ $# -eq 2 ] || __cdist_usage "<target host> <exec_dir>"
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export __cdist_target_host="$1"; shift
|
export __cdist_target_host="$1"; shift
|
||||||
export __cdist_exec_dir="$1"; shift
|
|
||||||
|
|
||||||
|
|
||||||
# re-create basedir so it's clean
|
# Run executables - no order, no dependencies yet
|
||||||
ssh "root@${__cdist_target_host}" "rm -rf \"${__cdist_remote_cache_exec}\" && mkdir -p \"${__cdist_remote_cache_exec}\""
|
ssh "root@${__cdist_target_host}" \
|
||||||
|
"find \"${__cdist_remote_cache_exec}\" -type f -name \"${__cdist_name_exec}\" -exec {} \\;"
|
||||||
# FIXME: enable -q as soon as the code is cleaned up
|
|
||||||
scp -r "${__cdist_exec_dir}"/* \
|
|
||||||
"root@${__cdist_target_host}:${__cdist_remote_cache_exec}"
|
|
||||||
|
|
|
@ -47,10 +47,10 @@ fi
|
||||||
|
|
||||||
mkdir -p "${__cdist_output_dir}"
|
mkdir -p "${__cdist_output_dir}"
|
||||||
|
|
||||||
|
# Catch errors ourselves now
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
"${__cdist_manifest}"; ret=$?
|
"${__cdist_manifest}"; ret=$?
|
||||||
|
|
||||||
if [ "$ret" -ne 0 ]; then
|
if [ "$ret" -ne 0 ]; then
|
||||||
__cdist_exit_err "Error: ${__cdist_manifest} exited non-zero."
|
__cdist_exit_err "Error: ${__cdist_manifest} exited non-zero."
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue