Skip to content

Instantly share code, notes, and snippets.

@cp16net
Created February 2, 2016 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cp16net/7cf58aa6cc567936bfd0 to your computer and use it in GitHub Desktop.
Save cp16net/7cf58aa6cc567936bfd0 to your computer and use it in GitHub Desktop.
Vagrant file to create MariaDB 10.1 install of 2 instances.
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'
Vagrant.configure(2) do |config|
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :machine
end
config.vm.box = "ubuntu-1404-server"
config.vm.provider :libvirt do |domain|
domain.memory = 1024
domain.cpus = 1
end
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y software-properties-common
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
add-apt-repository 'deb [arch=amd64,i386] http://ftp.utexas.edu/mariadb/repo/10.1/ubuntu trusty main'
apt-get update
export DEBIAN_FRONTEND=noninteractive
debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password password password'
debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password_again password password'
apt-get install -y mariadb-server
service mysql stop
cp /vagrant/mariadb-cluster.cnf /etc/mysql/conf.d/
SHELL
config.vm.define :mariadb1 do |machine|
machine.vm.network "private_network", ip: '192.168.33.10'
end
config.vm.define :mariadb2 do |machine|
machine.vm.network "private_network", ip: '192.168.33.11'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment