Skip to content

Instantly share code, notes, and snippets.

@stronk7
Last active March 14, 2018 10:42
Show Gist options
  • Save stronk7/bf2cc77a6c5ac8ab05939bca72c64863 to your computer and use it in GitHub Desktop.
Save stronk7/bf2cc77a6c5ac8ab05939bca72c64863 to your computer and use it in GitHub Desktop.
/usr/local/bin/salt-cron.sh:
file.managed:
- user: root
- group: root
- source: salt://system/cron/salt-cron.sh
- mode: 755
/usr/bin/chronic /usr/local/bin/salt-cron.sh | /usr/bib/logger -t salt-cron:
cron.present:
- identifier: SALT
- user: root
- minute: '*/5'
packages.moreutils:
pkg.installed:
- pkgs:
- moreutils
#!/usr/bin/env bash
set -e
set -x
cd /srv/salt
/usr/bin/git fetch --all --prune
/usr/bin/git reset --hard origin/master
/usr/bin/salt-call \
--local \
--log-file-level=info \
--state-output=changes \
--state-verbose=false \
state.apply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment