summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2021-02-25 18:22:43 +0100
committerRamón M. Gómez <ramongomez@us.es>2021-02-25 18:22:43 +0100
commitfa46368c6c273cf47097ce3b08798ec538dfcedc (patch)
tree351412d35bf84042b5b3ed41eb61d0671bb26f1e
parent69fd9c1714660848714351e95a7f28aee115c723 (diff)
#997: Vagrant files adapted to use ogServer REST API to assign PXE template to defined clients.
-rw-r--r--installer/vagrant/Vagrantfile-1.2.0-vbox11
-rw-r--r--installer/vagrant/Vagrantfile-master-vbox11
2 files changed, 12 insertions, 10 deletions
diff --git a/installer/vagrant/Vagrantfile-1.2.0-vbox b/installer/vagrant/Vagrantfile-1.2.0-vbox
index 76067cb6..3cecfdd2 100644
--- a/installer/vagrant/Vagrantfile-1.2.0-vbox
+++ b/installer/vagrant/Vagrantfile-1.2.0-vbox
@@ -38,7 +38,7 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then
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
+ mount -t ext4 /dev/mapper/og-images /opt/opengnsys/images
fi
# Install OpenGnsys and change server address.
if which curl &>/dev/null; then
@@ -68,10 +68,11 @@ dpkg-reconfigure -fnoninteractive console-setup
# 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
+#read -pe PORT TOKEN <<< $(jq -r '.rest.port+" "+.rest.api_token' /opt/opengnsys/etc/ogserver.json)
+#DATA='{"clients": ["#{NETPREFIX}.11"], "mode": "19pxeADMIN"}'
+#curl -ks -H "Authorization: $TOKEN" -d "$DATA" "http://localhost:$PORT/mode"
+#DATA='{"clients": ["#{NETPREFIX}.'$(seq -s '", "#{NETPREFIX}.' 12 #{NCLIENTS+10})'"], "mode": "pxe"}'
+#curl -ks -H "Authorization: $TOKEN" -d "$DATA" "http://localhost:$PORT/mode"
echo "Notes:"
echo "- OpenGnsys Server URL: https://localhost:#{LOCALWEBPORT}/opengnsys/"
exit 0
diff --git a/installer/vagrant/Vagrantfile-master-vbox b/installer/vagrant/Vagrantfile-master-vbox
index 164ab93c..432e1bb7 100644
--- a/installer/vagrant/Vagrantfile-master-vbox
+++ b/installer/vagrant/Vagrantfile-master-vbox
@@ -37,7 +37,7 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then
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
+ mount -t ext4 /dev/mapper/og-images /opt/opengnsys/images
fi
# Install OpenGnsys and change server address.
if which curl &>/dev/null; then
@@ -67,10 +67,11 @@ dpkg-reconfigure -fnoninteractive console-setup
# 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
+#read -pe PORT TOKEN <<< $(jq -r '.rest.port+" "+.rest.api_token' /opt/opengnsys/etc/ogserver.json)
+#DATA='{"clients": ["#{NETPREFIX}.11"], "mode": "19pxeADMIN"}'
+#curl -ks -H "Authorization: $TOKEN" -d "$DATA" "http://localhost:$PORT/mode"
+#DATA='{"clients": ["#{NETPREFIX}.'$(seq -s '", "#{NETPREFIX}.' 12 #{NCLIENTS+10})'"], "mode": "pxe"}'
+#curl -ks -H "Authorization: $TOKEN" -d "$DATA" "http://localhost:$PORT/mode"
echo "Notes:"
echo "- OpenGnsys Server URL: https://localhost:#{LOCALWEBPORT}/opengnsys/"
exit 0