forked from ungleich-public/cdist
++__cdist_echo ++todo
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
4a7c6c2738
commit
35d4760c13
|
@ -27,9 +27,9 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
__cdist_target_host="$1"; shift
|
__cdist_target_host="$1"; shift
|
||||||
__cdist_object="$1"; shift
|
__cdist_object_self="$1"; shift
|
||||||
|
|
||||||
echo "Transferring object $__cdist_object to $__cdist_target_host ..."
|
__cdist_echo info "Transferring object $__cdist_target_host ..."
|
||||||
cdist-dir push "$__cdist_target_host" \
|
cdist-dir push "$__cdist_target_host" \
|
||||||
"$(__cdist_object_dir "$__cdist_object")" \
|
"$(__cdist_object_dir "$__cdist_object_self")" \
|
||||||
"$(__cdist_remote_object_dir "$__cdist_object")"
|
"$(__cdist_remote_object_dir "$__cdist_object_self")"
|
||||||
|
|
|
@ -32,17 +32,17 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
__cdist_target_host="$1"; shift
|
__cdist_target_host="$1"; shift
|
||||||
__cdist_object="$1"; shift
|
__cdist_object_self="$1"; shift
|
||||||
__cdist_object_dir="$(__cdist_object_dir "$__cdist_object")"
|
__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")"
|
||||||
[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Requested object is not defined: $__cdist_object"
|
[ -d "$__cdist_object_dir" ] || __cdist_exit_err "Object undefined"
|
||||||
|
|
||||||
# Export to non-core for use in manifest and gencode scripts
|
# Export to non-core for use in manifest and gencode scripts
|
||||||
export $__cdist_name_var_self=$__cdist_object
|
export $__cdist_name_var_self=$__cdist_object_self
|
||||||
|
|
||||||
__cdist_object_finished="$(__cdist_object_finished "$__cdist_object")"
|
__cdist_object_finished="$(__cdist_object_finished "$__cdist_object_self")"
|
||||||
if [ ! -f "$__cdist_object_finished" ]; then
|
if [ ! -f "$__cdist_object_finished" ]; then
|
||||||
# Resolve dependencies, if any
|
# Resolve dependencies, if any
|
||||||
__cdist_object_require="$(__cdist_object_require "$__cdist_object")"
|
__cdist_object_require="$(__cdist_object_require "$__cdist_object_self")"
|
||||||
if [ -f "$__cdist_object_require" ]; then
|
if [ -f "$__cdist_object_require" ]; then
|
||||||
echo
|
echo
|
||||||
# NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP
|
# NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP
|
||||||
|
@ -52,13 +52,11 @@ if [ ! -f "$__cdist_object_finished" ]; then
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
__cdist_requirement="$1"; shift
|
__cdist_requirement="$1"; shift
|
||||||
echo "Resolving dependency $__cdist_requirement for $__cdist_object ..."
|
echo "Resolving dependency $__cdist_requirement"
|
||||||
cdist-object-run "$__cdist_target_host" "$__cdist_requirement"
|
cdist-object-run "$__cdist_target_host" "$__cdist_requirement"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
|
||||||
echo "Running object $__cdist_object"
|
|
||||||
cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object"
|
cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object"
|
||||||
cdist-object-push "$__cdist_target_host" "$__cdist_object"
|
cdist-object-push "$__cdist_target_host" "$__cdist_object"
|
||||||
cdist-object-code-run "$__cdist_target_host" "$__cdist_object"
|
cdist-object-code-run "$__cdist_target_host" "$__cdist_object"
|
||||||
|
|
|
@ -5,6 +5,8 @@ Feel free to pick one!
|
||||||
|
|
||||||
CORE
|
CORE
|
||||||
----
|
----
|
||||||
|
- Inconsistent error messages if object is not existing!
|
||||||
|
-> always use "Object undefined"
|
||||||
- Add echo function / beautify output
|
- Add echo function / beautify output
|
||||||
__cdist_echo [level] [messages...]
|
__cdist_echo [level] [messages...]
|
||||||
level := syslog alike:
|
level := syslog alike:
|
||||||
|
|
Loading…
Reference in a new issue