Files
salt-states/icinga2/files/git_clone_icinga2_conf.sh

26 lines
385 B
Bash

#!/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