From 55b58702faaf08a1a3ab2cb5203cfc078582a353 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Tue, 2 Oct 2018 15:19:06 +0200 Subject: [PATCH] Make nova.conf more readable This patch replaces nova.conf.erb with openstack-service.conf.erb from the openstack-common cookbook. Besides removing some redundancy, it also makes nova.conf more readable (due to a fix to openstack-service.conf.erb that never made it to nova.conf.erb). backport: queens pike Change-Id: I07aeb7617ca152f66ec239cef4bcbef642c66bf7 --- recipes/nova-common.rb | 5 +++-- templates/default/nova.conf.erb | 12 ------------ 2 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 templates/default/nova.conf.erb diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb index fc134e4f..71c3c7dd 100644 --- a/recipes/nova-common.rb +++ b/recipes/nova-common.rb @@ -190,11 +190,12 @@ node.default['openstack']['compute']['conf'].tap do |conf| conf['serial_console']['proxyclient_address'] = serial_console_bind_address end -# merge all config options and secrets to be used in the nova.conf.erb +# merge all config options and secrets to be used in nova.conf nova_conf_options = merge_config_options 'compute' template '/etc/nova/nova.conf' do - source 'nova.conf.erb' + source 'openstack-service.conf.erb' + cookbook 'openstack-common' owner node['openstack']['compute']['user'] group node['openstack']['compute']['group'] mode 0o0640 diff --git a/templates/default/nova.conf.erb b/templates/default/nova.conf.erb deleted file mode 100644 index e2fda21f..00000000 --- a/templates/default/nova.conf.erb +++ /dev/null @@ -1,12 +0,0 @@ -<%= node["openstack"]["compute"]["custom_template_banner"] %> -<% @service_config.each do |section, values| -%> -[<%= section %>] - <% values.each do |key, value| -%> - <% if value.class == Hash -%> -<%= "# #{value['comment']}" -%> -<%= key %> = <%= value['set_to'] %> - <% else -%> -<%= key %> = <%= value %> - <% end -%> - <% end -%> -<% end -%>