From 23e53a5f4c886b673d9795734c56a92099715f02 Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 9 Jun 2020 11:33:55 +0200 Subject: #983: Updating release Vagrantfile. --- installer/vagrant/Vagrantfile-1.1.1b-vbox | 172 ------------------------------ installer/vagrant/Vagrantfile-1.1.1c-vbox | 172 ++++++++++++++++++++++++++++++ installer/vagrant/Vagrantfile-prod-vbox | 2 +- 3 files changed, 173 insertions(+), 173 deletions(-) delete mode 100644 installer/vagrant/Vagrantfile-1.1.1b-vbox create mode 100644 installer/vagrant/Vagrantfile-1.1.1c-vbox diff --git a/installer/vagrant/Vagrantfile-1.1.1b-vbox b/installer/vagrant/Vagrantfile-1.1.1b-vbox deleted file mode 100644 index 7db7b8f5..00000000 --- a/installer/vagrant/Vagrantfile-1.1.1b-vbox +++ /dev/null @@ -1,172 +0,0 @@ -# Vagrantfile to install OpenGnsys virtual environment (production version) using VirtualBox provider. - -VAGRANTFILE_API_VERSION = "2" -# VM provider: Oracle VM VirtualBox. -ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox" -# OpenGnsys version and OGAgent version. -OGVERSION="1.1.1c" -# Language (accepted values: es_ES, ca_ES, en_GB). -LANGUAGE = "es_ES" -ENV['LC_ALL'] = LANGUAGE + ".UTF-8" -# Number of OpenGnsys clients (accepted values: from 2 to 9). -NCLIENTS = 4 -# Repository virtual disk: file and size (GB). -REPODISK = "ogRepo.vdi" -REPOSIZE = 50 -# Amount of memory for server and clients (MB) -SERVERMEM = 1024 # Minimum: 512 -CLIENTMEM = 512 # Minimum: 256 -# Prefixes for MAC and IP addresses. -MACPREFIX = "08:00:27:0E:65" -NETPREFIX = "192.168.2" -# OpenGnsys Server IP address. -SERVERIP = "#{NETPREFIX}.10" -# Local port to access OpenGnsys Server. -LOCALWEBPORT = 8443 - -# OpenGnsys Server provisioning script: prepare repo disk, install OpenGnsys, change default interface, configure DHCP server. -OGSERVERSCRIPT = <> /etc/fstab - mount -a -fi -# Install OpenGnsys and change server address. -if which curl &>/dev/null; then - DOWNLOAD="curl -s" -elif which wget &>/dev/null; then - DOWNLOAD="wget -q -O -" -fi -BRANCH="opengnsys-#{OGVERSION}" -$DOWNLOAD "https://raw.githubusercontent.com/opengnsys/OpenGnsys/$BRANCH/installer/opengnsys_installer.sh" | bash || exit $? -mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log -echo y | /opt/opengnsys/bin/setserveraddr $(ip -o link show | tail -1 | cut -d: -f2) -# Insert DHCP data. -for ((i=#{NCLIENTS+10}; i>10; i--)); do - sed -i "/^}$/ i host pc${i} { hardware ethernet #{MACPREFIX}:${i}; fixed-address #{NETPREFIX}.${i}; }" /etc/dhcp/dhcpd.conf -done -service isc-dhcp-server restart -# Set language. -export LANG="#{LANGUAGE}.UTF-8" -echo "LANG=\\\"$LANG\\\"" > /etc/default/locale -echo "LANG=\\\"$LANG\\\"" >> /etc/environment -locale-gen --lang #{LANGUAGE} -sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard -dpkg-reconfigure -fnoninteractive console-setup -# Comment out next lines for automatic data insertion. -#SQL="INSERT INTO aulas (nombreaula, idcentro, urlfoto, grupoid, ubicacion, puestos, modomul, ipmul, pormul, velmul, router, netmask, ntp, dns, proxy, modp2p, timep2p) VALUES ('Aula virtual', 1, 'aula.jpg', 0, 'Despliegue virtual con Vagrant.', 5, 2, '239.194.2.11', 9000, 70, '#{NETPREFIX}.1', '255.255.255.0', '', '', '', 'peer', 30); INSERT INTO ordenadores (nombreordenador, ip, mac, idaula, idrepositorio, idperfilhard, idmenu, idproautoexec, grupoid, router, mascara, arranque, netiface, netdriver, fotoord) VALUES" -#for ((i=11; i<=#{NCLIENTS+10}; i++)); do -# SQL="$SQL ('pc$i', '#{NETPREFIX}.$i', REPLACE('#{MACPREFIX}$i',':',''), 1, 1, 0, 0, 0, 0, '#{NETPREFIX}.1', '255.255.255.0', '00unknown', 'eth0', 'generic', 'fotoordenador.gif')," -#done -#mysql -u usuog -ppassusuog -D ogAdmBD -e "${SQL%,}" -#/opt/opengnsys/bin/setclientmode ogLiveAdmin pc11 PERM -#for ((i=12; i<=#{NCLIENTS+10}; i++)); do -# /opt/opengnsys/bin/setclientmode ogLive pc$i PERM -#done -echo "Notes:" -echo "- OpenGnsys Server URL: https://localhost:#{LOCALWEBPORT}/opengnsys/" -exit 0 -EOT - -# Client 1 OS provisioning script. -MODELSCRIPT = <> /etc/fstab + mount -a +fi +# Install OpenGnsys and change server address. +if which curl &>/dev/null; then + DOWNLOAD="curl -s" +elif which wget &>/dev/null; then + DOWNLOAD="wget -q -O -" +fi +BRANCH="opengnsys-#{OGVERSION}" +$DOWNLOAD "https://raw.githubusercontent.com/opengnsys/OpenGnsys/$BRANCH/installer/opengnsys_installer.sh" | bash || exit $? +mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log +echo y | /opt/opengnsys/bin/setserveraddr $(ip -o link show | tail -1 | cut -d: -f2) +# Insert DHCP data. +for ((i=#{NCLIENTS+10}; i>10; i--)); do + sed -i "/^}$/ i host pc${i} { hardware ethernet #{MACPREFIX}:${i}; fixed-address #{NETPREFIX}.${i}; }" /etc/dhcp/dhcpd.conf +done +service isc-dhcp-server restart +# Set language. +export LANG="#{LANGUAGE}.UTF-8" +echo "LANG=\\\"$LANG\\\"" > /etc/default/locale +echo "LANG=\\\"$LANG\\\"" >> /etc/environment +locale-gen --lang #{LANGUAGE} +sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\\\"${LANG%_*}\\\"/" /etc/default/keyboard +dpkg-reconfigure -fnoninteractive console-setup +# Comment out next lines for automatic data insertion. +#SQL="INSERT INTO aulas (nombreaula, idcentro, urlfoto, grupoid, ubicacion, puestos, modomul, ipmul, pormul, velmul, router, netmask, ntp, dns, proxy, modp2p, timep2p) VALUES ('Aula virtual', 1, 'aula.jpg', 0, 'Despliegue virtual con Vagrant.', 5, 2, '239.194.2.11', 9000, 70, '#{NETPREFIX}.1', '255.255.255.0', '', '', '', 'peer', 30); INSERT INTO ordenadores (nombreordenador, ip, mac, idaula, idrepositorio, idperfilhard, idmenu, idproautoexec, grupoid, router, mascara, arranque, netiface, netdriver, fotoord) VALUES" +#for ((i=11; i<=#{NCLIENTS+10}; i++)); do +# SQL="$SQL ('pc$i', '#{NETPREFIX}.$i', REPLACE('#{MACPREFIX}$i',':',''), 1, 1, 0, 0, 0, 0, '#{NETPREFIX}.1', '255.255.255.0', '00unknown', 'eth0', 'generic', 'fotoordenador.gif')," +#done +#mysql -u usuog -ppassusuog -D ogAdmBD -e "${SQL%,}" +#/opt/opengnsys/bin/setclientmode ogLiveAdmin pc11 PERM +#for ((i=12; i<=#{NCLIENTS+10}; i++)); do +# /opt/opengnsys/bin/setclientmode ogLive pc$i PERM +#done +echo "Notes:" +echo "- OpenGnsys Server URL: https://localhost:#{LOCALWEBPORT}/opengnsys/" +exit 0 +EOT + +# Client 1 OS provisioning script. +MODELSCRIPT = <