summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Klare <j.klare@cloudbau.de>2018-04-16 11:41:05 +0200
committerJan Klare <j.klare@cloudbau.de>2018-04-16 15:09:22 +0200
commitad88dc2a782b648cac1ace2806222d781c0bce85 (patch)
treef95a1598d2d8ceca03eab8aef89b71f9d282d3b4
parent2434b03f7da195b65946976b822aa14597a7e349 (diff)
cleanup attribute leftovers that are not used anymore
* removed all unused attributes * removed vmware specific configuration option that can be set in a wrapper cookbook (and was not maintained for quite some time) * removed caseswitch for nova user and group since we currently only support debian and rhel * moved all libvirtd related config options to specific attribute file in preparation for further refactoring Change-Id: I42a0bbcd03a570b9d6d24ba32ed2cafacc33ec76
Notes
Notes (review): Code-Review+2: Samuel Cassiba <s@cassiba.com> Workflow+1: Christoph Albers <c.albers@x-ion.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 23 Apr 2018 10:02:11 +0000 Reviewed-on: https://review.openstack.org/561612 Project: openstack/cookbook-openstack-compute Branch: refs/heads/master
-rw-r--r--attributes/default.rb96
-rw-r--r--attributes/libvirtd_conf.rb16
-rw-r--r--recipes/nova-common.rb8
-rw-r--r--spec/nova-common_spec.rb29
4 files changed, 20 insertions, 129 deletions
diff --git a/attributes/default.rb b/attributes/default.rb
index c65987d..326e909 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -12,34 +12,20 @@ default['openstack']['compute']['custom_template_banner'] = '
12# Any changes will be overwritten 12# Any changes will be overwritten
13' 13'
14 14
15# The name of the Chef role that knows about the message queue server
16# that Nova uses
17default['openstack']['compute']['rabbit_server_chef_role'] = 'os-ops-messaging'
18
19# Set dbsync command timeout value 15# Set dbsync command timeout value
20default['openstack']['compute']['dbsync_timeout'] = 3600 16default['openstack']['compute']['dbsync_timeout'] = 3600
21 17
22# The name of the Chef role that sets up the Keystone Service API
23default['openstack']['compute']['identity_service_chef_role'] = 'os-identity'
24
25# Disallow non-encrypted connections 18# Disallow non-encrypted connections
26default['openstack']['compute']['service_role'] = 'admin' 19default['openstack']['compute']['service_role'] = 'admin'
27 20
28case node['platform_family'] 21# Used to set correct permissions for directories and files
29when 'rhel', 'debian' 22default['openstack']['compute']['user'] = 'nova'
30 default['openstack']['compute']['user'] = 'nova' 23default['openstack']['compute']['group'] = 'nova'
31 default['openstack']['compute']['group'] = 'nova'
32end
33 24
34# Logging stuff 25# Logging stuff
35
36default['openstack']['compute']['syslog']['facility'] = 'LOG_LOCAL1' 26default['openstack']['compute']['syslog']['facility'] = 'LOG_LOCAL1'
37default['openstack']['compute']['syslog']['config_facility'] = 'local1' 27default['openstack']['compute']['syslog']['config_facility'] = 'local1'
38 28
39default['openstack']['compute']['region'] = node['openstack']['region']
40
41default['openstack']['compute']['floating_cmd'] = '/usr/local/bin/add_floaters.py'
42
43# rootwrap.conf 29# rootwrap.conf
44default['openstack']['compute']['rootwrap']['filters_path'] = '/etc/nova/rootwrap.d,/usr/share/nova/rootwrap' 30default['openstack']['compute']['rootwrap']['filters_path'] = '/etc/nova/rootwrap.d,/usr/share/nova/rootwrap'
45default['openstack']['compute']['rootwrap']['exec_dirs'] = '/sbin,/usr/sbin,/bin,/usr/bin' 31default['openstack']['compute']['rootwrap']['exec_dirs'] = '/sbin,/usr/sbin,/bin,/usr/bin'
@@ -47,75 +33,6 @@ default['openstack']['compute']['rootwrap']['use_syslog'] = 'False'
47default['openstack']['compute']['rootwrap']['syslog_log_facility'] = 'syslog' 33default['openstack']['compute']['rootwrap']['syslog_log_facility'] = 'syslog'
48default['openstack']['compute']['rootwrap']['syslog_log_level'] = 'ERROR' 34default['openstack']['compute']['rootwrap']['syslog_log_level'] = 'ERROR'
49 35
50default['openstack']['compute']['driver'] = 'libvirt.LibvirtDriver'
51
52# libvirtd_opts used in template for /etc/default/libvirt-bin
53default['openstack']['compute']['libvirt']['libvirtd_opts'] = '-l'
54
55default['openstack']['compute']['libvirt']['auth_tcp'] = 'none'
56# libvirt.max_clients (default: 20)
57default['openstack']['compute']['libvirt']['max_clients'] = 20
58# libvirt.max_workers (default: 20)
59default['openstack']['compute']['libvirt']['max_workers'] = 20
60# libvirt.max_requests (default: 20)
61default['openstack']['compute']['libvirt']['max_requests'] = 20
62# libvirt.max_client_requests (default: 5)
63default['openstack']['compute']['libvirt']['max_client_requests'] = 5
64default['openstack']['compute']['libvirt']['group'] = 'libvirt'
65default['openstack']['compute']['libvirt']['unix_sock_rw_perms'] = '0770'
66default['openstack']['compute']['libvirt']['libvirt_inject_key'] = true
67default['openstack']['compute']['libvirt']['volume_backend'] = nil
68
69# Base URL that will be presented to users in links
70# to the OpenStack Compute API
71default['openstack']['compute']['config']['osapi_compute_link_prefix'] = nil
72# Base URL that will be presented to users in links
73# to glance resources
74default['openstack']['compute']['config']['osapi_glance_link_prefix'] = nil
75default['openstack']['compute']['config']['cpu_allocation_ratio'] = 16.0
76
77# `start` will cause nova-compute to error out if a VM is already running, where
78# `resume` checks to see if it is running first.
79# requires https://review.openstack.org/#/c/8423/
80default['openstack']['compute']['config']['resume_guests_state_on_host_boot'] = true
81
82default['openstack']['compute']['ratelimit']['settings'] = {
83 'generic-post-limit' => { 'verb' => 'POST', 'uri' => '*', 'regex' => '.*', 'limit' => '10', 'interval' => 'MINUTE' },
84 'create-servers-limit' => { 'verb' => 'POST', 'uri' => '*/servers', 'regex' => '^/servers', 'limit' => '50', 'interval' => 'DAY' },
85 'generic-put-limit' => { 'verb' => 'PUT', 'uri' => '*', 'regex' => '.*', 'limit' => '10', 'interval' => 'MINUTE' },
86 'changes-since-limit' => { 'verb' => 'GET', 'uri' => '*changes-since*', 'regex' => '.*changes-since.*', 'limit' => '3', 'interval' => 'MINUTE' },
87 'generic-delete-limit' => { 'verb' => 'DELETE', 'uri' => '*', 'regex' => '.*', 'limit' => '100', 'interval' => 'MINUTE' },
88}
89
90# Metering settings
91default['openstack']['compute']['metering'] = false ####
92
93# Notification settings
94default['openstack']['compute']['config']['notification_topics'] = ['notifications']
95
96if node['openstack']['compute']['metering']
97 default['openstack']['compute']['config']['notification_drivers'] = ['nova.openstack.common.notifier.rpc_notifier', 'ceilometer.compute.nova_notifier']
98 default['openstack']['compute']['config']['instance_usage_audit'] = 'True'
99 default['openstack']['compute']['config']['instance_usage_audit_period'] = 'hour'
100 default['openstack']['compute']['config']['notify_on_state_change'] = 'vm_and_task_state'
101else
102 default['openstack']['compute']['config']['notification_drivers'] = []
103 default['openstack']['compute']['config']['instance_usage_audit'] = 'False'
104 default['openstack']['compute']['config']['instance_usage_audit_period'] = 'month'
105 default['openstack']['compute']['config']['notify_on_state_change'] = ''
106end
107
108# Monitor settings
109default['openstack']['compute']['config']['compute_available_monitors'] = ['nova.compute.monitors.all_monitors']
110
111# Keystone settings
112default['openstack']['compute']['api']['auth_strategy'] = 'keystone'
113
114default['openstack']['compute']['api']['auth']['version'] = node['openstack']['api']['auth']['version']
115
116# A PEM encoded Certificate Authority to use when verifying HTTPs connections.
117default['openstack']['compute']['api']['auth']['cafile'] = nil
118
119# Placement API settings 36# Placement API settings
120default['openstack']['placement']['ssl']['enabled'] = false 37default['openstack']['placement']['ssl']['enabled'] = false
121default['openstack']['placement']['ssl']['certfile'] = '' 38default['openstack']['placement']['ssl']['certfile'] = ''
@@ -202,13 +119,6 @@ end
202# Array of options for `api-paste.ini` (e.g. ['option1=value1', ...]) 119# Array of options for `api-paste.ini` (e.g. ['option1=value1', ...])
203default['openstack']['compute']['misc_paste'] = nil 120default['openstack']['compute']['misc_paste'] = nil
204 121
205# NOTE: The metadata api service is enabled via including it's recipe
206# NOTE: api-metadata. By default the api-metadata recipe is included in
207# NOTE: the os-compute-api role which is included in the
208# NOTE: os-compute-single-controller role.
209
210# For true case, this logic allows the following ironic-related attribtes to be overwritten automatically.
211
212# ****************** OpenStack Compute Endpoints ****************************** 122# ****************** OpenStack Compute Endpoints ******************************
213 123
214# The OpenStack Compute (Nova) XVPvnc endpoint 124# The OpenStack Compute (Nova) XVPvnc endpoint
diff --git a/attributes/libvirtd_conf.rb b/attributes/libvirtd_conf.rb
new file mode 100644
index 0000000..fa9b838
--- /dev/null
+++ b/attributes/libvirtd_conf.rb
@@ -0,0 +1,16 @@
1# libvirtd_opts used in template for /etc/default/libvirt-bin
2default['openstack']['compute']['libvirt']['libvirtd_opts'] = '-l'
3
4default['openstack']['compute']['libvirt']['auth_tcp'] = 'none'
5# libvirt.max_clients (default: 20)
6default['openstack']['compute']['libvirt']['max_clients'] = 20
7# libvirt.max_workers (default: 20)
8default['openstack']['compute']['libvirt']['max_workers'] = 20
9# libvirt.max_requests (default: 20)
10default['openstack']['compute']['libvirt']['max_requests'] = 20
11# libvirt.max_client_requests (default: 5)
12default['openstack']['compute']['libvirt']['max_client_requests'] = 5
13default['openstack']['compute']['libvirt']['group'] = 'libvirt'
14default['openstack']['compute']['libvirt']['unix_sock_rw_perms'] = '0770'
15default['openstack']['compute']['libvirt']['libvirt_inject_key'] = true
16default['openstack']['compute']['libvirt']['volume_backend'] = nil
diff --git a/recipes/nova-common.rb b/recipes/nova-common.rb
index 87b6fdc..6991831 100644
--- a/recipes/nova-common.rb
+++ b/recipes/nova-common.rb
@@ -144,13 +144,7 @@ node.default['openstack']['compute']['conf_secrets']
144.[]('neutron')['metadata_proxy_shared_secret'] = 144.[]('neutron')['metadata_proxy_shared_secret'] =
145 get_password 'token', 'neutron_metadata_secret' 145 get_password 'token', 'neutron_metadata_secret'
146 146
147if node['openstack']['compute']['driver'].split('.').first == 'vmwareapi' 147auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['api']['auth']['version']
148 node.default['openstack']['compute']['conf_secrets']
149 .[]('vmware')['host_password'] =
150 get_password 'token', 'openstack_vmware_secret_name'
151end
152
153auth_url = auth_uri_transform identity_endpoint.to_s, node['openstack']['compute']['api']['auth']['version']
154node.default['openstack']['compute']['conf_secrets'] 148node.default['openstack']['compute']['conf_secrets']
155 .[]('keystone_authtoken')['password'] = 149 .[]('keystone_authtoken')['password'] =
156 get_password 'service', 'openstack-compute' 150 get_password 'service', 'openstack-compute'
diff --git a/spec/nova-common_spec.rb b/spec/nova-common_spec.rb
index 80ca857..a721a05 100644
--- a/spec/nova-common_spec.rb
+++ b/spec/nova-common_spec.rb
@@ -232,35 +232,6 @@ describe 'openstack-compute::nova-common' do
232 .with_section_content('cinder', /^os_region_name = RegionOne$/) 232 .with_section_content('cinder', /^os_region_name = RegionOne$/)
233 end 233 end
234 234
235 context 'vmware' do
236 before do
237 # README(galstrom21): There is a order of operations issue here
238 # if you use node.set, these tests will fail.
239 node.override['openstack']['compute']['driver'] = 'vmwareapi.VMwareVCDriver'
240 # NB(srenatus) this is only one option, the other one is
241 # 'vmwareapi.VMwareESXDriver' (see templates/default/nova.conf.erb)
242 end
243
244 it 'has vmware config options set' do
245 [
246 /^host_password = vmware_secret_name$/,
247 ].each do |line|
248 expect(chef_run).to render_config_file(file.name)\
249 .with_section_content('vmware', line)
250 end
251 end
252
253 it 'has no datastore_regex line' do
254 expect(chef_run).not_to render_config_file(file.name)\
255 .with_section_content('vmware', 'datastore_regex = ')
256 end
257
258 it 'has no wsdl_location line' do
259 expect(chef_run).not_to render_config_file(file.name)\
260 .with_section_content('vmware', 'wsdl_location = ')
261 end
262 end
263
264 it 'has no auto_assign_floating_ip' do 235 it 'has no auto_assign_floating_ip' do
265 expect(chef_run).not_to render_file(file.name).with_content( 236 expect(chef_run).not_to render_file(file.name).with_content(
266 'auto_assign_floating_ip=false' 237 'auto_assign_floating_ip=false'