Adding some debug information.

This commit is contained in:
Emiliano Vavassori 2015-10-11 02:09:06 +02:00
parent 12b06745ac
commit dffa6108e1
2 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash
# Aggiorna crontab e logrotate forzosamente.
echo "$(date --rfc-3339=seconds) Loading and running init-ansible.sh"
/usr/bin/curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/init-ansible.sh | /bin/bash
# Script provvisorio.
@ -13,7 +14,9 @@ logfile=/var/lib/ansible-pull.log
branch=master
playbook=local.yml
echo "$(date --rfc-3339=seconds) Getting vault password"
vaultpassfile=$(/usr/bin/curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/getvaultpass.py | /usr/bin/python)
echo "$(date --rfc-3339=seconds) Running ansible-pull"
/usr/bin/ansible-pull --accept-host-key -d "${repo}" -U "${url}" -C "${branch}" "${playbook}" --vault-password-file "${vaultpassfile}" $@
rm -f "${vaultpassfile}"

View File

@ -1,15 +1,18 @@
#!/bin/bash
# Creo directory dipendenti
echo "$(date --rfc-3339=seconds) Installing config directory"
/usr/bin/install -d -o root -g users /var/lib/{{ ansible_local.domain.domainfull }}/config
/bin/chown -R root:users /var/lib/{{ ansible_local.domain.domainfull }}
# Installo il cronjob per ansible-pull
echo "$(date --rfc-3339=seconds) Creating crontab"
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/crontab -O /etc/cron.d/ansible-pull
/bin/chown root:root /etc/cron.d/ansible-pull
/bin/chmod 0644 /etc/cron.d/ansible-pull
# Installo il logrotate per ansible
echo "$(date --rfc-3339=seconds) Creating logrotate"
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/logrotate -O /etc/logrotate.d/ansible-pull
/bin/chown root:root /etc/logrotate.d/ansible-pull
/bin/chmod 0644 /etc/logrotate.d/ansible-pull