From eeff4d73a088cd5a0b323ade7d9af4b83350949b Mon Sep 17 00:00:00 2001 From: Chen Zhiwei Date: Fri, 10 Oct 2014 05:43:15 +0000 Subject: [PATCH] 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. Change-Id: I482c5d15e5d1ad853d1a1792f3e39a45f7911dd4 --- CHANGELOG.md | 1 + README.md | 7 +++++++ attributes/default.rb | 3 +++ spec/common_spec.rb | 10 ++++++++++ templates/default/heat.conf.erb | 6 ++++++ 5 files changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72e3b76..06dee66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This file is used to list changes made in each version of cookbook-openstack-orc * Create role and domain setup for heat template defined users * Add cert_file, key_file, ca_file and insecure for clients so that they are configurable. * Make 3 schemes configurable instead of being the hardcoded http +* Add misc options for heat.conf ## 9.2.0 * python_packages database client attributes have been migrated to diff --git a/README.md b/README.md index 3135075..750c482 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,13 @@ The following attributes are defined in attributes/default.rb of the common cook If the value of the 'bind_interface' attribute is non-nil, then the service will be bound to the first IP address on that interface. If the value of the 'bind_interface' attribute is nil, then the service will be bound to the IP address specifie> +Miscellaneous Options +--------------------- + +Arrays whose elements will be copied exactly into the respective config files (contents e.g. ['option1=value1', 'option2=value2']). + +* `openstack["orchestration"]["misc_heat"]` - Array of bare options for `heat.conf`. + Testing ===== diff --git a/attributes/default.rb b/attributes/default.rb index 4a023d8..3b4db5b 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -112,6 +112,9 @@ default['openstack']['orchestration']['default_publisher_id'] = '' default['openstack']['orchestration']['list_notifier_drivers'] = 'heat.openstack.common.notifier.no_op_notifier' default['openstack']['orchestration']['notification_topics'] = 'notifications' +# Array of options for `heat.conf` (e.g. ['option1=value1', 'option2=value2']) +default['openstack']['orchestration']['misc_heat'] = nil + # platform-specific settings case platform_family when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this diff --git a/spec/common_spec.rb b/spec/common_spec.rb index 1d6b6b7..64d2a33 100644 --- a/spec/common_spec.rb +++ b/spec/common_spec.rb @@ -31,5 +31,15 @@ describe 'openstack-orchestration::common' do expect(chef_run).not_to upgrade_package 'python-ibm-db' expect(chef_run).not_to upgrade_package 'python-ibm-db-sa' end + + describe 'heat.conf' do + let(:file) { chef_run.template('/etc/heat/heat.conf') } + + it 'adds misc_heat array correctly' do + node.set['openstack']['orchestration']['misc_heat'] = ['MISC_OPTION=FOO'] + expect(chef_run).to render_file(file.name).with_content('MISC_OPTION=FOO') + end + + end end end diff --git a/templates/default/heat.conf.erb b/templates/default/heat.conf.erb index 175e9f5..d25f02b 100644 --- a/templates/default/heat.conf.erb +++ b/templates/default/heat.conf.erb @@ -575,6 +575,12 @@ log_config = /etc/openstack/logging.conf # (string value) #policy_default_rule=default +<% if node["openstack"]["orchestration"]["misc_heat"] %> +##### THIRD PARTY ADDITIONS ##### +<% node["openstack"]["orchestration"]["misc_heat"].each do |m| %> +<%= m %> +<% end %> +<% end %> [auth_password]