Strumenti Utente

Strumenti Sito


script

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
script [2019/07/09 12:33] – [PBIS (new)] continuati aggiornamenti per Debian 10; permessa installazione di sistemi non joinati con nome qualsiasi diego.zuccato@unibo.itscript [2024/12/24 10:09] (versione attuale) – aggiornata OU mario.petroli@unibo.it
Linea 5: Linea 5:
 Per prelevare direttamente uno degli script senza aprire il browser, usare Per prelevare direttamente uno degli script senza aprire il browser, usare
   wget http://apps.difa.unibo.it/wiki/_export/code/script?codeblock=N -O inst.sh   wget http://apps.difa.unibo.it/wiki/_export/code/script?codeblock=N -O inst.sh
-con N da (rispettivamente Ubuntu, Debian-pbis, Debian-winbind).+con N da (rispettivamente Ubuntu, Debian-pbis, Debian-winbind). 
 + 
 +Per l'installazione dei lab, conviene creare uno script **prepare.sh** su chiavetta contenente 
 +  #!/bin/bash 
 +  export myADUser=nome.cognome 
 +  wget http://apps.difa.unibo.it/wiki/_export/code/script?codeblock=0 -O /home/tecnici/preinst.sh 
 +  sudo bash /home/tecnici/preinst.sh 
 +Ovviamente va cambiato nome.cognome col proprio UPN AD (può essere diverso dalla mail senza dominio, p.e. m.bertelli@unibo.it deve usare michele.bertelli2). 
 + 
 +Quando si entra come tecnici, si inserisce la chiavetta (che viene montata automaticamente) e si lancia 
 +  bash /media/*/*/prepare.sh 
 + 
 +Lo script che viene scaricato ed eseguito è: 
 +<code bash preinst.sh> 
 +#!/bin/bash 
 +##### 
 +# Preparazione per installazione laboratorio 
 +# File release: 20210729 
 +if [ -z "$1" ]; then 
 +    echo -n "Laboratorio (i=Irnerio, nav=Navile) ? " 
 +    read L 
 +else 
 +    L=$1 
 +fi 
 + 
 +if [ -z "$2" ]; then 
 +    echo -n "Numero macchina ? " 
 +    read N 
 +else 
 +    N=$2 
 +fi 
 + 
 +sudo sed -i~ "s/LAB-GEN/${L}-${N}/" /etc/host{s,name} 
 +sudo nmcli c m "Connessione via cavo 1" 802-3.wake-on-lan magic 
 +sudo dpkg-reconfigure openssh-server 
 +sudo apt update 
 +wget http://apps.difa.unibo.it/wiki/_export/code/script?codeblock=1 -O /home/tecnici/inst.sh 
 +sed -i~ "s/=diego.zuccato/=$myADUser/" /home/tecnici/inst.sh 
 +sudo shutdown -r now 
 +</code>
  
 ===== Ubuntu ===== ===== Ubuntu =====
Linea 13: Linea 52:
 ##### #####
 # Script di installazione per Ubuntu. # Script di installazione per Ubuntu.
-# Versione del 05/06/2019+# Versione 20210729
  
 ############################################################ ############################################################
Linea 24: Linea 63:
  
 # Base OU in AD # Base OU in AD
-AD_OU='dsa.auto/str00957-difa/computer'+AD_OU='dsa.auto/Dip-DIFA/computer'
  
 # Pacchetti base, da installare sempre # Pacchetti base, da installare sempre
Linea 62: Linea 101:
 if [ -z "$PCID" ]; then if [ -z "$PCID" ]; then
     echo "Hostname errato! Deve iniziare con 'str957-'"     echo "Hostname errato! Deve iniziare con 'str957-'"
 +    exit
 +fi
 +
 +if [ "LAB-GEN" == "$PCID" ]; then
 +    echo "Fase di personalizzazione dell'installazione non corretta: controlla l'hostname!"
     exit     exit
 fi fi
Linea 100: Linea 144:
         "nav")         "nav")
             AD_OU="${AD_OU}/navile"             AD_OU="${AD_OU}/navile"
 +            SRV_LAB="srv-lab-m"
      useradd -G root -m -U cesia      useradd -G root -m -U cesia
      echo "Imposta password per utente cesia"      echo "Imposta password per utente cesia"
Linea 106: Linea 151:
      mkdir /home/PERSONALE      mkdir /home/PERSONALE
      mkdir /home/STUDENTI      mkdir /home/STUDENTI
-            echo "137.204.136.100 serverlab" >> /etc/hosts +            echo "137.204.136.90 ${SRV_LAB}" >> /etc/hosts 
-     echo "serverlab:/home/PERSONALE/ /home/PERSONALE nfs rsize=8192,wsize=8192,nosuid,soft,vers=3,_netdev 0 0" >>/etc/fstab +            echo "${SRV_LAB}:homes /home glusterfs defaults,_netdev 0 0" >>/etc/fstab
-     echo "serverlab:/home/STUDENTI/ /home/STUDENTI nfs rsize=8192,wsize=8192,nosuid,soft,vers=3,_netdev 0 0" >>/etc/fstab+
      SM_INST="y"      SM_INST="y"
      
Linea 115: Linea 159:
             cp /home/PERSONALE/_LIB/IRAF/iraf64.tar.gz /home             cp /home/PERSONALE/_LIB/IRAF/iraf64.tar.gz /home
             /home/PERSONALE/_LIB/IRAF/deploy.sh             /home/PERSONALE/_LIB/IRAF/deploy.sh
- 
      ;;      ;;
         "i")         "i")
             AD_OU="${AD_OU}/irnerio"             AD_OU="${AD_OU}/irnerio"
 +            SRV_LAB="srv-labirnerio"
             useradd -G root -m -U cesia             useradd -G root -m -U cesia
      mkdir /home/PERSONALE      mkdir /home/PERSONALE
      mkdir /home/STUDENTI      mkdir /home/STUDENTI
             # IP esterno del server 137.204.248.241             # IP esterno del server 137.204.248.241
-            echo "10.10.10.241 srv-labirnerio" >> /etc/hosts +            echo "10.10.10.241 ${SRV_LAB}" >> /etc/hosts 
-            #echo "srv-labirnerio:/srv/nfs/homes/ /home nfs rsize=8192,wsize=8192,nosuid,soft,vers=3 0 0" >>/etc/fstab +            echo "${SRV_LAB}:home-personale /home/PERSONALE glusterfs defaults,_netdev 0 0" >>/etc/fstab 
-            echo "srv-labirnerio:home-personale /home/PERSONALE glusterfs defaults,_netdev 0 0" >>/etc/fstab +            echo "${SRV_LAB}:home-studenti /home/STUDENTI glusterfs defaults,_netdev 0 0" >>/etc/fstab
-            echo "srv-labirnerio:home-studenti /home/STUDENTI glusterfs defaults,_netdev 0 0" >>/etc/fstab+
             ;;             ;;
         "*")         "*")
Linea 227: Linea 270:
  
 if [ -f /etc/default/epoptes-client ]; then if [ -f /etc/default/epoptes-client ]; then
-    echo "SERVER=srv-labirnerio" >> /etc/default/epoptes-client+    echo "SERVER=${SRV_LAB}" >> /etc/default/epoptes-client
     epoptes-client -c     epoptes-client -c
 fi fi
Linea 233: Linea 276:
 # Aggiornamento completo del sistema # Aggiornamento completo del sistema
 apt-get -qy dist-upgrade apt-get -qy dist-upgrade
-shutdown -now+shutdown -now
 </code> </code>
  
Linea 260: Linea 303:
  
 # Base OU in AD # Base OU in AD
-AD_OU='dsa.auto/str00957-difa/computer/server'+AD_OU='dsa.auto/Dip-DIFA/computer/server'
  
 # Pacchetti base, da installare sempre # Pacchetti base, da installare sempre
Linea 386: Linea 429:
    
 # Base OU in AD # Base OU in AD
-AD_OU='Dsa.Auto/Str00957-DIFA/Computer/Server'+AD_OU='Dsa.Auto/Dip-DIFA/Computer/Server'
    
 # Pacchetti base, da installare sempre # Pacchetti base, da installare sempre
script.1562675604.txt.gz · Ultima modifica: 2019/07/09 12:33 da diego.zuccato@unibo.it

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki