From 712f0b0e23c15314ed60f72802e72bb3688d2c8c Mon Sep 17 00:00:00 2001 From: Varac Date: Mon, 5 Mar 2018 12:13:44 +0100 Subject: [vagrant] Use debian/jessie64 as vagrantbox Resolves: #8909 --- tests/example-provider/README.md | 9 ++++++--- tests/example-provider/Vagrantfile | 6 +++++- tests/example-provider/vagrant/initialize.sh | 12 ++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 tests/example-provider/vagrant/initialize.sh (limited to 'tests') diff --git a/tests/example-provider/README.md b/tests/example-provider/README.md index 80cb3ae9..6d073d9f 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 e909e79b..dbd30185 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 00000000..5f87af6c --- /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 -- cgit v1.2.3