diff --git a/tests/example-provider/README.md b/tests/example-provider/README.md index 80cb3ae987677311b7f752766801c11e2fe64eae..6d073d9f2b21d4aaa3b195fac1c42d6e0503a79e 100644 --- a/tests/example-provider/README.md +++ b/tests/example-provider/README.md @@ -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 - diff --git a/tests/example-provider/Vagrantfile b/tests/example-provider/Vagrantfile index e909e79b898fb8a1b221a2d5afe2ffee7f414418..dbd3018538fd0229888148f6499fd17101e06bda 100644 --- a/tests/example-provider/Vagrantfile +++ b/tests/example-provider/Vagrantfile @@ -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 index 0000000000000000000000000000000000000000..5f87af6c4f73105f2b0525b5f364fd532168b0f0 --- /dev/null +++ b/tests/example-provider/vagrant/initialize.sh @@ -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