forked from LibreSchool/server-config
Adding some debug information.
This commit is contained in:
parent
12b06745ac
commit
dffa6108e1
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Aggiorna crontab e logrotate forzosamente.
|
# 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
|
/usr/bin/curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/init-ansible.sh | /bin/bash
|
||||||
|
|
||||||
# Script provvisorio.
|
# Script provvisorio.
|
||||||
@ -13,7 +14,9 @@ logfile=/var/lib/ansible-pull.log
|
|||||||
branch=master
|
branch=master
|
||||||
playbook=local.yml
|
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)
|
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}" $@
|
/usr/bin/ansible-pull --accept-host-key -d "${repo}" -U "${url}" -C "${branch}" "${playbook}" --vault-password-file "${vaultpassfile}" $@
|
||||||
rm -f "${vaultpassfile}"
|
rm -f "${vaultpassfile}"
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Creo directory dipendenti
|
# 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
|
/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 }}
|
/bin/chown -R root:users /var/lib/{{ ansible_local.domain.domainfull }}
|
||||||
|
|
||||||
# Installo il cronjob per ansible-pull
|
# 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
|
/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/chown root:root /etc/cron.d/ansible-pull
|
||||||
/bin/chmod 0644 /etc/cron.d/ansible-pull
|
/bin/chmod 0644 /etc/cron.d/ansible-pull
|
||||||
|
|
||||||
# Installo il logrotate per ansible
|
# 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
|
/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/chown root:root /etc/logrotate.d/ansible-pull
|
||||||
/bin/chmod 0644 /etc/logrotate.d/ansible-pull
|
/bin/chmod 0644 /etc/logrotate.d/ansible-pull
|
||||||
|
Loading…
x
Reference in New Issue
Block a user