-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
49 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
cookbook "yum", "< 3.0.0" | ||
|
||
site :opscode | ||
|
||
metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,69 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# vi: set ft=ruby tabstop=2 : | ||
require 'vagrant-openstack-plugin' | ||
require 'vagrant-omnibus' | ||
require 'vagrant-berkshelf' | ||
|
||
box_ver = "20140121" | ||
box_url = "http://vagrant.osuosl.org/centos-6-#{box_ver}.box" | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true | ||
config.vm.box = "centos-6-#{box_ver}" | ||
config.vm.hostname = "osl-packstack-berkshelf" | ||
config.vm.box_url = "#{box_url}" | ||
|
||
# Set the vm hostname | ||
config.vm.hostname = "osl-packstack-berkshelf" | ||
config.vm.provider "openstack" do |os, override| | ||
# Your openstack ssh private key location | ||
override.ssh.private_key_path = "#{ENV['OS_SSH_KEY']}" | ||
override.ssh.host = "#{ENV['OS_FLOATING_IP']}" | ||
override.vm.box = "openstack" | ||
override.vm.box_url = "http://vagrant.osuosl.org/openstack.box" | ||
|
||
# Download the openstack box | ||
config.vm.box = "openstack" | ||
config.vm.box_url = "http://packages.osuosl.org/vagrant/openstack.box" | ||
os.username = "#{ENV['OS_USERNAME']}" | ||
os.flavor = /m1.tiny/ | ||
os.image = "CentOS 6.5" | ||
os.endpoint = "http://10.1.0.27:35357/v2.0/tokens" | ||
os.keypair_name = "#{ENV['OS_SSH_KEYPAIR']}" | ||
os.ssh_username = "centos" | ||
os.security_groups = ['default'] | ||
os.tenant = "OSL" | ||
os.server_name = "#{ENV['USER']}-openstack" | ||
os.floating_ip = "#{ENV['OS_FLOATING_IP']}" | ||
end | ||
|
||
# Install chef omnibus | ||
config.omnibus.chef_version = :latest | ||
# The path to the Berksfile to use with Vagrant Berkshelf | ||
# config.berkshelf.berksfile_path = "./Berksfile" | ||
|
||
# Enable berkshelf | ||
# Enabling the Berkshelf plugin. To enable this globally, add this configuration | ||
# option to your ~/.vagrant.d/Vagrantfile file | ||
config.berkshelf.enabled = true | ||
|
||
# Setup ssh key stuff for sshing into the vm | ||
config.ssh.private_key_path = "#{ENV['OS_SSH_KEY']}" # Your openstack ssh private key location | ||
|
||
# Tell vagrant the IP to ssh to | ||
config.ssh.host = "#{ENV['OS_FLOATING_IP']}" | ||
|
||
# Set OpenStack Variables for instance creation | ||
config.vm.provider :openstack do |os| | ||
os.username = "#{ENV['OS_USERNAME']}" # OpenStack username | ||
os.flavor = /m1.tiny/ # Change this based upon you resource requirements | ||
os.image = "CentOS 6.4" | ||
os.endpoint = "http://10.1.0.27:35357/v2.0/tokens" | ||
os.keypair_name = "#{ENV['OS_SSH_KEYPAIR']}" # Name of you ssh keypair that you setup in the browser (should be your username) | ||
os.ssh_username = "centos" # login for the VM | ||
os.security_groups = ['default'] # add different security groups here for different ports | ||
os.tenant = "OSL" # always use OSL as the tenant | ||
os.server_name = "#{ENV['USER']}-openstack" # label for the instance | ||
os.floating_ip = "#{ENV['OS_FLOATING_IP']}" # instance floating ip, make sure you claim from dns | ||
end | ||
# An array of symbols representing groups of cookbook described in the Vagrantfile | ||
# to exclusively install and copy to Vagrant's shelf. | ||
# config.berkshelf.only = [] | ||
|
||
# An array of symbols representing groups of cookbook described in the Vagrantfile | ||
# to skip installing and copying to Vagrant's shelf. | ||
# config.berkshelf.except = [] | ||
|
||
config.omnibus.chef_version = :latest | ||
|
||
config.vm.provision "chef_solo" do |chef| | ||
|
||
chef.data_bags_path = "#{ENV['HOME']}/git/chef-repo/data_bags" | ||
chef.encrypted_data_bag_secret_key_path = "#{ENV['HOME']}/.chef/encrypted_data_bag_secret" | ||
|
||
# Chef solo provisioning | ||
config.vm.provision :chef_solo do |chef| | ||
chef.json = { | ||
:mysql => { | ||
:server_root_password => 'rootpass', | ||
:server_debian_password => 'debpass', | ||
:server_repl_password => 'replpass' | ||
} | ||
} | ||
|
||
# If using data bags, tell vagrant where they are located | ||
chef.data_bags_path = "/home/#{ENV['USER']}/git/chef-repo/data_bags" | ||
|
||
# If using encrypted data bags, make sure you tell vagrant where the secret key is | ||
chef.encrypted_data_bag_secret_key_path = "/home/#{ENV['USER']}/.chef/encrypted_data_bag_secret" | ||
|
||
chef.run_list = [ | ||
"recipe[osl-packstack::default]" | ||
"recipe[osl-packstack::default]" | ||
] | ||
end | ||
end | ||
end |