Requesting doraemon version 1.1.1. Correctly managing client/docenti configuration.
This commit is contained in:
parent
f6c8b3a4d2
commit
7f801d207c
@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
doraemon_version: 1.1.0-1
|
doraemon_version: 1.1.1-1
|
||||||
|
@ -48,5 +48,8 @@
|
|||||||
- docenti-trusty.cfg
|
- docenti-trusty.cfg
|
||||||
|
|
||||||
- name: Copia configurazioni kickstart
|
- 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
|
sudo: yes
|
||||||
|
35
roles/kickstart/templates/post-docenti-ks.sh
Normal file
35
roles/kickstart/templates/post-docenti-ks.sh
Normal 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
|
@ -66,4 +66,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://{{ 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
|
||||||
|
@ -47,16 +47,23 @@ skipx
|
|||||||
services --enabled=openssh
|
services --enabled=openssh
|
||||||
#Install packages
|
#Install packages
|
||||||
%packages
|
%packages
|
||||||
@ ubuntu-desktop
|
dialog
|
||||||
@ edubuntu-desktop
|
|
||||||
@ ubuntu-edu-secondary
|
|
||||||
vim
|
vim
|
||||||
screen
|
screen
|
||||||
cifs-utils
|
cifs-utils
|
||||||
|
curl
|
||||||
|
git
|
||||||
openssh-server
|
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 installation commands
|
||||||
%post --nochroot
|
%post
|
||||||
#the target filesystem in nochroot environment is in /target
|
#the target filesystem in nochroot environment is in /target
|
||||||
TARGETHOSTNAME=$(wget -qO- http://{{ ansible_local.domain.serverfqdn }}:3000/whatsmyhostname)
|
\curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/post-docenti-ks.sh | bash >/root/post-ks.log 2>&1
|
||||||
echo $TARGETHOSTNAME > /target/etc/hostname
|
|
||||||
sed -i "s/kickseed/$TARGETHOSTNAME/g" /target/etc/hosts
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user