Merge pull request #26 from syntaxerrormmm/master
Issue #23: downloading the client repository by init-ansible.sh. Closes #23.
This commit is contained in:
commit
4fc6036eae
@ -1,14 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Fixing base variables.
|
||||
basedir=/var/lib/{{ ansible_local.domain.domainfull }}
|
||||
url=git://{{ ansible_local.domain.serverfqdn }}/client-pull-installation.git
|
||||
branch={{ ansible_local.domain.client_gitbranch }}
|
||||
|
||||
# Creo directory dipendenti
|
||||
echo "$(date --rfc-3339=seconds) Installing bin directory."
|
||||
/usr/bin/install -d -o root -g users /var/lib/{{ ansible_local.domain.domainfull }}/bin
|
||||
/bin/chown -R root:users /var/lib/{{ ansible_local.domain.domainfull }}
|
||||
/usr/bin/install -d -o root -g users ${basedir}/bin
|
||||
|
||||
# Workaround issue #23 - ansible-pull won't pull out of remote the first time.
|
||||
if [[ ! -f ${basedir}/config/local.yml ]]; then
|
||||
/usr/bin/git clone -b ${branch} ${url} ${basedir}/config
|
||||
fi
|
||||
|
||||
# Installo ansible-pull.sh
|
||||
echo "$(date --rfc-3339=seconds) Creating ansible-pull.sh."
|
||||
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/ansible-pull.sh -O /var/lib/{{ ansible_local.domain.domainfull }}/bin/ansible-pull.sh
|
||||
chmod a+x /var/lib/{{ ansible_local.domain.domainfull }}/bin/ansible-pull.sh
|
||||
/usr/bin/wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/ansible-pull.sh -O ${basedir}/bin/ansible-pull.sh
|
||||
chmod a+x ${basedir}/bin/ansible-pull.sh
|
||||
|
||||
# Fixing permissions on the main directory
|
||||
/bin/chown -R root:users ${basedir}
|
||||
|
||||
# Installo il cronjob per ansible-pull
|
||||
echo "$(date --rfc-3339=seconds) Creating crontab"
|
||||
|
Loading…
x
Reference in New Issue
Block a user