begin cdist-object-explorer-all

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-23 00:19:16 +01:00
parent 2c5356ba9c
commit 391b5d7dc0

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# 2010 Nico Schottelius (nico-cdist at schottelius.org) # 2011 Nico Schottelius (nico-cdist at schottelius.org)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -18,26 +18,33 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>. # along with cdist. If not, see <http://www.gnu.org/licenses/>.
# #
# #
# For each created object create the code to be executed on the # For each created object check the explorers and run them if needed.
# target.
# #
. cdist-config . cdist-config
[ $# -eq 2 ] || __cdist_usage "<target host> <object_base_dir>"
if [ $# -ne 3 ]; then
__cdist_usage "<target host> <object_base_dir> <outdir>"
fi
set -eu set -eu
__cdist_target_host="$1"; shift __cdist_target_host="$1"; shift
__cdist_object_base_dir="$1"; shift __cdist_object_base_dir="$1"; shift
__cdist_exec_dir="$1"; shift
__cdist_object_list "$__cdist_object_base_dir" > "$__cdist_tmp_file" __cdist_object_list "$__cdist_object_base_dir" > "$__cdist_tmp_file"
# need to create pseudo array, as ssh will destroy while-read loops
while read object; do while read object; do
outdir="$__cdist_exec_dir/${object}" set -- "$@" "$object"
done < "$__cdist_tmp_file"
while [ $# -gt 0 ]; do
object="$1"; shift
type=$(__cdist_type_from_object "$object")
local_src_dir="$__cdist_object_base_dir/${object}/${__cdist_name_explorer}"
local_dst_dir="$__cdist_object_base_dir/${object}/${__cdist_name_explorer}"
# FIXME: stopped here
cdist-explorer-run "$__cdist_target_host"
outfile="${outdir}/${__cdist_name_exec}" outfile="${outdir}/${__cdist_name_exec}"
mkdir -p "${outdir}" mkdir -p "${outdir}"