forked from ungleich-public/cdist
first generic version working for objects
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
054f23a550
commit
5237bcd5cd
1 changed files with 22 additions and 2 deletions
|
@ -24,24 +24,44 @@
|
||||||
# mark the object as being run
|
# mark the object as being run
|
||||||
# and iterate until all objects are marked being run.
|
# and iterate until all objects are marked being run.
|
||||||
#
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
. cdist-config
|
. cdist-config
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
__cdist_usage "<outdir> <manifest>"
|
__cdist_usage "<outdir> <object_dir>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
__cdist_output_dir="$1"; shift
|
__cdist_output_dir="$1"; shift
|
||||||
__cdist_manifest="$1"; shift
|
__cdist_object_dir="$1"; shift
|
||||||
|
|
||||||
__cdist_object_ran_all=0
|
__cdist_object_ran_all=0
|
||||||
|
|
||||||
while [ "$__cdist_object_ran_all" = 0 ]; do
|
while [ "$__cdist_object_ran_all" = 0 ]; do
|
||||||
|
cd "$__cdist_object_dir"
|
||||||
|
|
||||||
|
# FIXME past 1.0: allow multi level ids (/example/id instead of example_id only)
|
||||||
|
# OUTER LOOP NEEDED IF GOING OVER ALL OBJECTS WITH FIND?
|
||||||
|
for type in *; do
|
||||||
|
cd "$__cdist_object_dir/$type"
|
||||||
|
|
||||||
|
# find all objects (every object has the source recorded)
|
||||||
|
find . -name "$__cdist_object_source" > "$__cdist_tmp_file"
|
||||||
|
|
||||||
|
while read object; do
|
||||||
|
echo "Running object ${type}/${object} ..."
|
||||||
|
done < "$__cdist_tmp_file"
|
||||||
|
done
|
||||||
|
|
||||||
|
# FIXME: abort on real case only :-)
|
||||||
|
__cdist_object_ran_all=1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
# Ensure binaries exist and are up-to-date
|
# Ensure binaries exist and are up-to-date
|
||||||
cdist-build-bin
|
cdist-build-bin
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue