diff --git a/push b/push index f27224d..e15c493 100755 --- a/push +++ b/push @@ -41,5 +41,16 @@ if scp -q -r "${APPLY_ROOT}"/{groups,units} run lib "$remote":"$tmp"; then echo -e " \033[32mOK\033[0m" fi +factfile="$APPLY_ROOT/facts/$remote" +if [[ -f "$factfile" ]]; then + if [[ -n "${vflag:-}" ]]; then + echo -e -n "\033[33m** pushing facts to\033[0m $remote:$tmp" + fi + + if scp -q -r "$factfile" "$remote:$tmp/facts"; then + echo -e " \033[32mOK\033[0m" + fi +fi + # shellcheck disable=SC2029 ssh "$remote" "cd '$tmp' && ./run $vflag ${targets[*]} && cd; rm -rf '$tmp'" diff --git a/run b/run index 047494d..25c1f9f 100755 --- a/run +++ b/run @@ -53,7 +53,7 @@ run_group() { } run_unit() { - /bin/sh -l -c "set -e; set -u; set -o pipefail; . ./lib; . '$(root_path)/$*'" + /bin/sh -l -c "set -e; set -u; set -o pipefail; . ./lib; test -f facts && . ./facts; . '$(root_path)/$*'" } log_file() {