#!/bin/bash {# code: lang=jinja-shell #} if ! id icinga &>/dev/null; then echo icinga user is missing exit 1 fi if [ -d /etc/icinga2/.git ]; then echo already cloned exit 1 fi # show commands executed set -x # exit on errors set -e rm -rf /etc/icinga2 cd /etc/ git clone '{{ salt.pillar.get('icinga2:server:conf_git_url') }}' icinga2 chown -R icinga.icinga /etc/icinga2