forked from LibreSchool/server-config
23 lines
1002 B
Bash
23 lines
1002 B
Bash
#!/bin/bash
|
|
|
|
# Aggiorna crontab e logrotate forzosamente.
|
|
echo "$(date --rfc-3339=seconds) Loading and running init-ansible.sh"
|
|
/usr/bin/curl -sSL4 http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/init-ansible.sh | /bin/bash
|
|
|
|
# Script provvisorio.
|
|
# Potremmo decidere di far eseguire uno script generato da servizio
|
|
# domainhelper contenente anche l'eventuale branch da usare.
|
|
|
|
url=git://{{ ansible_local.domain.serverfqdn }}/client-pull-installation.git
|
|
repo=/var/lib/{{ ansible_local.domain.domainfull }}/config
|
|
logfile=/var/lib/ansible-pull.log
|
|
branch=master
|
|
playbook=local.yml
|
|
|
|
echo "$(date --rfc-3339=seconds) Getting vault password"
|
|
vaultpassfile=$(/usr/bin/curl -sSL4 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}"
|