Adding RabbitMQ detection and setup

Also added mySQL fix for the devstack machine to install the credential file

Change-Id: Ie863eda5c498d1e09f1b22bf052babc573d4eafa
This commit is contained in:
gary-hessler 2014-09-02 09:55:34 -06:00
parent c70f1f8a6a
commit 40c6e01f5f
10 changed files with 80 additions and 2 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ hlinux/templates/output-virtualbox-iso
hlinux/templates/packer_cache
.pydevproject
.idea
.settings
*.deb
*.pyc
utils/cluster/data_bags/vertica/ssh_key.json

View File

@ -4,4 +4,4 @@ maintainer_email "hpcs-mon@hp.com"
license "All rights reserved"
description "Customizes devstack server for use with mini-mon"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.5"
version "0.0.6"

View File

@ -0,0 +1,38 @@
plugin_config = data_bag_item('devstack', 'agent_plugin_config')
service "rabbitmq-server" do
action :nothing
supports :status => true, :start => true, :stop => true, :restart => true
end
execute "enable-rabbitmq-web-mgmt" do
command "/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management"
not_if "/usr/lib/rabbitmq/bin/rabbitmq-plugins list -e | grep rabbitmq_management"
not_if { ::File.file?('/root/.rabbitmq.cnf') }
notifies :restart, "service[rabbitmq-server]", :delayed
end
template "/root/.rabbitmq.cnf" do
action :create
source "rabbitmq.cnf.erb"
owner 'root'
group 'root'
mode 0600
not_if { ::File.file?('/root/.rabbitmq.cnf') }
variables(
:plugin_config => plugin_config
)
end
include_recipe "mini-mon::mysql_client"
template "/root/.my.cnf" do
action :create
source "my.cnf.erb"
owner 'root'
group 'root'
mode 0600
not_if { ::File.directory?('/root/.my.cnf') }
variables(
:plugin_config => plugin_config
)
end

View File

@ -0,0 +1,3 @@
[client]
user=<%= @plugin_config['mysql']['user'] %>
password=<%= @plugin_config['mysql']['password'] %>

View File

@ -0,0 +1,6 @@
[client]
user=<%= @plugin_config['rabbitmq']['user'] %>
password=<%= @plugin_config['rabbitmq']['password'] %>
nodes=<%= @plugin_config['rabbitmq']['nodes'] %>
queues=<%= @plugin_config['rabbitmq']['queues'] %>
exchanges=<%= @plugin_config['rabbitmq']['exchanges'] %>

View File

@ -4,5 +4,5 @@ maintainer_email "hpcs-mon@hp.com"
license "All rights reserved"
description "Base setup for all vagrant boxes"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.2"
version "0.1.3"
depends "apt"

View File

@ -0,0 +1,14 @@
{
"id" : "agent_plugin_config",
"mysql": {
"user": "root",
"password": "pass"
},
"rabbitmq": {
"user": "guest",
"password": "pass",
"nodes": "rabbit@devstack",
"queues": "conductor",
"exchanges": "nova,cinder,ceilometer,glance,keystone,neutron,heat,ironic,openstack"
}
}

View File

@ -13,6 +13,7 @@
"run_list": [
"recipe[devstack::mon-ui]",
"recipe[devstack::keystone]",
"recipe[devstack::agent_plugin_config]",
"recipe[monasca_agent]"
],
"env_run_lists": {

View File

@ -0,0 +1,14 @@
{
"id" : "agent_plugin_config",
"mysql": {
"user": "root",
"password": "pass"
},
"rabbitmq": {
"user": "guest",
"password": "pass",
"nodes": "rabbit@devstack",
"queues": "conductor",
"exchanges": "nova,cinder,ceilometer,glance,keystone,neutron,heat,ironic,openstack"
}
}

View File

@ -13,6 +13,7 @@
"run_list": [
"recipe[devstack::mon-ui]",
"recipe[devstack::keystone]",
"recipe[devstack::agent_plugin_config]",
"recipe[monasca_agent]"
],
"env_run_lists": {