Added a Vagrant module and manifest for easier development.

Vagrant file will provision the configuration it finds in vagrant.pp.
Node configurations for precise and trusty provided, on different IP
addresses.

Change-Id: I7b08ce4cc5acdc2ad58261f4872ba2df2e06dcf4
This commit is contained in:
Michael Krotscheck 2015-02-19 09:50:33 -08:00
parent 685db01ec1
commit 380937f5a1
4 changed files with 96 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.vagrant

45
Vagrantfile vendored Normal file
View File

@ -0,0 +1,45 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Create an ubuntu/precise box against which we can run our module.
config.vm.define "precise" do |precise|
# Define the box.
precise.vm.box = "ubuntu/precise64"
precise.vm.hostname = "puppet-storyboard-precise64"
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id,'--memory', '2048']
vb.name = 'puppet-storyboard-precise64'
end
# Grant a private IP
precise.vm.network "private_network", ip: "192.168.99.22"
end
# Create an ubuntu/trusty box against which we can run our module.
config.vm.define "trusty" do |trusty|
# Define the box.
trusty.vm.box = "ubuntu/trusty64"
trusty.vm.hostname = "puppet-storyboard-trusty64"
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id,'--memory', '2048']
vb.name = 'puppet-storyboard-trusty64'
end
# Grant a private IP
trusty.vm.network "private_network", ip: "192.168.99.23"
end
# All VM's run the same provisioning
config.vm.provision "shell", path: "vagrant.sh"
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = ['vm', "/vagrant"]
puppet.manifest_file = "vagrant.pp"
end
end

15
vagrant.pp Normal file
View File

@ -0,0 +1,15 @@
node 'puppet-storyboard-precise64' {
class { 'storyboard':
mysql_user_password => 'storyboard',
rabbitmq_user_password => 'storyboard',
hostname => '192.168.99.22',
}
}
node 'puppet-storyboard-trusty64' {
class { 'storyboard':
mysql_user_password => 'storyboard',
rabbitmq_user_password => 'storyboard',
hostname => '192.168.99.23',
}
}

35
vagrant.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/sh
# Install Puppet!
if [ ! -f /etc/apt/sources.list.d/puppetlabs.list ]; then
lsbdistcodename=`lsb_release -c -s`
wget https://apt.puppetlabs.com/puppetlabs-release-${lsbdistcodename}.deb
sudo dpkg -i puppetlabs-release-${lsbdistcodename}.deb
sudo apt-get update
sudo apt-get dist-upgrade -y
fi
if [ ! -d /etc/puppet/modules/stdlib ]; then
puppet module install puppetlabs-stdlib --version 3.2.0
fi
if [ ! -d /etc/puppet/modules/mysql ]; then
puppet module install puppetlabs-mysql --version 0.6.1
fi
if [ ! -d /etc/puppet/modules/apache ]; then
puppet module install puppetlabs-apache --version 0.0.4
fi
if [ ! -d /etc/puppet/modules/rabbitmq ]; then
puppet module install puppetlabs-rabbitmq --version 5.0.0
fi
if [ ! -d /etc/puppet/modules/puppi ]; then
puppet module install example42-puppi --version 2.1.9
fi
if [ ! -d /etc/puppet/modules/vcsrepo ]; then
puppet module install openstackci-vcsrepo --version 0.0.8
fi
if [ ! -d /etc/puppet/modules/python ]; then
puppet module install stankevich-python --version 1.6.6
fi
if [ ! -d /etc/puppet/modules/storyboard ]; then
sudo ln -s /vagrant /etc/puppet/modules/storyboard
fi