summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2019-11-29 13:13:00 +0100
committerRamón M. Gómez <ramongomez@us.es>2019-11-29 13:13:00 +0100
commit153055fbbf255ced95fd99cae35a2da5fa8000cc (patch)
treeb9cff96d393a394c4216318f904a5c022bc48c10
parent869f42581d6b6544dfb8bfef65b6e058f2c90b8f (diff)
#914: Releasing OpenGnsys 1.1.1 (Espeto).
-rw-r--r--admin/README.es.txt10
-rw-r--r--doc/CHANGELOG.es.txt7
-rw-r--r--doc/INSTALL.en.txt14
-rw-r--r--doc/INSTALL.es.txt12
-rw-r--r--installer/README.es.txt2
-rwxr-xr-xinstaller/opengnsys_installer.sh2
-rw-r--r--installer/vagrant/Vagrantfile-1.1.0a-vbox170
-rw-r--r--installer/vagrant/Vagrantfile-1.1.1-vbox172
l---------[-rw-r--r--]installer/vagrant/Vagrantfile-prod-vbox171
9 files changed, 374 insertions, 186 deletions
diff --git a/admin/README.es.txt b/admin/README.es.txt
new file mode 100644
index 00000000..bf3f1a47
--- /dev/null
+++ b/admin/README.es.txt
@@ -0,0 +1,10 @@
+OpenGnsys Administrator README
+================================
+
+
+Este directorio contiene la estructura de datos de los servicios principales de OpenGnsys.
+
+- Database ficheros SQL para crear/actualizar la base de datos
+- Interface scripts de interfaz entre la web y el servicio OpenGnsys Server
+- Sources código fuente de servicio y clientes
+- WebConsole web de administración de OpenGnsys
diff --git a/doc/CHANGELOG.es.txt b/doc/CHANGELOG.es.txt
index bf55e684..4e9b08c3 100644
--- a/doc/CHANGELOG.es.txt
+++ b/doc/CHANGELOG.es.txt
@@ -1,8 +1,8 @@
+
LISTA DE CAMBIOS CHANGELOG.es.txt
========================================
-
Lista de cambios incluidos en OpenGnsys 1.1.1 (Espeto)
------------------------------------------------------
@@ -20,6 +20,7 @@ Tickets resueltos en módulo OpenGnsys Cloning Engine:
#920 Error al guardar en la BD el número de serie (corrección)
#923 Mejora de control de errores en deployImagen (corrección)
#926 bootOsCustom soportará varios discos y una partición de datos
+#931 Fallo en el inventario Software (corrección)
Tickets resueltos en módulo OpenGnsys Client:
#847 La ISO del ogLive debe de utilzar la revisión de Git y no de SVN
@@ -49,7 +50,8 @@ Tickets resueltos en módulo OpenGnsys Server:
#896 Enviar Wake On Lan por la interfaz correcta
#899 Eliminar código obsoleto en ogAdmLib
#900 Fichero de configuración unificado (duplicado de #140)
-#915 API REST para ogAdmServer
+#915 API REST para ogAdmServer (tarea)
+#924 ogAdmServer: Aunque la restauración falle se modifica la configuración del equipo (corrección)
#925 Script para generar API tokens de servicios
#929 Autenticación de clave pública entre los ogLive
@@ -64,6 +66,7 @@ Tickets resueltos en módulo OpenGnsys Web Admin Console:
#903 Formulario "Añadir Nuevo Ordenador" no valida dirección MAC (corrección)
#921 Cola de acciones: no muestra nada (corrección)
#928 Multicast: ampliar el rango de puertos posibles (mejora)
+#932 Remote PC no arranca equipos en repositorio secundario
Tickets resueltos en módulo OpenGnsys Installer:
#784 Mejorar rendimiento de PHP sobre Apache
diff --git a/doc/INSTALL.en.txt b/doc/INSTALL.en.txt
index 6b641c26..84492e6e 100644
--- a/doc/INSTALL.en.txt
+++ b/doc/INSTALL.en.txt
@@ -1,10 +1,10 @@
-Installing OpenGnsys Server 1.1.0
-=================================
+Installing OpenGnsys Server 1.1.1 (Espeto)
+==========================================
Before installation
-------------------
-OpenGnsys Server 1.1.1 (Espeto) is meant to be installed under Ubuntu Server 18.04 LTS or newer (some tests have been done on CentOS 7-based systems).
+OpenGnsys Server 1.1.1 (codename Espeto) is meant to be installed under Ubuntu Server 18.04 LTS or newer (some tests have been done on CentOS 7-based systems).
Network connection is needed in order to download the required packages, the source code and the preconfigured client.
@@ -22,16 +22,16 @@ Installing
To install OpenGnsys, run opengnsys_installer.sh script after unpacking the release file (opengnsys-release.tar.gz) or after downloading it directly from https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh
Unpacking example:
- tar xvzf opengnsys-Version.tar.gz
+ tar xvzf opengnsys-VERSION.tar.gz
cd opengnsys/installer
Downloading examples:
* Download with wget.
- wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh
+ wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/VERSION/installer/opengnsys_installer.sh
* Download with curl.
- curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh -o opengnsys_installer.sh
+ curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/VERSION/installer/opengnsys_installer.sh -o opengnsys_installer.sh
You must be root to run the installation script:
@@ -71,6 +71,8 @@ Once the installation process is finished, you can start working with the system
Updating / upgrading
--------------------
+Warning: if you are going to upgrade OpenGnsys from a version earlier than 1.1.1 (Espeto), you must first upgrade Ubuntu to version 18.04 LTS and restart the server.
+
There is a system self-upgrading script with the following features:
* Network connection is needed to obtain the latest updates / upgrades.
* If the script updates itself, then it must be run once again.
diff --git a/doc/INSTALL.es.txt b/doc/INSTALL.es.txt
index 4d79e315..a8fd4e00 100644
--- a/doc/INSTALL.es.txt
+++ b/doc/INSTALL.es.txt
@@ -1,5 +1,5 @@
-Instalación de OpenGnsys Server 1.1.0
-=====================================
+Instalación de OpenGnsys Server 1.1.1 (Espeto)
+==============================================
Notas iniciales
---------------
@@ -22,16 +22,16 @@ La instalación de OpenGnsys se realiza ejecutando el script de instalación ope
Ejemplos de descompresión del programa:
- tar xvzf opengnsys-Version.tar.gz
+ tar xvzf opengnsys-VERSION.tar.gz
cd opengnsys/installer
Ejemplos de descarga con varias herramientas:
* Descargar con wget.
- wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh
+ wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/VERSION/installer/opengnsys_installer.sh
* Descargar con curl.
- curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh -o opengnsys_installer.sh
+ curl https://raw.githubusercontent.com/opengnsys/OpenGnsys/VERSION/installer/opengnsys_installer.sh -o opengnsys_installer.sh
El script de instalación debe ser ejecutado como usuario root:
@@ -71,6 +71,8 @@ Una vez finalizada la ejecución del instalador, puede empezarse a trabajar con
Actualización
-------------
+Nota importante: si se va a actualizar OpenGnsys desde una versión anterior a la 1.1.1 (Espeto), debe actualizarse antes la distribución de Ubuntu a la versión 18.04 LTS y reiniciar el servidor.
+
Se dispone de un script de auto-actualización del sistema, con las siguientes características:
* Es necesario conexión a Internet para obtener las últimas actualizaciones.
* Si el script se actualiza a sí mismo, debe ser ejecutado de nuevo.
diff --git a/installer/README.es.txt b/installer/README.es.txt
index 0642e4ed..cb6f36c1 100644
--- a/installer/README.es.txt
+++ b/installer/README.es.txt
@@ -25,5 +25,3 @@ eliminar el Proyecto OpenGnsys.
- vagrant directorio con ficheros de configuración para despliegue
de entornos de prueba y desarrollo con Vagrant
-- install_ticket_wolunicast.sh programa de instalación del parche para ejecutar
- arranque Wake-On-Lan por IP usando protocolo Unicast
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 39ca5e91..ec8168f9 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -132,7 +132,7 @@ function globalSetup ()
else
REMOTE=1
fi
- BRANCH="master"
+ BRANCH="opengnsys-1.1.1"
CODE_URL="https://codeload.github.com/opengnsys/OpenGnsys/zip/$BRANCH"
API_URL="https://api.github.com/repos/opengnsys/OpenGnsys/branches/$BRANCH"
diff --git a/installer/vagrant/Vagrantfile-1.1.0a-vbox b/installer/vagrant/Vagrantfile-1.1.0a-vbox
new file mode 100644
index 00000000..07d43556
--- /dev/null
+++ b/installer/vagrant/Vagrantfile-1.1.0a-vbox
@@ -0,0 +1,170 @@
+# 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"
+# 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 = <<EOT
+# Exit if OpenGnsys is installed.
+[ -f /opt/opengnsys/doc/VERSION.json ] && echo "Cannot provision, OpenGnsys is already installed." && exit 1
+# Create repository disk using LVM, if necesary.
+if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then
+ pvcreate /dev/sdb
+ vgcreate og /dev/sdb
+ vgchange -ay
+ lvcreate -ay -n images -l 100%VG og
+ mkfs -t ext4 /dev/mapper/og-images
+ mkdir -p /opt/opengnsys/images
+ echo "/dev/mapper/og-images /opt/opengnsys/images ext4 defaults 0 0" >> /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-1.1.0a"
+$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.
+OGAGENTPKG = "ogagent_1.1.0_all.deb"
+MODELSCRIPT = <<EOT
+# Comment out next lines to install and configure OGAgent for Ubuntu.
+#apt-get update -y
+#apt-get install -y curl
+#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o /tmp/#{OGAGENTPKG}
+#if [ -f /tmp/#{OGAGENTPKG} ]; then
+# apt-get install -y /tmp/#{OGAGENTPKG} || exit $?
+# sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg
+# rm -f /tmp/#{OGAGENTPKG}
+#else
+# echo "Warning: cannot install OGAgent package #{OGAGENTPKG}"
+#fi
+# Remove network configuration added by Vagrant.
+sed -i "/enp0s3/ d" /etc/network/interfaces
+echo "Notes:"
+echo "- After now, use VirtualBox GUI to disable network interface 1 and restart this VM."
+# Leave VM halted.
+sleep 2
+poweroff &
+EOT
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+ # OpenGnsys Server VM definition.
+ config.vm.define "ogAdministrator", primary: true do |og|
+ # Specific VirtualBox configuration.
+ og.vm.provider "virtualbox" do |vb|
+ # VM name, memory and CPUs.
+ vb.name = "ogAdministrator"
+ vb.memory = SERVERMEM
+ vb.cpus = 1
+ # 2nd virtual disk path (current dir on Windows, VM dir on other OSes)
+ if Vagrant::Util::Platform.windows? then
+ second_disk = File.join(".", REPODISK)
+ else
+ line = `VBoxManage list systemproperties`.match("Default machine folder.*")[0]
+ vb_machine_folder = line.split(':')[1].strip()
+ second_disk = File.join(vb_machine_folder, vb.name, REPODISK)
+ end
+ # Create repo virtual disk, if needed.
+ unless File.exist?(second_disk)
+ vb.customize ['createhd', '--filename', second_disk, '--size', REPOSIZE * 1024]
+ end
+ # Attach repo virtual disk.
+ vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', second_disk]
+ end
+ # VM base and host name.
+ og.vm.box = "bento/ubuntu-16.04"
+ og.vm.hostname = "ogAdministrator"
+ # Network configuration: forward web port and attach new interface to VMs private network.
+ og.vm.network "forwarded_port", guest: 443, host: LOCALWEBPORT, host_ip: "127.0.0.1"
+ og.vm.network "private_network", mac: "#{MACPREFIX}10".tr(":",""), ip: "#{SERVERIP}", virtualbox__intnet: true
+ # Comment out to disable synced folder.
+ #og.vm.synced_folder ".", "/vagrant", disabled: true
+ # Launch provisioning script.
+ og.vm.provision "shell", inline: OGSERVERSCRIPT
+ end
+
+ # Client 1 VM definition.
+ config.vm.define "pc11", autostart: false do |v1|
+ v1.vm.box = "bento/ubuntu-16.04"
+ v1.vm.hostname = "pc11"
+ v1.vm.network "private_network", mac: "#{MACPREFIX}11".tr(":",""), type: "dhcp", virtualbox__intnet: true
+ v1.vm.provider "virtualbox" do |vb|
+ vb.name = "pc11"
+ vb.memory = CLIENTMEM
+ vb.cpus = 1
+ vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
+ end
+ v1.vm.synced_folder ".", "/vagrant", disabled: true
+ v1.vm.provision "shell", inline: MODELSCRIPT
+ end
+
+ # Clonable clients definition.
+ (2..NCLIENTS).each do |i|
+ config.vm.define "pc#{i+10}", autostart: false do |cl|
+ cl.vm.box = "clink15/pxe"
+ cl.ssh.insert_key = false
+ cl.vm.boot_timeout = 5
+ cl.vm.network "private_network", mac: "#{MACPREFIX}#{i+10}".tr(":",""), type: "dhcp", virtualbox__intnet: true
+ cl.vm.provider "virtualbox" do |vb|
+ vb.name = "pc#{i+10}"
+ vb.memory = CLIENTMEM
+ vb.cpus = 1
+ vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
+ vb.customize ["modifyvm", :id, "--nic1", "none"]
+ end
+ end
+ end
+
+end
+
diff --git a/installer/vagrant/Vagrantfile-1.1.1-vbox b/installer/vagrant/Vagrantfile-1.1.1-vbox
new file mode 100644
index 00000000..7d4fb45c
--- /dev/null
+++ b/installer/vagrant/Vagrantfile-1.1.1-vbox
@@ -0,0 +1,172 @@
+# 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
+OGVERSION="1.1.1"
+# 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 = <<EOT
+# Exit if OpenGnsys is installed.
+[ -f /opt/opengnsys/doc/VERSION.txt ] && echo "Cannot provision, OpenGnsys is already installed." && exit 1
+# Create repository disk using LVM, if necesary.
+if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then
+ pvcreate /dev/sdb
+ vgcreate og /dev/sdb
+ vgchange -ay
+ lvcreate -ay -n images -l 100%VG og
+ mkfs -t ext4 /dev/mapper/og-images
+ mkdir -p /opt/opengnsys/images
+ echo "/dev/mapper/og-images /opt/opengnsys/images ext4 defaults 0 0" >> /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 = <<EOT
+# Comment out next lines to install and configure OGAgent for Ubuntu.
+#OGAGENTPKG="ogagent_#{OGVERSION}_all.deb"
+#apt-get update -y
+#apt-get install -y curl
+#curl -ks https://#{SERVERIP}/opengnsys/descargas/$OGAGENTPKG -o /tmp/$OGAGENTPKG
+#if [ -f /tmp/$OGAGENTPKG ]; then
+# apt-get install -y /tmp/$OGAGENTPKG || exit $?
+# sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg
+# rm -f /tmp/$OGAGENTPKG
+#else
+# echo "Warning: cannot install OGAgent package $OGAGENTPKG"
+#fi
+# Remove network configuration added by Vagrant.
+sed -i "/enp0s3/ d" /etc/network/interfaces
+echo "Notes:"
+echo "- After now, use VirtualBox GUI to disable network interface 1 and restart this VM."
+# Leave VM halted.
+sleep 2
+poweroff &
+EOT
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+
+ # OpenGnsys Server VM definition.
+ config.vm.define "ogAdministrator", primary: true do |og|
+ # Specific VirtualBox configuration.
+ og.vm.provider "virtualbox" do |vb|
+ # VM name, memory and CPUs.
+ vb.name = "ogAdministrator"
+ vb.memory = SERVERMEM
+ vb.cpus = 1
+ # 2nd virtual disk path (current dir on Windows, VM dir on other OSes)
+ if Vagrant::Util::Platform.windows? then
+ second_disk = File.join(".", REPODISK)
+ else
+ line = `VBoxManage list systemproperties`.match("Default machine folder.*")[0]
+ vb_machine_folder = line.split(':')[1].strip()
+ second_disk = File.join(vb_machine_folder, vb.name, REPODISK)
+ end
+ # Create repo virtual disk, if needed.
+ unless File.exist?(second_disk)
+ vb.customize ['createhd', '--filename', second_disk, '--size', REPOSIZE * 1024]
+ end
+ # Attach repo virtual disk.
+ vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', second_disk]
+ end
+ # VM base and host name.
+ og.vm.box = "bento/ubuntu-18.04"
+ og.vm.hostname = "ogAdministrator"
+ # Network configuration: forward web port and attach new interface to VMs private network.
+ og.vm.network "forwarded_port", guest: 443, host: LOCALWEBPORT, host_ip: "127.0.0.1"
+ og.vm.network "private_network", mac: "#{MACPREFIX}10".tr(":",""), ip: "#{SERVERIP}", virtualbox__intnet: true
+ # Comment out to disable synced folder.
+ #og.vm.synced_folder ".", "/vagrant", disabled: true
+ # Launch provisioning script.
+ og.vm.provision "shell", inline: OGSERVERSCRIPT
+ end
+
+ # Client 1 VM definition.
+ config.vm.define "pc11", autostart: false do |v1|
+ v1.vm.box = "bento/ubuntu-18.04"
+ v1.vm.hostname = "pc11"
+ v1.vm.network "private_network", mac: "#{MACPREFIX}11".tr(":",""), type: "dhcp", virtualbox__intnet: true
+ v1.vm.provider "virtualbox" do |vb|
+ vb.name = "pc11"
+ vb.memory = CLIENTMEM
+ vb.cpus = 1
+ vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
+ end
+ v1.vm.synced_folder ".", "/vagrant", disabled: true
+ v1.vm.provision "shell", inline: MODELSCRIPT
+ end
+
+ # Clonable clients definition.
+ (2..NCLIENTS).each do |i|
+ config.vm.define "pc#{i+10}", autostart: false do |cl|
+ cl.vm.box = "clink15/pxe"
+ cl.ssh.insert_key = false
+ cl.vm.boot_timeout = 5
+ cl.vm.network "private_network", mac: "#{MACPREFIX}#{i+10}".tr(":",""), type: "dhcp", virtualbox__intnet: true
+ cl.vm.provider "virtualbox" do |vb|
+ vb.name = "pc#{i+10}"
+ vb.memory = CLIENTMEM
+ vb.cpus = 1
+ vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
+ vb.customize ["modifyvm", :id, "--nic1", "none"]
+ end
+ end
+ end
+
+end
+
diff --git a/installer/vagrant/Vagrantfile-prod-vbox b/installer/vagrant/Vagrantfile-prod-vbox
index 21a09be3..f14479e7 100644..120000
--- a/installer/vagrant/Vagrantfile-prod-vbox
+++ b/installer/vagrant/Vagrantfile-prod-vbox
@@ -1,170 +1 @@
-# 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"
-# 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 = <<EOT
-# Exit if OpenGnsys is installed.
-[ -f /opt/opengnsys/doc/VERSION.txt ] && echo "Cannot provision, OpenGnsys is already installed." && exit 1
-# Create repository disk using LVM, if necesary.
-if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then
- pvcreate /dev/sdb
- vgcreate og /dev/sdb
- vgchange -ay
- lvcreate -ay -n images -l 100%VG og
- mkfs -t ext4 /dev/mapper/og-images
- mkdir -p /opt/opengnsys/images
- echo "/dev/mapper/og-images /opt/opengnsys/images ext4 defaults 0 0" >> /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-1.1.0a"
-$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.
-OGAGENTPKG = "ogagent_1.1.0_all.deb"
-MODELSCRIPT = <<EOT
-# Comment out next lines to install and configure OGAgent for Ubuntu.
-#apt-get update -y
-#apt-get install -y curl
-#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o /tmp/#{OGAGENTPKG}
-#if [ -f /tmp/#{OGAGENTPKG} ]; then
-# apt-get install -y /tmp/#{OGAGENTPKG} || exit $?
-# sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg
-# rm -f /tmp/#{OGAGENTPKG}
-#else
-# echo "Warning: cannot install OGAgent package #{OGAGENTPKG}"
-#fi
-# Remove network configuration added by Vagrant.
-sed -i "/enp0s3/ d" /etc/network/interfaces
-echo "Notes:"
-echo "- After now, use VirtualBox GUI to disable network interface 1 and restart this VM."
-# Leave VM halted.
-sleep 2
-poweroff &
-EOT
-
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
-
- # OpenGnsys Server VM definition.
- config.vm.define "ogAdministrator", primary: true do |og|
- # Specific VirtualBox configuration.
- og.vm.provider "virtualbox" do |vb|
- # VM name, memory and CPUs.
- vb.name = "ogAdministrator"
- vb.memory = SERVERMEM
- vb.cpus = 1
- # 2nd virtual disk path (current dir on Windows, VM dir on other OSes)
- if Vagrant::Util::Platform.windows? then
- second_disk = File.join(".", REPODISK)
- else
- line = `VBoxManage list systemproperties`.match("Default machine folder.*")[0]
- vb_machine_folder = line.split(':')[1].strip()
- second_disk = File.join(vb_machine_folder, vb.name, REPODISK)
- end
- # Create repo virtual disk, if needed.
- unless File.exist?(second_disk)
- vb.customize ['createhd', '--filename', second_disk, '--size', REPOSIZE * 1024]
- end
- # Attach repo virtual disk.
- vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', second_disk]
- end
- # VM base and host name.
- og.vm.box = "bento/ubuntu-16.04"
- og.vm.hostname = "ogAdministrator"
- # Network configuration: forward web port and attach new interface to VMs private network.
- og.vm.network "forwarded_port", guest: 443, host: LOCALWEBPORT, host_ip: "127.0.0.1"
- og.vm.network "private_network", mac: "#{MACPREFIX}10".tr(":",""), ip: "#{SERVERIP}", virtualbox__intnet: true
- # Comment out to disable synced folder.
- #og.vm.synced_folder ".", "/vagrant", disabled: true
- # Launch provisioning script.
- og.vm.provision "shell", inline: OGSERVERSCRIPT
- end
-
- # Client 1 VM definition.
- config.vm.define "pc11", autostart: false do |v1|
- v1.vm.box = "bento/ubuntu-16.04"
- v1.vm.hostname = "pc11"
- v1.vm.network "private_network", mac: "#{MACPREFIX}11".tr(":",""), type: "dhcp", virtualbox__intnet: true
- v1.vm.provider "virtualbox" do |vb|
- vb.name = "pc11"
- vb.memory = CLIENTMEM
- vb.cpus = 1
- vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
- end
- v1.vm.synced_folder ".", "/vagrant", disabled: true
- v1.vm.provision "shell", inline: MODELSCRIPT
- end
-
- # Clonable clients definition.
- (2..NCLIENTS).each do |i|
- config.vm.define "pc#{i+10}", autostart: false do |cl|
- cl.vm.box = "clink15/pxe"
- cl.ssh.insert_key = false
- cl.vm.boot_timeout = 5
- cl.vm.network "private_network", mac: "#{MACPREFIX}#{i+10}".tr(":",""), type: "dhcp", virtualbox__intnet: true
- cl.vm.provider "virtualbox" do |vb|
- vb.name = "pc#{i+10}"
- vb.memory = CLIENTMEM
- vb.cpus = 1
- vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
- vb.customize ["modifyvm", :id, "--nic1", "none"]
- end
- end
- end
-
-end
-
+Vagrantfile-1.1.1-vbox \ No newline at end of file