Aggiustamenti alla partenza da kickstarter: necessario inserire script per l'avvio di ansible-pull, del crontab e del logrotate.
This commit is contained in:
parent
3a2533a948
commit
8e3d941deb
7
roles/pxe/files/ansible-pull-logrotate
Normal file
7
roles/pxe/files/ansible-pull-logrotate
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/var/lib/ansible-pull.log {
|
||||||
|
rotate 7
|
||||||
|
daily
|
||||||
|
compress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
}
|
@ -129,6 +129,12 @@
|
|||||||
- docenti-trusty.cfg
|
- docenti-trusty.cfg
|
||||||
- ubuntu-trusty.cfg
|
- ubuntu-trusty.cfg
|
||||||
- post-ks.sh
|
- post-ks.sh
|
||||||
|
- ansible-pull.sh
|
||||||
|
- ansible-pull-crontab
|
||||||
|
|
||||||
|
- name: Copio logrotate per configurazione pull
|
||||||
|
copy: src=ansible-pull-logrotate dest=/var/lib/nethserver/ibay/ks/ansible-pull-logrotate
|
||||||
|
sudo: yes
|
||||||
|
|
||||||
- name: Ripristino impostazioni mirrorpath
|
- name: Ripristino impostazioni mirrorpath
|
||||||
set_fact: mirrorpath="{{ oldmirrorpath }}"
|
set_fact: mirrorpath="{{ oldmirrorpath }}"
|
||||||
|
1
roles/pxe/templates/ks/ansible-pull-crontab
Normal file
1
roles/pxe/templates/ks/ansible-pull-crontab
Normal file
@ -0,0 +1 @@
|
|||||||
|
@reboot root /var/lib/{{ domainfull }}/bin/ansible-pull.sh >>/var/log/ansible-pull.log 2>&1
|
9
roles/pxe/templates/ks/ansible-pull.sh
Normal file
9
roles/pxe/templates/ks/ansible-pull.sh
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
url=https://github.com/syntaxerrormmm/pulltest.git
|
||||||
|
repo=/var/lib/{{ domainfull }}/config
|
||||||
|
logfile=/var/lib/ansible-pull.log
|
||||||
|
|
||||||
|
export https_proxy=https://{{ serverip }}:3128
|
||||||
|
ansible-pull -d "${repo}" -U "${url}"
|
||||||
|
unset https_proxy
|
@ -46,6 +46,7 @@ vim
|
|||||||
screen
|
screen
|
||||||
cifs-utils
|
cifs-utils
|
||||||
curl
|
curl
|
||||||
|
git
|
||||||
openssh-server
|
openssh-server
|
||||||
software-properties-common
|
software-properties-common
|
||||||
libyaml-0-2
|
libyaml-0-2
|
||||||
@ -59,4 +60,4 @@ sshpass
|
|||||||
#Post installation commands
|
#Post installation commands
|
||||||
%post
|
%post
|
||||||
#the target filesystem in nochroot environment is in /target
|
#the target filesystem in nochroot environment is in /target
|
||||||
\curl -sSL http://{{ serverfqdn }}/ks/post-ks.sh | bash
|
\curl -sSL http://{{ serverfqdn }}/ks/post-ks.sh | bash >/root/post-ks.log 2>&1
|
||||||
|
@ -10,3 +10,21 @@ export https_proxy=https://{{ serverip }}:3128
|
|||||||
add-apt-repository -y ppa:ansible/ansible
|
add-apt-repository -y ppa:ansible/ansible
|
||||||
apt-get update && apt-get install -y ansible
|
apt-get update && apt-get install -y ansible
|
||||||
unset https_proxy
|
unset https_proxy
|
||||||
|
|
||||||
|
# Creo directory dipendenti
|
||||||
|
install -d -o root -g root /var/lib/{{ domainfull }}/config
|
||||||
|
install -d -o root -g root /var/lib/{{ domainfull }}/bin
|
||||||
|
|
||||||
|
# Installo lo script per l'avvio di ansible-pull da root
|
||||||
|
wget -q http://{{ serverfqdn }}/ks/ansible-pull.sh -O /tmp/ansible-pull.sh
|
||||||
|
install -m744 -o root -g root /tmp/ansible-pull.sh /var/lib/{{ domainfull }}/bin/ansible-pull.sh
|
||||||
|
rm -f /tmp/ansible-pull.sh
|
||||||
|
|
||||||
|
# Installo il cronjob
|
||||||
|
wget -q http://{{ serverfqdn }}/ks/ansible-pull-crontab -O /tmp/ansible-pull-crontab
|
||||||
|
install -m644 -o root -g root /tmp/ansible-pull-crontab /etc/cron.d/ansible-pull
|
||||||
|
rm -f /tmp/ansible-pull-crontab
|
||||||
|
# Installo il logrotate
|
||||||
|
wget -q http://{{ serverfqdn }}/ks/ansible-pull-logrotate -O /tmp/ansible-pull-logrotate
|
||||||
|
install -m644 -o root -g root /tmp/ansible-pull-logrotate /etc/logrotate.d/ansible-pull
|
||||||
|
rm -f /tmp/ansible-pull-logrotate
|
||||||
|
Loading…
x
Reference in New Issue
Block a user