Browse Source

Finish ugly explorer integration

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
1.0 0.9.4
Nico Schottelius 12 years ago
parent
commit
16f51ca14d
  1. 10
      bin/cdist-config
  2. 4
      bin/cdist-deploy-to
  3. 19
      bin/cdist-explorer-run
  4. 3
      conf/explorers/os
  5. 4
      conf/explorers/pkg_system

10
bin/cdist-config

@ -37,10 +37,12 @@
# Paths used on the target - must be kind of secure....
: ${__cdist_remote_base_dir:=/var/lib/cdist}
: ${__cdist_remote_explorer_dir:=$__cdist_remote_base/explorers}
: ${__cdist_remote_cache_dir:=$__cdist_remote_base/cache}
: ${__cdist_remote_cache_explorer:=$__cdist_remote_base/cache}
: ${__cdist_remote_cache_bin:=$__cdist_remote_base/bin}
: ${__cdist_remote_explorer_dir:=$__cdist_remote_base_dir/explorers}
export __cdist_remote_explorer_dir
: ${__cdist_remote_cache_dir:=$__cdist_remote_base_dir/cache}
: ${__cdist_remote_cache_explorer:=$__cdist_remote_cache_dir/explorers}
export __cdist_remote_cache_explorer
: ${__cdist_remote_cache_bin:=$__cdist_remote_base_dir/bin}
# create basedir + tempfile for direct usage
# FIXME: remove on exit

4
bin/cdist-deploy-to

@ -31,5 +31,5 @@ set -e
export __cdist_target_host="$1"
export __cdist_source_host="$(cdist_explore_hostname)"
. cdist-build "$__cdist_intern_target_host"
. cdist-remote-exec "$__cdist_intern_target_host"
. cdist-build "$__cdist_target_host"
. cdist-remote-exec "$__cdist_target_host"

19
bin/cdist-explorer-run

@ -21,25 +21,34 @@
. cdist-config
[ "${__cdist_target_host}" ] || __cdist_usage "Need \$__cdist_target_host setup"
set -e
# create basedir
ssh root@${__cdist_target_host} "mkdir -p \"${__cdist_remote_base_dir}\" \
\"${__cdist_remote_cache_dir}\" \"${__cdist_remote_cache_bin}\" \
\"${__cdist_remote_cache_explorer}\""
# Transfer all explorers to the target dir - must be one level above, so
# coyping it multiple times works: a -> remote:/base/ = remote:/base/a vs.
# a -> remote:/base/a = remote:/base/a/a (second copy)
scp -r "${__cdist_explorer_dir}" \
"root@${__cdist_target_host}:${__cdist_remote_cache_dir}"
"root@${__cdist_target_host}:${__cdist_remote_base_dir}"
# Transfer explorer coordinator
scp "$(which cdist-explorer-coordinator)" \
# Transfer cdist binaries - FIXME: should transfer all (needed?) of them!
scp "$(which cdist-explorer-coordinator)" "$(which cdist-config)" \
"root@${__cdist_target_host}:${__cdist_remote_cache_bin}"
# Execute explorer coordinator, which will save results on target
ssh root@${__cdist_target_host} "\"${__cdist_remote_cache_bin}/cdist-explorer-coordinator\" \
ssh root@${__cdist_target_host} \
"PATH=\"${__cdist_remote_cache_bin}:\$PATH\"
\"${__cdist_remote_cache_bin}/cdist-explorer-coordinator\" \
\"${__cdist_remote_explorer_dir}\" \"${__cdist_remote_cache_explorer}\""
# Transfer back all results
scp -r "root@${__cdist_target_host}:${__cdist_remote_dir}"
# scp -r "root@${__cdist_target_host}:${__cdist_remote_dir}"
exit 0

3
conf/explorers/os

@ -33,3 +33,6 @@ fi
[ -f /etc/debian_version ] && echo debian
[ -f /etc/redhat-release ] && echo redhat
# ensure correct exit, otherwise other explorer won't get started
exit 0

4
conf/explorers/pkg_system

@ -19,7 +19,9 @@
#
#
case "$(__cdist_explorer_dir/os)" in
case "$("${__cdist_remote_explorer_dir}/os")" in
archlinux) echo pacman ;;
debian|ubuntu) echo apt ;;
esac
exit 0

Loading…
Cancel
Save