switching vps to be the icinga master
This commit is contained in:
25
icinga2/files/git_clone_icinga2_conf.sh
Normal file
25
icinga2/files/git_clone_icinga2_conf.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user