This repository has been archived by the owner on Aug 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Vagrant VM for development purposes.
This patch will make development quite a bit easier, by allowing a new developer to just "spin up" a vm that contains all of storyboard's service dependencies. Change-Id: Iabd2043b21721966cb86d076488317d815315827
- Loading branch information
1 parent
0fb9502
commit 4e1bcdc
Showing
5 changed files
with
140 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -57,6 +57,7 @@ ChangeLog | |
|
||
# Local settings | ||
etc/storyboard.conf | ||
.vagrant | ||
|
||
# IDE settings | ||
.idea | ||
|
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
config.vm.box = "trusty64" | ||
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" | ||
|
||
config.vm.network :forwarded_port, host_ip: '127.0.0.1', guest: 3306, host: 3306 | ||
config.vm.network :forwarded_port, host_ip: '127.0.0.1', guest: 15672, host: 15672 | ||
config.vm.network :forwarded_port, host_ip: '127.0.0.1', guest: 5672, host: 5672 | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.name = "storyboard_dev" | ||
end | ||
|
||
config.vm.provision "shell", path: "vagrant/bootstrap.sh" | ||
|
||
config.vm.provision :puppet do |puppet| | ||
puppet.manifests_path = "vagrant/puppet/manifests" | ||
puppet.manifest_file = "site.pp" | ||
puppet.options="--verbose --debug" | ||
end | ||
end |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
apt-get update | ||
apt-get install puppet | ||
|
||
if [ ! -d "/etc/puppet/modules/mysql" ]; then | ||
puppet module install puppetlabs-mysql --version 0.6.1 | ||
fi | ||
|
||
if [ ! -d "/etc/puppet/modules/rabbitmq" ]; then | ||
puppet module install puppetlabs-rabbitmq --version 4.1.0 | ||
fi | ||
|
||
if [ ! -d "/etc/puppet/modules/erlang" ]; then | ||
puppet module install garethr-erlang --version 0.3.0 | ||
fi | ||
|
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
node default { | ||
$dev_user = 'storyboard' | ||
$dev_password = 'storyboard' | ||
|
||
include 'erlang' | ||
package { 'erlang-base': | ||
ensure => 'latest', | ||
before => Class['rabbitmq'] | ||
} | ||
|
||
########################################################## | ||
## | ||
## RabbitMQ | ||
## | ||
class { 'rabbitmq': | ||
service_manage => true, | ||
manage_repos => false, | ||
delete_guest_user => true, | ||
default_user => $dev_user, | ||
default_pass => $dev_password, | ||
} | ||
|
||
rabbitmq_user { $dev_user: | ||
ensure => present, | ||
admin => true, | ||
password => $dev_password, | ||
require => Class['rabbitmq'] | ||
} | ||
|
||
rabbitmq_user_permissions { "${dev_user}@/": | ||
configure_permission => '.*', | ||
read_permission => '.*', | ||
write_permission => '.*', | ||
require => Rabbitmq_user[$dev_user], | ||
} | ||
|
||
########################################################## | ||
## | ||
## MySQL | ||
## | ||
class {'mysql::server': | ||
config_hash => { | ||
bind_address => '0.0.0.0' | ||
} | ||
} | ||
|
||
mysql::db { 'storyboard': | ||
user => $dev_user, | ||
password => $dev_password, | ||
host => '%', | ||
} | ||
|
||
database_user{ 'openstack_citest@%': | ||
ensure => present, | ||
password_hash => mysql_password('openstack_citest'), | ||
require => Class['mysql::server'], | ||
} | ||
|
||
database_grant{ 'openstack_citest@%/storyboard\_test\_db\_%': | ||
privileges => ['ALL'], | ||
require => Database_user['openstack_citest@%'] | ||
} | ||
} |