git_auto_update: Allow reload_command failing during playbook execution

wip
Felix Stupp 5 years ago
parent 67f1e0919e
commit d570f3cdb3
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -20,6 +20,8 @@
command: "{{ update_script_path }}"
args:
creates: "{{ dest }}/.git"
register: update_result
failed_when: update_result.rc not in [0, 2]
- name: Enable auto update of {{ repo_name }}
cron:

@ -22,7 +22,10 @@ TAG=$(git tag --list | grep "^$PREFIX" | sort -r | head -n 1);
if git verify-tag --raw "$TAG" 2>&1 | grep " VALIDSIG $GPG_FINGERPRINT " > /dev/null; then
git checkout -q "$TAG";
chown -R "$DEST_USER:$DEST_GROUP" .;
{{ reload_command | default('') }}
if sh -c {{ reload_command | default('') | quote }}; then
echo "Failed during reload" >&2;
exit 2;
fi
else
echo "Invalid or missing signature for $TAG" >&2;
exit 1;

Loading…
Cancel
Save