Skip to content

Instantly share code, notes, and snippets.

@evrardjp
Created June 27, 2018 08:45
Show Gist options
  • Save evrardjp/22019d0d1b3c8592f6c9d3735c3bb6bf to your computer and use it in GitHub Desktop.
Save evrardjp/22019d0d1b3c8592f6c9d3735c3bb6bf to your computer and use it in GitHub Desktop.
Installing vagrant on xenial
apt purge vagrant
wget https://releases.hashicorp.com/vagrant/2.1.1/vagrant_2.1.1_x86_64.deb
apt install ./vagrant_2.1.1_x86_64.deb
vagrant plugin install vagrant-disksize
vagrant box add --name sles12sp3 ./sles12sp3.x86_64-0.0.1.virtualbox-Build3.46.box
required_plugins = [ "vagrant-disksize" ]
required_plugins.each do |plugin|
if not Vagrant.has_plugin?(plugin)
raise "The vagrant plugin #{plugin} is required. Please run `vagrant plugin install #{plugin}`"
end
end
Vagrant.configure(2) do |config|
# Configure all VM specs.
config.vm.provider "virtualbox" do |v|
v.memory = 12288
v.cpus = 4
end
config.vm.synced_folder ".", "/vagrant", type: "rsync"
# Configure the disk size.
disk_size = "80GB"
config.vm.define "xenial" do |xenial|
xenial.vm.box = "ubuntu/xenial64"
xenial.disksize.size = disk_size
config.vm.provision "shell",
privileged: true,
inline: <<-SHELL
apt install -y git
git config --global user.email "[email protected]"
git config --global user.name "Jean-Philippe Evrard"
mkdir -p /home/zuul/src/git.openstack.org/openstack/; cd /home/zuul/src/git.openstack.org/openstack/
#git clone https://github.com/openstack/openstack-ansible-galera_client.git
#cd openstack-ansible-galera_client
#git fetch https://git.openstack.org/openstack/openstack-ansible-galera_client refs/changes/29/567029/2 && git cherry-pick FETCH_HEAD
#cd ..
git clone https://github.com/openstack/openstack-ansible.git; cd openstack-ansible
#git fetch https://git.openstack.org/openstack/openstack-ansible refs/changes/15/573115/1 && git cherry-pick FETCH_HEAD
./scripts/gate-check-commit.sh aio_metal deploy
SHELL
end
config.vm.define "bionic" do |bionic|
bionic.vm.box = "ubuntu/bionic64"
bionic.disksize.size = disk_size
config.vm.provision "shell",
privileged: true,
inline: <<-SHELL
apt install -y git
git config --global user.email "[email protected]"
git config --global user.name "Jean-Philippe Evrard"
mkdir -p /home/zuul/src/git.openstack.org/openstack/; cd /home/zuul/src/git.openstack.org/openstack/
git clone https://github.com/openstack/openstack-ansible-lxc_container_create.git
cd openstack-ansible-lxc_container_create
git fetch https://git.openstack.org/openstack/openstack-ansible-lxc_container_create refs/changes/32/567032/4 && git cherry-pick FETCH_HEAD
./run_tests.sh functional
cd ..
#git clone https://github.com/openstack/openstack-ansible.git; cd openstack-ansible
#./scripts/gate-check-commit.sh
SHELL
end
config.vm.define "leap423" do |leap423|
leap423.disksize.size = disk_size
leap423.vm.box = "opensuse/openSUSE-42.3-x86_64"
leap423.vm.provision "shell",
# NOTE(hwoarang) The parted version in Leap 42.3 can't do an online
# partition resize so we must create a new one and attach it to the
# btrfs filesystem.
privileged: true,
inline: <<-SHELL
echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda
PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}')
resizepart /dev/sda 2 $PART_END
btrfs fi resize max /
zypper install -y git
git config --global user.email "[email protected]"
git config --global user.name "Jean-Philippe Evrard"
mkdir -p /home/zuul/src/git.openstack.org/openstack/; cd /home/zuul/src/git.openstack.org/openstack/
#git clone https://github.com/openstack/openstack-ansible-lxc_container_create.git
#cd openstack-ansible-lxc_container_create
#./run_tests.sh functional
#cd ..
git clone https://github.com/openstack/openstack-ansible.git; cd openstack-ansible
#git fetch https://git.openstack.org/openstack/openstack-ansible refs/changes/84/570384/1 && git cherry-pick FETCH_HEAD
./scripts/gate-check-commit.sh aio_metal deploy
SHELL
end
config.vm.define "sles12sp3" do |sles12sp3|
sles12sp3.disksize.size = disk_size
sles12sp3.vm.box = "sles12sp3"
sles12sp3.vm.provision "shell",
# NOTE(hwoarang) The parted version in Leap 42.3 can't do an online
# partition resize so we must create a new one and attach it to the
# btrfs filesystem.
privileged: true,
inline: <<-SHELL
cd /vagrant
mkdir -p /home/zuul/src/git.openstack.org/openstack/; cd /home/zuul/src/git.openstack.org/openstack/
rm -f openstack-ansible; git clone https://github.com/openstack/openstack-ansible.git; cd openstack-ansible
SHELL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment