mirror of
https://github.com/lloeki/apply.git
synced 2025-12-06 09:24:38 +01:00
Implement a basic 'facts' system
This commit is contained in:
parent
a243a9a9c0
commit
d77a87fb9e
2 changed files with 12 additions and 1 deletions
11
push
11
push
|
|
@ -41,5 +41,16 @@ if scp -q -r "${APPLY_ROOT}"/{groups,units} run lib "$remote":"$tmp"; then
|
||||||
echo -e " \033[32mOK\033[0m"
|
echo -e " \033[32mOK\033[0m"
|
||||||
fi
|
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
|
# shellcheck disable=SC2029
|
||||||
ssh "$remote" "cd '$tmp' && ./run $vflag ${targets[*]} && cd; rm -rf '$tmp'"
|
ssh "$remote" "cd '$tmp' && ./run $vflag ${targets[*]} && cd; rm -rf '$tmp'"
|
||||||
|
|
|
||||||
2
run
2
run
|
|
@ -53,7 +53,7 @@ run_group() {
|
||||||
}
|
}
|
||||||
|
|
||||||
run_unit() {
|
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() {
|
log_file() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue