Requesting doraemon version 1.1.1. Correctly managing client/docenti configuration.

This commit is contained in:
Emiliano Vavassori 2015-09-07 22:06:17 +02:00
parent f6c8b3a4d2
commit 7f801d207c
6 changed files with 55 additions and 10 deletions

View File

@ -1,2 +1,2 @@
---
doraemon_version: 1.1.0-1
doraemon_version: 1.1.1-1

View File

@ -48,5 +48,8 @@
- docenti-trusty.cfg
- name: Copia configurazioni kickstart
template: src=post-ks.sh dest=/var/lib/nethserver/ibay/ks/post-ks.sh
template: src="post-{{ item }}-ks.sh" "dest=/var/lib/nethserver/ibay/ks/post-{{ item }}-ks.sh"
with_items:
- client
- docenti
sudo: yes

View File

@ -0,0 +1,35 @@
#!/bin/bash
# Cambio username con quello fornito da servizio
TARGETHOSTNAME=$(wget -qO- http://{{ ansible_local.domain.serverfqdn }}:3000/whatsmyhostname?role=docenti)
echo $TARGETHOSTNAME > /etc/hostname
sed -i "s/kickseed/$TARGETHOSTNAME/g" /etc/hosts
# Installo l'ultimo ansible per ansible-pull
export https_proxy=https://{{ ansible_local.domain.serverip }}:3128
add-apt-repository -y ppa:ansible/ansible
apt-get update && apt-get install -y ansible
unset https_proxy
# Creo directory dipendenti
install -d -o root -g root /var/lib/{{ ansible_local.domain.domainfull }}/config
install -d -o root -g root /var/lib/{{ ansible_local.domain.domainfull }}/bin
# Installo lo script per la decrittazione della password del vault
wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/getvaultpass.py -O /tmp/getvaultpass.py
install -m744 -o root -g root /tmp/getvaultpass.py /var/lib/{{ ansible_local.domain.domainfull}}/bin/getvaultpass.py
rm -f /tmp/getvaultpass.py
# Installo lo script per l'avvio di ansible-pull da root
wget -q http://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/run.sh -O /tmp/ansible-pull.sh
install -m744 -o root -g root /tmp/ansible-pull.sh /var/lib/{{ ansible_local.domain.domainfull }}/bin/ansible-pull.sh
rm -f /tmp/ansible-pull.sh
# Installo il cronjob
wget -q http://{{ ansible_local.domain.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://{{ ansible_local.domain.serverfqdn }}/ks/ansible-pull/logrotate -O /tmp/ansible-pull-logrotate
install -m644 -o root -g root /tmp/ansible-pull-logrotate /etc/logrotate.d/ansible
rm -f /tmp/ansible-pull-logrotate

View File

@ -66,4 +66,4 @@ sshpass
#Post installation commands
%post
#the target filesystem in nochroot environment is in /target
\curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/post-ks.sh | bash >/root/post-ks.log 2>&1
\curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/post-client-ks.sh | bash >/root/post-ks.log 2>&1

View File

@ -47,16 +47,23 @@ skipx
services --enabled=openssh
#Install packages
%packages
@ ubuntu-desktop
@ edubuntu-desktop
@ ubuntu-edu-secondary
dialog
vim
screen
cifs-utils
curl
git
openssh-server
software-properties-common
libyaml-0-2
python-jinja2
python-markupsafe
python-paramiko
python-support
python-yaml
python-crypto
sshpass
#Post installation commands
%post --nochroot
%post
#the target filesystem in nochroot environment is in /target
TARGETHOSTNAME=$(wget -qO- http://{{ ansible_local.domain.serverfqdn }}:3000/whatsmyhostname)
echo $TARGETHOSTNAME > /target/etc/hostname
sed -i "s/kickseed/$TARGETHOSTNAME/g" /target/etc/hosts
\curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/post-docenti-ks.sh | bash >/root/post-ks.log 2>&1