Aggiunta configurazione PXE + Kickstart.

This commit is contained in:
Emiliano Vavassori 2015-06-12 23:54:15 +02:00
parent c453aa9c8e
commit 00b45b5f16
9 changed files with 298 additions and 2 deletions

View File

@ -23,8 +23,8 @@ lanciare i seguenti comandi:
### To Do List ###
* Implementare PXE + Kickstart + preseed
* Implementare backup
* Implementare PXE + Kickstart (manca test)
* Implementare configurazioni per repo Ubuntu
* Implementare configurazioni generiche dominio server
* Implementare aggiornamento automatico del sistema via `ansible`
* Implementare backup

BIN
roles/pxe/files/bglug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

141
roles/pxe/tasks/main.yml Normal file
View File

@ -0,0 +1,141 @@
---
# Configurazione dell'ambiente di boot via rete per i client
- name: Verifica configurazione tftp
shell: /sbin/e-smith/db configuration getprop dnsmasq dhcp-boot
register: chk_tftp_enabled
ignore_errors: yes
sudo: yes
- name: Configuro tftp
shell: /sbin/e-smith/db configuration setprop dnsmasq tftp-status enabled dhcp-boot pxelinux.0
when: chk_tftp_enabled|failed
sudo: yes
- name: Attivo tftp
shell: /sbin/e-smith/signal-event nethserver-dnsmasq-save
when: chk_tftp_enabled|failed
sudo: yes
- name: Verifica configurazione ibay kickstart
shell: /sbin/e-smith/db accounts get ks
register: chk_ks_created
ignore_errors: yes
sudo: yes
- name: Configurazione web kickstart
shell: /sbin/e-smith/db accounts set ks ibay Description "Kickstart share" GroupAccess rw HttpAccess private HttpAliasType default HttpAllowOverrideStatus disabled HttpForceSslStatus disabled HttpPasswordStatus disabled HttpStatus enabled HttpVirtualHost __ANY__ OtherAccess r OwningGroup locals SmbAuditStatus disabled SmbStatus disabled
when: chk_ks_created|failed
sudo: yes
- name: Attivazione web kickstart
shell: /sbin/e-smith/signal-event ibay-create ks
when: chk_ks_created|failed
sudo: yes
- name: Verifica configurazione ibay ubuntu
shell: /sbin/e-smith/db accounts get ubuntu
register: chk_ubuntu_created
ignore_errors: yes
sudo: yes
- name: Configurazione web ubuntu
shell: /sbin/e-smith/db accounts set ubuntu ibay Description "Ubuntu Installation media" GroupAccess rw HttpAccess private HttpAliasType default HttpAllowOverrideStatus disabled HttpForceSslStatus disabled HttpPasswordStatus disabled HttpStatus enabled HttpVirtualHost __ANY__ OtherAccess r OwningGroup locals SmbAuditStatus disabled SmbStatus disabled
when: chk_ubuntu_created|failed
sudo: yes
- name: Attivazione web ubuntu
shell: /sbin/e-smith/signal-event ibay-create ubuntu
when: chk_ubuntu_created|failed
sudo: yes
- name: Creo directory necessarie
file: path={{ item }} state=directory
with_items:
- /var/lib/tftproot/pxelinux.cfg
- /var/lib/tftproot/ubuntu/14.04/i386
- /var/lib/tftproot/ubuntu/14.04/amd64
- /var/lib/tftproot/utils/memtest86
sudo: yes
- name: pxelinux.0
get_url:
url: http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-i386/current/images/netboot/pxelinux.0
dest: /var/lib/tftproot/pxelinux.0
sudo: yes
- name: pxelinux.cfg/default
template: src=pxelinux.cfg/default dest=/var/lib/tftproot/pxelinux.cfg/default
sudo: yes
- name: bglug.png
copy: src=bglug.png dest=/var/lib/tftproot/utils/bglug.png
sudo: yes
- name: vesamenu.c32
get_url:
url: http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-i386/current/images/netboot/ubuntu-installer/i386/boot-screens/vesamenu.c32
dest: /var/lib/tftproot/utils/vesamenu.c32
sudo: yes
- name: linux i386
get_url:
url: http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-i386/current/images/netboot/ubuntu-installer/i386/linux
dest: /var/lib/tftproot/ubuntu/14.04/i386/linux
sudo: yes
- name: initrd.gz i386
get_url:
url: http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-i386/current/images/netboot/ubuntu-installer/i386/initrd.gz
dest: /var/lib/tftproot/ubuntu/14.04/i386/initrd.gz
sudo: yes
- name: linux amd64
get_url:
url: http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux
dest: /var/lib/tftproot/ubuntu/14.04/amd64/linux
sudo: yes
- name: initrd.gz amd64
get_url:
url: http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz
dest: /var/lib/tftproot/ubuntu/14.04/amd64/initrd.gz
sudo: yes
- name: memdisk
get_url:
url: http://syntaxerrormmm.zapto.org/pxe-bootimg/memdisk
dest: /var/lib/tftproot/utils/memdisk
sudo: yes
- name: aida
get_url:
url: http://syntaxerrormmm.zapto.org/pxe-bootimg/aida.img
dest: /var/lib/tftproot/utils/aida.img
sudo: yes
- name: memtest86
get_url:
url: http://syntaxerrormmm.zapto.org/pxe-bootimg/memtest86/vmlinuz
dest: /var/lib/tftproot/utils/memtest86/vmlinuz
sudo: yes
- name: hdt
get_url:
url: http://syntaxerrormmm.zapto.org/pxe-bootimg/hdt.img
dest: /var/lib/tftproot/utils/hdt.img
sudo: yes
- name: ranish
get_url:
url: http://syntaxerrormmm.zapto.org/pxe-bootimg/ranish.img
dest: /var/lib/tftproot/utils/ranish.img
sudo: yes
- name: Copia configurazione kickstart - Edubuntu
template: src=ks/edubuntu-trusty.cfg dest=/var/lib/nethserver/ibay/ks/edubuntu-trusty.cfg
sudo: yes
- name: Copia configurazione kickstart - Ubuntu
template: src=ks/ubuntu-trusty.cfg dest=/var/lib/nethserver/ibay/ks/ubuntu-trusty.cfg
sudo: yes

View File

@ -0,0 +1,48 @@
#System language
lang it_IT
#Language modules to install
langsupport it_IT
#System keyboard
keyboard it
#System mouse
mouse
#System timezone
timezone Europe/Rome
#Root password
rootpw --disabled
#Initial user
user amministratore --fullname "Amministratore" --iscrypted --password $1$R6LPO2tV$0fExeosTwCdod5RgnOtiR1
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
#url --url http://archive.ubuntu.com/ubuntu
url --url http://{{ serverfqdn }}/ubuntu
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part swap --recommended
part / --fstype ext4 --size 1 --grow
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
#Install packages
%packages
edubuntu-desktop
ubuntu-edu-secondary
vim
screen
cifs-utils
openssh-server

View File

@ -0,0 +1,44 @@
#System language
lang it_IT
#Language modules to install
langsupport it_IT
#System keyboard
keyboard it
#System mouse
mouse
#System timezone
timezone Europe/Rome
#Root password
rootpw --disabled
#Initial user
user amministratore --fullname "Amministratore" --iscrypted --password $1$R6LPO2tV$0fExeosTwCdod5RgnOtiR1
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use Web installation
#url --url http://archive.ubuntu.com/ubuntu
url --url http://{{ serverfqdn }}/ubuntu
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part swap --recommended
part / --fstype ext4 --size 1 --grow
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
#Install packages
%packages
@ ubuntu-desktop
openssh-server

View File

@ -0,0 +1,56 @@
UI utils/vesamenu.c32
DEFAULT edu64
TIMEOUT 30
MENU TITLE BgLUG PXE Boot
MENU BACKGROUND utils/bglug.png
LABEL edu64
MENU LABEL Installa Edubuntu a ^64 bit
KERNEL ubuntu/14.04/amd64/linux
APPEND vga=normal initrd=ubuntu/14.04/amd64/initrd.gz ks=http://{{ serverfqdn }}/ks/ubuntu-trusty.cfg -- quiet
LABEL edu32
MENU LABEL Installa Edubuntu a ^32 bit
KERNEL ubuntu/14.04/amd64/linux
APPEND vga=normal initrd=ubuntu/14.04/amd64/initrd.gz ks=http://{{ serverfqdn }}/ks/ubuntu-trusty.cfg -- quiet
MENU SEPARATOR
LABEL local
MENU LABEL Boot from ^local hard drive
LOCALBOOT 0
MENU SEPARATOR
MENU BEGIN
MENU TITLE Utilities
LABEL aida
MENU LABEL ^AIDA - Old Hardware Diagnostic Tool
KERNEL utils/memdisk
INITRD utils/aida.img
APPEND floppy
LABEL hdt
MENU LABEL ^HDT - Hardware Diagnostic Tool
KERNEL utils/memdisk
INITRD utils/hdt.img
APPEND floppy
LABEL memtest
MENU LABEL ^memtest86 - Test della RAM
KERNEL utils/memtest86/vmlinuz
LABEL ranish
MENU LABEL ^Ranish - Partition Management Tool
KERNEL utils/memdisk
APPEND initrd=/utils/ranish.img floppy
MENU SEPARATOR
LABEL return
MENU LABEL ^Torna al menu principale
MENU EXIT
MENU END

View File

@ -5,3 +5,4 @@
- domain.yml
roles:
- setup
- nethcfg

6
sr-pxe.yml Normal file
View File

@ -0,0 +1,6 @@
---
- hosts: server
vars_files:
- domain.yml
roles:
- pxe