forked from ungleich-public/cdist
in theory finish bin/cdist-object-explorer-all
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
b782f56594
commit
9761239f6c
1 changed files with 14 additions and 12 deletions
|
@ -30,7 +30,7 @@ __cdist_object_base_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
|
# need to create pseudo array, as ssh in cdist-explorer-run will destroy while-read loops
|
||||||
while read object; do
|
while read object; do
|
||||||
set -- "$@" "$object"
|
set -- "$@" "$object"
|
||||||
done < "$__cdist_tmp_file"
|
done < "$__cdist_tmp_file"
|
||||||
|
@ -39,19 +39,21 @@ while [ $# -gt 0 ]; do
|
||||||
object="$1"; shift
|
object="$1"; shift
|
||||||
type=$(__cdist_type_from_object "$object")
|
type=$(__cdist_type_from_object "$object")
|
||||||
|
|
||||||
local_src_dir="$__cdist_object_base_dir/${object}/${__cdist_name_explorer}"
|
local_src_dir="$(__cdist_type_explorer_dir "$type")"
|
||||||
local_dst_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"
|
remote_src_dir="$__cdist_remote_cache_dir/$__cdist_name_type/$type/$__cdist_name_explorer"
|
||||||
|
remote_dst_dir="$__cdist_remote_cache_dir/$__cdist_name_object/$object/$__cdist_name_explorer"
|
||||||
|
|
||||||
outfile="${outdir}/${__cdist_name_exec}"
|
if [ -d "$local_src_dir" ]; then
|
||||||
|
num="$(ls -1 "$local_src_dir" | wc -l)"
|
||||||
|
|
||||||
mkdir -p "${outdir}"
|
# Skip if there is not at least one explorer
|
||||||
|
if [ "$num" -lt 1 ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
cdist-object-codegen "$__cdist_target_host" \
|
cdist-explorer-run "$__cdist_target_host" \
|
||||||
"$__cdist_object_base_dir" \
|
"$local_src_dir" "$local_dst_dir" "$remote_src_dir" "$remote_dst_dir"
|
||||||
"$object" > "${outfile}"
|
fi
|
||||||
|
done
|
||||||
chmod u+x "${outfile}"
|
|
||||||
done < "$__cdist_tmp_file"
|
|
||||||
|
|
Loading…
Reference in a new issue