Gestita configurazione client con script post-ks.sh. Aggiustato il tiro per installare il minimo indispensabile e una versione di ansible sufficientemente aggiornata.

This commit is contained in:
Emiliano Vavassori 2015-07-07 01:37:47 +02:00
parent 6f238cfa32
commit 3a2533a948
3 changed files with 25 additions and 7 deletions

View File

@ -128,6 +128,7 @@
- client-trusty.cfg
- docenti-trusty.cfg
- ubuntu-trusty.cfg
- post-ks.sh
- name: Ripristino impostazioni mirrorpath
set_fact: mirrorpath="{{ oldmirrorpath }}"

View File

@ -42,16 +42,21 @@ skipx
services --enabled=openssh
#Install packages
%packages
@ ubuntu-desktop
@ edubuntu-desktop
@ ubuntu-edu-secondary
vim
screen
cifs-utils
curl
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://{{ serverfqdn }}:3000/whatsmyhostname)
echo $TARGETHOSTNAME > /target/etc/hostname
sed -i "s/kickseed/$TARGETHOSTNAME/g" /target/etc/hosts
\curl -sSL http://{{ serverfqdn }}/ks/post-ks.sh | bash

View File

@ -0,0 +1,12 @@
#!/bin/bash
# Cambio username con quello fornito da servizio
TARGETHOSTNAME=$(wget -qO- http://{{ serverfqdn }}:3000/whatsmyhostname)
echo $TARGETHOSTNAME > /etc/hostname
sed -i "s/kickseed/$TARGETHOSTNAME/g" /etc/hosts
# Installo l'ultimo ansible per ansible-pull
export https_proxy=https://{{ serverip }}:3128
add-apt-repository -y ppa:ansible/ansible
apt-get update && apt-get install -y ansible
unset https_proxy