Adds misc options

This change adds support for miscellaneous options to be set.
Things that haven't been added as attributes, or specifically,
third party additions that don't belong in stackforge (e.g. cobalt)

Change-Id: Ibea4076b4e715cec6d2eaf5ac71c36aebf2957d7
This commit is contained in:
alop 2013-12-18 16:23:30 -08:00
parent ae9dafb73b
commit cc72578678
6 changed files with 45 additions and 0 deletions

View File

@ -237,6 +237,13 @@ OSAPI Compute Extentions
* `openstack["compute"]["plugins"]` - Array of osapi compute exntesions to add to nova
Miscellaneous Options
---------------------
* `openstack["compute"]["misc_nova"]` - Array of bare options for nova.conf (e.g. 'option=value')
* `openstack["compute"]["misc_paste"]` - Array of bare options for api-paste.ini (e.g. 'option=value')
* `openstack["compute"]["misc_openrc"]` - Array of bare options for openrc (e.g. 'option=value')
EC2 Configuration Attributes
----------------------------

View File

@ -374,6 +374,9 @@ end
# plugins
default["openstack"]["compute"]["plugins"] = nil
default["openstack"]["compute"]["misc_nova"] = nil
default["openstack"]["compute"]["misc_paste"] = nil
default["openstack"]["compute"]["misc_openrc"] = nil
# To disable the EC2 API endpoint, simply remove "ec2," from the list
# of enabled API services.

View File

@ -129,6 +129,12 @@ describe "openstack-compute::nova-common" do
"auto_assign_floating_ip=false")
end
it "has misc option" do
@chef_run.node.set['openstack']['compute']['misc_nova'] = ["MISC_OPTION","FOO"]
expect(@chef_run).to render_file(@filename).with_content(
"MISC_OPTION")
end
context "qpid" do
before {
@chef_run.node.set['openstack']['compute']['mq']['service_type'] = "qpid"
@ -300,6 +306,12 @@ describe "openstack-compute::nova-common" do
end
end
it "has misc option" do
@chef_run.node.set['openstack']['compute']['misc_openrc'] = ["MISC_OPTION", "FOO"]
expect(@chef_run).to render_file(@filename).with_content(
"MISC_OPTION")
end
it "rest of template contents" do
pending "TODO: implement"
end

View File

@ -117,3 +117,13 @@ admin_tenant_name = <%= node["openstack"]["compute"]["service_tenant_name"] %>
admin_user = <%= node["openstack"]["compute"]["service_user"] %>
admin_password = <%= @service_pass %>
signing_dir = <%= node["openstack"]["compute"]["api"]["auth"]["cache_dir"] %>
<% if node["openstack"]["compute"]["misc_paste"] %>
########
# Misc #
########
<% node["openstack"]["compute"]["misc_paste"].each do |m| %>
<%= m %>
<% end %>
<% end %>

View File

@ -263,6 +263,12 @@ osapi_compute_extension=<%= p %>
<% end %>
<% end %>
<% if node["openstack"]["compute"]["misc_nova"] %>
<% node["openstack"]["compute"]["misc_nova"].each do |m| %>
<%= m %>
<% end %>
<% end %>
[conductor]
use_local=<%= node["openstack"]["compute"]["conductor"]["use_local"] %>

View File

@ -21,3 +21,10 @@ export NOVA_REGION_NAME=<%= node["openstack"]["compute"]["region"] %>
export EC2_ACCESS_KEY=<%= node["credentials"]["EC2"]["admin"]["access"] %>
export EC2_SECRET_KEY=<%= node["credentials"]["EC2"]["admin"]["secret"] %>
export EC2_URL=<%= @ec2_url %>
<% if node["openstack"]["compute"]["misc_openrc"] %>
# Misc options
<% node["openstack"]["compute"]["misc_openrc"].each do |m| %>
<%= m %>
<% end %>
<% end %>