summaryrefslogtreecommitdiffstats
path: root/installer/vagrant
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2018-01-26 13:51:21 +0000
committerramon <ramongomez@us.es>2018-01-26 13:51:21 +0000
commit8926a53d015822465a063f98e6b6880cd3727449 (patch)
treeb2dc2c350cd0127f9cb0a0f19432bc1b5bdea67a /installer/vagrant
parentd43640a230285b9fe2aab0deabd1b80eaab0385c (diff)
#739: Adaptar ficheros Vagrant a datos de clientes del curso online y URLs actualizadas.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5585 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer/vagrant')
-rw-r--r--installer/vagrant/README.es.txt11
-rw-r--r--installer/vagrant/Vagrantfile-boottools-vbox2
-rw-r--r--installer/vagrant/Vagrantfile-browser-vbox2
-rw-r--r--installer/vagrant/Vagrantfile-devel-vbox73
-rw-r--r--installer/vagrant/Vagrantfile-ogagent-vbox2
5 files changed, 51 insertions, 39 deletions
diff --git a/installer/vagrant/README.es.txt b/installer/vagrant/README.es.txt
index 10578404..ce40f709 100644
--- a/installer/vagrant/README.es.txt
+++ b/installer/vagrant/README.es.txt
@@ -5,7 +5,7 @@ Preparar entorno virtual de desarrollo para OpenGnsys
Ficheros de configuración disponibles:
- - Vagrantfile-trunk-vbox Vagrantfile para OpenGnsys oficial con proveedor VirtualBox.
+ - Vagrantfile-trunk-vbox Vagrantfile para OpenGnsys estable con proveedor VirtualBox.
- Vagrantfile-devel-vbox Vagrantfile para OpenGnsys en desarrollo con proveedor VirtualBox.
- Vagrantfile-boottools-vbox Vagrantfile para preparar el entorno de generación del cliente ogLive (recomendado solo para desarrolladores experimentados).
- Vagrantfile-browser-vbox Vagrantfile para preparar el entorno de desarrollo del Browser del cliente (recomendado solo para miembros del grupo de desarrollo).
@@ -21,8 +21,8 @@ Requisitos previos.
El entorno de trabajo de OpenGnsys.
- ogAdministrator: MV para servidor OpenGnsys basada en Ubuntu 16.04 y 2º disco para repositorio.
- - ogClient01: MV cliente modelo con Ubuntu 16.04 instalado.
- - ogClient02 - ogclient0N: MV clientes para restaurar con disco vacío.
+ - pc11: MV cliente mlodelo con Ubuntu 16.04 instalado.
+ - pc12 - ogclientN: MV clientes para restaurar con disco vacío.
Ejecutar el entorno virtual (Vagrantfile-trunk-vbox y Vagrantfile-devel-vbox).
@@ -36,6 +36,7 @@ Ejecutar el entorno virtual (Vagrantfile-trunk-vbox y Vagrantfile-devel-vbox).
- SERVERMEM, CLIENTMEM: memoria virtual (en MB) para servidor y clientes (mínimo 256 MB).
- NETPREFIX: prefijo para las direcciones IP de la red virtual.
- MACPREFIX: prefijo para las direcciones MAC de los clientes.
+ - SERVERIP: dirección IP del servidor OpenGnsys
- LOCALWEBPORT: puerto local para acceder al web de administración del servidor.
- Opcional: para una definición automática del aula virtual con sus clientes, descomentar las líneas del fichero Vagrantfile de los comandos "mysql" y "setclientmode".
@@ -43,9 +44,9 @@ Ejecutar el entorno virtual (Vagrantfile-trunk-vbox y Vagrantfile-devel-vbox).
vagrant up
- Iniciar las MV de los clientes (tras iniciar el servidor):
- Cliente modelo:
- vagrant up ogClient01
+ vagrant up pc11
- Clientes vacíos para restaurar:
- vagrant up ogClient0X (siendo X de 2 al nº máximo definido)
+ vagrant up pcX (siendo X de 12 al nº máximo definido + 10)
Notas:
- Los procesos de inicio pueden tardar varios minutos en la primera ejecución, porque descargan y configuran las máquinas virtuales.
diff --git a/installer/vagrant/Vagrantfile-boottools-vbox b/installer/vagrant/Vagrantfile-boottools-vbox
index 0d017903..1a7c9e5a 100644
--- a/installer/vagrant/Vagrantfile-boottools-vbox
+++ b/installer/vagrant/Vagrantfile-boottools-vbox
@@ -24,7 +24,7 @@ apt-get install -y subversion
groupadd opengnsys
mkdir -p /opt/opengnsys/client /tmp/opengnsys_installer/opengnsys
ln -fs /var/lib/tftpboot /opt/opengnsys
-svn export http://opengnsys.es/svn/branches/version1.1/client /tmp/opengnsys_installer/opengnsys/client
+svn export https://opengnsys.es/svn/branches/version1.1/client /tmp/opengnsys_installer/opengnsys/client
echo "Connect to this VM, launch boot-tools generation script and follow instructions:"
echo " sudo /tmp/opengnsys_installer/opengnsys/client/boot-tools/boottoolsgenerator.sh"
echo "Warning: this process may take a long time."
diff --git a/installer/vagrant/Vagrantfile-browser-vbox b/installer/vagrant/Vagrantfile-browser-vbox
index cfdc2b6f..9cf3661c 100644
--- a/installer/vagrant/Vagrantfile-browser-vbox
+++ b/installer/vagrant/Vagrantfile-browser-vbox
@@ -29,7 +29,7 @@ echo "yes" | ./configure -opensource -embedded x86 -webkit -openssl -qt-gfx-vnc
make
make install
# Compile Browser.
-svn export http://opengnsys.es/svn/branches/version1.1/client/browser ../browser
+svn export https://opengnsys.es/svn/branches/version1.1/client/browser ../browser
cd browser
qmake browser.pro
make
diff --git a/installer/vagrant/Vagrantfile-devel-vbox b/installer/vagrant/Vagrantfile-devel-vbox
index 3bc352c3..2250cd85 100644
--- a/installer/vagrant/Vagrantfile-devel-vbox
+++ b/installer/vagrant/Vagrantfile-devel-vbox
@@ -14,9 +14,11 @@ REPOSIZE = 50
# Amount of memory for server and clients (MB)
SERVERMEM = 1024 # Minimum: 512
CLIENTMEM = 512 # Minimum: 256
-# Clients MAC address prefix.
-MACPREFIX = "08:00:27:0E:65:"
-NETPREFIX = "192.168.2."
+# 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
@@ -24,21 +26,24 @@ LOCALWEBPORT = 8443
OGSERVERSCRIPT = <<EOT
# Exit if OpenGnsys is installed.
[ -f /opt/opengnsys/doc/VERSION.txt ] && echo "Cannot provision, OpenGnsys is already installed." && exit 1
-# Mount repository disk, if necesary.
-if [ -n "$(blkid /dev/sdb1 | grep ext4)" ]; then
- echo -e "o\nn\np\n\n\n\nw" | fdisk /dev/sdb
- mkfs -t ext4 /dev/sdb1
+# 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/sdb1 /opt/opengnsys/images ext4 defaults 0 0" >> /etc/fstab
+ echo "/dev/mapper/og-images /opt/opengnsys/images ext4 defaults 0 0" >> /etc/fstab
mount -a
fi
# Install OpenGnsys and change server address.
-wget -q http://opengnsys.es/svn/branches/version1.1/installer/opengnsys_installer.sh -O - | bash || exit $?
+wget -q https://opengnsys.es/svn/branches/version1.1/installer/opengnsys_installer.sh -O - | bash || exit $?
mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log
echo y | /opt/opengnsys/bin/setserveraddr enp0s8
# Insert DHCP data.
-for ((i=#{NCLIENTS}; i>0; i--)); do
- sed -i "/^}$/ i host ogClient0${i} { hardware ethernet #{MACPREFIX}0${i}; fixed-address #{NETPREFIX}1${i}; }" /etc/dhcp/dhcpd.conf
+for ((i=#{NCLIENTS+10}; i>0; 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.
@@ -49,20 +54,20 @@ 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=1; i<=#{NCLIENTS}; i++)); do
-# SQL="$SQL ('ogClient0$i', '#{NETPREFIX}1$i', REPLACE('#{MACPREFIX}0$i',':',''), 1, 1, 0, 0, 0, 0, '#{NETPREFIX}1', '255.255.255.0', '00unknown', 'eth0', 'generic', 'fotoordenador.gif'),"
+#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 ogClient01 PERM
-#for ((i=2; i<=#{NCLIENTS}; i++)); do
-# /opt/opengnsys/bin/setclientmode ogLive ogClient0$i PERM
+#/opt/opengnsys/bin/setclientmode ogLiveAdmin pc11 PERM
+#for ((i=12; i<=#{NCLIENTS+10}; i++)); do
+# /opt/opengnsys/bin/setclientmode ogLive pc$i PERM
#done
# Comment out next lines to install new Angular-based web application (on early development).
#apt-get install -y git nodejs npm
#ln -fs nodejs /usr/bin/node
#npm install bower -g
-#svn export http://opengnsys.es/svn/branches/version1.1-tickets/ogWebAdmin-ticket761/admin/WebConsole/angular /opt/opengnsys/www/angular
+#svn export https://opengnsys.es/svn/branches/version1.1-tickets/ogWebAdmin-ticket761/admin/WebConsole/angular /opt/opengnsys/www/angular
#cd /opt/opengnsys/www/angular
#chown -R vagrant.vagrant .
#su vagrant -c "bower install -F"
@@ -85,15 +90,21 @@ 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 libxss1 policykit-1 python python-requests python-qt4 python-six python-prctl
-#wget -q --no-check-certificate https://#{NETPREFIX}10/opengnsys/descargas/ogagent_1.1.0_all.deb
-#dpkg -i ogagent_1.1.0_all.deb
-#sed -i "0,/remote=/ s,remote=.*,remote=https://#{NETPREFIX}10/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg
+#wget -q --no-check-certificate https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG}
+#if [ -f #{OGAGENTPKG} ]; then
+# dpkg -i #{OGAGENTPKG}
+# apt-get install -fy || exit $?
+# sed -i "0,/remote=/ s,remote=.*,remote=https://#{SERVERIP}/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg
+# rm -f #{OGAGENTPKG}
+#else
+# echo "Warning: cannot install OGAgent package #{OGAGENTPKG}"
+#fi
# Remove network configuration added by Vagrant.
-sed -i "/VAGRANT/,$ d" /etc/network/interfaces
+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.
@@ -131,7 +142,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
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", ip: "#{NETPREFIX}10", virtualbox__intnet: true
+ 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.
@@ -139,12 +150,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end
# Client 1 VM definition.
- config.vm.define "ogClient01", autostart: false do |v1|
+ config.vm.define "pc11", autostart: false do |v1|
v1.vm.box = "bento/ubuntu-16.04"
- v1.vm.hostname = "ogClient01"
- v1.vm.network "private_network", mac: "#{MACPREFIX}01".tr(":",""), type: "dhcp", virtualbox__intnet: true
+ 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 = "ogClient01"
+ vb.name = "pc11"
vb.memory = CLIENTMEM
vb.cpus = 1
vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
@@ -155,13 +166,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Clonable clients definition.
(2..NCLIENTS).each do |i|
- config.vm.define "ogClient0#{i}", autostart: false do |cl|
+ 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}".tr(":","") + "%02d" % "#{i}", type: "dhcp", virtualbox__intnet: true
+ cl.vm.network "private_network", mac: "#{MACPREFIX}#{i+10}".tr(":",""), type: "dhcp", virtualbox__intnet: true
cl.vm.provider "virtualbox" do |vb|
- vb.name = "ogClient0#{i}"
+ vb.name = "pc#{i+10}"
vb.memory = CLIENTMEM
vb.cpus = 1
vb.customize ['modifyvm', :id, '--boot1', 'net', '--boot2', 'disk']
diff --git a/installer/vagrant/Vagrantfile-ogagent-vbox b/installer/vagrant/Vagrantfile-ogagent-vbox
index bdf31f5d..22ddfe54 100644
--- a/installer/vagrant/Vagrantfile-ogagent-vbox
+++ b/installer/vagrant/Vagrantfile-ogagent-vbox
@@ -33,7 +33,7 @@ wget -q https://atom.io/download/rpm -O /tmp/atom.rpm && dnf install -y /tmp/ato
# Comment out next line if you prefer to install Eclipse IDE for Python (it needs more disk space).
#dnf install -y eclipse-pydev eclipse-nls-${LANG%_*}
# Download OGAgent environment installer.
-svn export http://opengnsys.es/svn/branches/version1.1/installer/ogagent-devel-installer.sh /home/vagrant
+svn export https://opengnsys.es/svn/branches/version1.1/installer/ogagent-devel-installer.sh /home/vagrant
# Instructions.
echo "Manual operations:"
echo "- Reboot VM or launch desktop: startxfce4 &"