[vagrant] Use debian/jessie64 as vagrantbox
authorVarac <varac@leap.se>
Mon, 5 Mar 2018 11:13:44 +0000 (12:13 +0100)
committerVarac <varac@leap.se>
Mon, 5 Mar 2018 12:03:24 +0000 (13:03 +0100)
Resolves: #8909

tests/example-provider/README.md
tests/example-provider/Vagrantfile
tests/example-provider/vagrant/initialize.sh [new file with mode: 0644]

index 80cb3ae..6d073d9 100644 (file)
@@ -1,8 +1,11 @@
-Here lies a script to generate a pre-configured provider using Vagrant virtual
-machines. This virtual provider includes only a single node.
+# Run LEAP provider locally with Vagrant
+
+You can use Vagrant to start a pre-configured example provider.
+This virtual provider includes only a single node.
+See [LEAP Vagrant documentation](https://leap.se/en/docs/platform/tutorials/vagrant) for more
+details.
 
 All you have to do is this:
 
     cd leap_platform/tests/example-provider
     vagrant up
-
index e909e79..dbd3018 100644 (file)
@@ -12,7 +12,7 @@ Vagrant.configure("2") do |config|
   # Please verify the sha512 sum of the downloaded box before importing it into vagrant !
   # see https://leap.se/en/docs/platform/details/development#Verify.vagrantbox.download
   # for details
-  config.vm.box = "LEAP/jessie"
+  config.vm.box = "debian/jessie64"
 
   config.vm.provider "virtualbox" do |v|
     v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@@ -31,12 +31,16 @@ Vagrant.configure("2") do |config|
     s.inline     = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
   end
 
+  config.vm.provision "shell", path: "vagrant/initialize.sh"
   config.vm.provision "puppet" do |puppet|
     puppet.manifests_path    = "./vagrant"
     puppet.module_path       = "../../puppet/modules"
     puppet.manifest_file     = "install-platform.pp"
     puppet.options           = "--verbose"
     puppet.hiera_config_path = "./hiera.yaml"
+    puppet.environment_variables = {
+      :LANG => "en_US.UTF-8"
+    }
   end
   config.vm.provision "shell", path: "vagrant/configure-leap.sh"
 
diff --git a/tests/example-provider/vagrant/initialize.sh b/tests/example-provider/vagrant/initialize.sh
new file mode 100644 (file)
index 0000000..5f87af6
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -euxo pipefail
+
+echo -e "deb http://deb.debian.org/debian/ jessie main \ndeb http://security.debian.org/ jessie/updates main" > /etc/apt/sources.list
+apt-get update
+apt-get install -y --no-install-recommends puppet
+echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
+echo "LANG=en_US.UTF-8" > /etc/default/locale
+echo 'LC_ALL=en_US.UTF-8' >> /etc/environment
+locale-gen
+update-locale