summaryrefslogtreecommitdiffstats
path: root/installer/vagrant/Vagrantfile-boottools-vbox
blob: 6a6613185723981c4223fe8124ccbf724e314174 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Vagrantfile to install OpenGnsys boot-tools .1 virtual environment using VirtualBox provider.

VAGRANTFILE_API_VERSION = "2"
# VM provider: Oracle VM VirtualBox.
ENV['VAGRANT_DEFAULT_PROVIDER'] = "virtualbox"
# Language.
LANGUAGE = "es_ES"
ENV['LC_ALL'] = LANGUAGE + ".UTF-8"
# Amount of memory VM.
VMMEM = 1024
# OpenGnsys boot-tools environment provisioning script.
SCRIPT = <<EOT
# 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
# Install dependencies.
apt-get update -y
apt-get install -y subversion
# Prepare environment.
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
echo "Connect to this VM, launch boot-tools generation script and follow instructions:"
echo "    sudo /tmp/opengnsys_installer/opengnsys/client/boot-tools/boottoolsgenerator.sh"
EOT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  # OpenGnsys boot-tools environment VM definition.
  config.vm.define "ogBootTools" do |bt|
    # Specific VirtualBox configuration.
    bt.vm.provider "virtualbox" do |vb|
      # VM name, memory and CPUs.
      vb.name = "ogBootTools"
      vb.memory = VMMEM
      vb.cpus = 1
      vb.gui = true
    end
    # VM base and host name.
    bt.vm.box = "ubuntu/wily32"
    bt.vm.hostname = "ogBootTools"
    # Disable synced folder.
    bt.vm.synced_folder ".", "/vagrant", disabled: true
    # Launch provisioning script.
    bt.vm.provision "shell", inline: SCRIPT
  end

end