Ensure the node[openstack][mq] attributes push to the services that use rabbitmq
The node[openstack][*][rabbit] attributes for all the services using rabbitmq (block-storage, compute, image, metering, network) should default to the same values as node[openstack][mq]. Bumping the major version accordingly. Change-Id: Id20a48a3ef2506622239e8e6f15ce1f76060b828
This commit is contained in:
parent
d57a3c64e0
commit
3ff43e644f
15
CHANGELOG.md
15
CHANGELOG.md
@ -1,4 +1,19 @@
|
||||
# CHANGELOG for cookbook-openstack-ops-messaging
|
||||
|
||||
This file is used to list changes made in each version of cookbook-openstack-ops-messaging.
|
||||
|
||||
## 7.0.1:
|
||||
|
||||
* default the node['openstack'][*]['rabbit'] attributes for all the services
|
||||
using rabbitmq (block-storage, compute, image, metering, network) to whatever
|
||||
node['openstack']['mq'] attributes are set.
|
||||
|
||||
## 7.0.0
|
||||
|
||||
* Initial release intended for Grizzly-based OpenStack releases,
|
||||
for use with Stackforge upstream repositories.
|
||||
|
||||
- - -
|
||||
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
|
||||
|
||||
The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.
|
||||
|
@ -3,6 +3,7 @@
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2013, AT&T Services, Inc.
|
||||
# Copyright 2013, Opscode, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@ -19,3 +20,10 @@
|
||||
|
||||
default["openstack"]["mq"]["bind_interface"] = "lo"
|
||||
default["openstack"]["mq"]["cluster"] = false
|
||||
|
||||
['block-storage', 'compute', 'image', 'metering', 'network'].each do |service|
|
||||
default['openstack'][service]['rabbit']['host'] = node['openstack']['mq']['listen']
|
||||
default['openstack'][service]['rabbit']['port'] = node['openstack']['mq']['port']
|
||||
default['openstack'][service]['rabbit']['username'] = node['openstack']['mq']['user']
|
||||
default['openstack'][service]['rabbit']['vhost'] = node['openstack']['mq']['vhost']
|
||||
end
|
||||
|
@ -3,7 +3,7 @@ maintainer "Opscode, Inc."
|
||||
maintainer_email "matt@opscode.com"
|
||||
license "Apache 2.0"
|
||||
description "Provides the shared messaging configuration for Chef for OpenStack."
|
||||
version "7.0.0"
|
||||
version "7.1.0"
|
||||
|
||||
recipe "server", "Installs and configures server packages for messaging queue used by the deployment."
|
||||
recipe "rabbitmq-server", "Installs and configures RabbitMQ and is called via the server recipe"
|
||||
|
@ -16,6 +16,25 @@ describe "openstack-ops-messaging::rabbitmq-server" do
|
||||
expect(@chef_run.node['rabbitmq']['default_pass']).to eql "rabbit-pass"
|
||||
end
|
||||
|
||||
it "overrides rabbit and openstack image attributes" do
|
||||
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n|
|
||||
n.set['openstack']['mq']['bind_interface'] = 'eth0'
|
||||
n.set['openstack']['mq']['port'] = '4242'
|
||||
n.set['openstack']['mq']['user'] = 'foo'
|
||||
n.set['openstack']['mq']['vhost'] = '/bar'
|
||||
end
|
||||
|
||||
chef_run.converge "openstack-ops-messaging::rabbitmq-server"
|
||||
|
||||
expect(chef_run.node['openstack']['mq']['listen']).to eql '33.44.55.66'
|
||||
expect(chef_run.node['openstack']['mq']['port']).to eql '4242'
|
||||
expect(chef_run.node['openstack']['mq']['user']).to eql 'foo'
|
||||
expect(chef_run.node['openstack']['mq']['vhost']).to eql '/bar'
|
||||
expect(chef_run.node['openstack']['image']['rabbit']['port']).to eql '4242'
|
||||
expect(chef_run.node['openstack']['image']['rabbit']['username']).to eql 'foo'
|
||||
expect(chef_run.node['openstack']['image']['rabbit']['vhost']).to eql '/bar'
|
||||
end
|
||||
|
||||
describe "cluster" do
|
||||
before do
|
||||
@chef_run = ::ChefSpec::ChefRunner.new(::UBUNTU_OPTS) do |n|
|
||||
|
@ -16,12 +16,15 @@ def ops_messaging_stubs
|
||||
::Chef::Recipe.any_instance.stub(:address_for).
|
||||
with("lo").
|
||||
and_return "127.0.0.1"
|
||||
::Chef::Recipe.any_instance.stub(:address_for).
|
||||
with("eth0").
|
||||
and_return "33.44.55.66"
|
||||
::Chef::Recipe.any_instance.stub(:search).
|
||||
with(:node, "roles:os-ops-messaging AND chef_environment:_default").
|
||||
and_return [
|
||||
{ 'hostname' => 'host2' },
|
||||
{ 'hostname' => 'host1' }
|
||||
]
|
||||
{ 'hostname' => 'host2' },
|
||||
{ 'hostname' => 'host1' }
|
||||
]
|
||||
::Chef::Recipe.any_instance.stub(:user_password).
|
||||
and_return "rabbit-pass"
|
||||
::Chef::Recipe.any_instance.stub(:service_password).
|
||||
|
Loading…
x
Reference in New Issue
Block a user