mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
59 lines
1.5 KiB
Text
59 lines
1.5 KiB
Text
|
# -*- mode: ruby -*-
|
||
|
# vi: set ft=ruby :
|
||
|
|
||
|
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
||
|
VAGRANTFILE_API_VERSION = "2"
|
||
|
|
||
|
$script = <<SCRIPT
|
||
|
export DEBIAN_FRONTEND=noninteractive
|
||
|
|
||
|
# Configure guest hostname
|
||
|
sudo bash -c 'echo 127.0.1.1 yunohost.yunohost.org yunohost >> /etc/hosts'
|
||
|
sudo hostname yunohost.yunohost.org
|
||
|
sudo bash -c 'echo yunohost.yunohost.org > /etc/hostname'
|
||
|
|
||
|
# Define root password
|
||
|
echo -e "yunohost\nyunohost" | sudo passwd root
|
||
|
|
||
|
# Allow sudo removal (YunoHost use sudo-ldap)
|
||
|
export SUDO_FORCE_REMOVE=yes
|
||
|
|
||
|
# Upgrade guest (done in install script)
|
||
|
sudo apt-get update
|
||
|
sudo apt-get -y --force-yes upgrade
|
||
|
sudo apt-get -y --force-yes dist-upgrade
|
||
|
|
||
|
# Install YunoHost
|
||
|
wget https://raw.githubusercontent.com/YunoHost/install_script/stretch/install_yunohost -q -O /tmp/install_yunohost
|
||
|
sudo bash /tmp/install_yunohost -a -d unstable
|
||
|
|
||
|
# Cleanup
|
||
|
sudo apt-get clean -y
|
||
|
SCRIPT
|
||
|
|
||
|
NETWORK = "10.0.3."
|
||
|
|
||
|
HOSTS = {
|
||
|
"ynh-dev" => ["83", "stretch64"],
|
||
|
"ynh-dev-buster" => ["84", "testing64"],
|
||
|
}
|
||
|
|
||
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||
|
|
||
|
HOSTS.each do | (name, cfg) |
|
||
|
|
||
|
ipaddr, box = cfg
|
||
|
|
||
|
config.vm.define name do |machine|
|
||
|
machine.vm.box = "debian/" + box
|
||
|
machine.vm.provision "shell" do |s|
|
||
|
s.inline = $script
|
||
|
s.args = ""
|
||
|
end
|
||
|
machine.vm.provider "lxc" do |lxc|
|
||
|
machine.vm.network :private_network, ip: NETWORK + ipaddr, lxc__bridge_name: 'lxcbr0'
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|