Set same values from ironic-compute and openstack-controller
To ensure that manifests are idempotent we need to pass same variables from different manifests. This change will fix issue with ironic-compute task and openstack-controller task. Change-Id: Ib486d9d9b8b3fc9b951b75b4b4fc37c484250e6a Closes-Bug: #1585197
This commit is contained in:
parent
14abded111
commit
787d8ffb93
|
@ -13,12 +13,10 @@ class openstack_tasks::ironic::ironic_compute {
|
|||
$management_vip = hiera('management_vip')
|
||||
$database_vip = hiera('database_vip')
|
||||
$service_endpoint = hiera('service_endpoint')
|
||||
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
||||
$ironic_endpoint = hiera('ironic_endpoint', $management_vip)
|
||||
$glance_api_servers = hiera('glance_api_servers', "${management_vip}:9292")
|
||||
$debug = hiera('debug', false)
|
||||
$verbose = hiera('verbose', true)
|
||||
$use_syslog = hiera('use_syslog', true)
|
||||
$use_stderr = hiera('use_stderr', false)
|
||||
$syslog_log_facility_ironic = hiera('syslog_log_facility_ironic', 'LOG_LOCAL0')
|
||||
$syslog_log_facility_nova = hiera('syslog_log_facility_nova', 'LOG_LOCAL6')
|
||||
$amqp_hosts = hiera('amqp_hosts')
|
||||
|
@ -37,6 +35,11 @@ class openstack_tasks::ironic::ironic_compute {
|
|||
$db_name = pick($nova_hash['db_name'], 'nova')
|
||||
$db_password = pick($nova_hash['db_password'], 'nova')
|
||||
|
||||
$max_pool_size = hiera('max_pool_size', min($::processorcount * 5 + 0, 30 + 0))
|
||||
$max_overflow = hiera('max_overflow', min($::processorcount * 5 + 0, 60 + 0))
|
||||
$idle_timeout = hiera('idle_timeout', '3600')
|
||||
$max_retries = hiera('max_retries', '-1')
|
||||
|
||||
$max_concurrent_builds = pick($ironic_hash['max_concurrent_builds'], 50)
|
||||
# LP#1526938 - python-mysqldb supports this, python-pymysql does not
|
||||
if $::os_package_type == 'debian' {
|
||||
|
@ -63,6 +66,25 @@ class openstack_tasks::ironic::ironic_compute {
|
|||
$admin_identity_address = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [$service_endpoint, $management_vip])
|
||||
$admin_identity_uri = "${admin_identity_protocol}://${admin_identity_address}:35357"
|
||||
|
||||
$glance_endpoint_default = hiera('glance_endpoint', $management_vip)
|
||||
$glance_protocol = get_ssl_property($ssl_hash, {}, 'glance', 'internal', 'protocol', 'http')
|
||||
$glance_endpoint = get_ssl_property($ssl_hash, {}, 'glance', 'internal', 'hostname', $glance_endpoint_default)
|
||||
$glance_api_servers = hiera('glance_api_servers', "${glance_protocol}://${glance_endpoint}:9292")
|
||||
|
||||
$ironic_endpoint_default = hiera('ironic_endpoint', $management_vip)
|
||||
$ironic_protocol = get_ssl_property($ssl_hash, {}, 'ironic', 'internal', 'protocol', 'http')
|
||||
$ironic_endpoint = get_ssl_property($ssl_hash, {}, 'ironic', 'internal', 'hostname', $ironic_endpoint_default)
|
||||
|
||||
$neutron_endpoint_default = hiera('neutron_endpoint', $management_vip)
|
||||
$neutron_protocol = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'protocol', 'http')
|
||||
$neutron_endpoint = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'hostname', $neutron_endpoint_default)
|
||||
|
||||
if $nova_hash['notification_driver'] {
|
||||
$nova_notification_driver = $nova_hash['notification_driver']
|
||||
} else {
|
||||
$nova_notification_driver = []
|
||||
}
|
||||
|
||||
####### Disable upstart startup on install #######
|
||||
tweaks::ubuntu_service_override { 'nova-compute':
|
||||
package_name => 'nova-compute',
|
||||
|
@ -81,6 +103,13 @@ class openstack_tasks::ironic::ironic_compute {
|
|||
verbose => $verbose,
|
||||
debug => $debug,
|
||||
use_syslog => $use_syslog,
|
||||
use_stderr => $use_stderr,
|
||||
notification_driver => $nova_notification_driver,
|
||||
cinder_catalog_info => pick($nova_hash['cinder_catalog_info'], 'volumev2:cinderv2:internalURL'),
|
||||
database_max_overflow => $max_overflow,
|
||||
database_idle_timeout => $idle_timeout,
|
||||
database_max_retries => $max_retries,
|
||||
database_max_pool_size => $max_pool_size,
|
||||
log_facility => $syslog_log_facility_nova,
|
||||
state_path => $nova_hash['state_path'],
|
||||
report_interval => $nova_report_interval,
|
||||
|
@ -100,6 +129,7 @@ class openstack_tasks::ironic::ironic_compute {
|
|||
default_schedule_zone => $nova_hash['default_schedule_zone'],
|
||||
reserved_host_memory => '0',
|
||||
compute_manager => 'ironic.nova.compute.manager.ClusteredComputeManager',
|
||||
allow_resize_to_same_host => pick($nova_hash['allow_resize_to_same_host'], true)
|
||||
}
|
||||
|
||||
class { '::nova::compute::ironic':
|
||||
|
@ -107,13 +137,13 @@ class openstack_tasks::ironic::ironic_compute {
|
|||
admin_username => $ironic_username,
|
||||
admin_tenant_name => $ironic_tenant,
|
||||
admin_password => $ironic_user_password,
|
||||
api_endpoint => "http://${ironic_endpoint}:6385/v1",
|
||||
api_endpoint => "${ironic_protocol}://${ironic_endpoint}:6385/v1",
|
||||
max_concurrent_builds => $max_concurrent_builds
|
||||
}
|
||||
|
||||
class { '::nova::network::neutron':
|
||||
neutron_admin_password => $neutron_config['keystone']['admin_password'],
|
||||
neutron_url => "http://${neutron_endpoint}:9696",
|
||||
neutron_url => "${neutron_protocol}://${neutron_endpoint}:9696",
|
||||
neutron_admin_auth_url => "${admin_identity_uri}/v3",
|
||||
}
|
||||
|
||||
|
|
|
@ -131,10 +131,10 @@ class openstack_tasks::openstack_controller::openstack_controller {
|
|||
})
|
||||
|
||||
# SQLAlchemy backend configuration
|
||||
$max_pool_size = min($::processorcount * 5 + 0, 30 + 0)
|
||||
$max_overflow = min($::processorcount * 5 + 0, 60 + 0)
|
||||
$max_retries = '-1'
|
||||
$idle_timeout = '3600'
|
||||
$max_pool_size = hiera('max_pool_size', min($::processorcount * 5 + 0, 30 + 0))
|
||||
$max_overflow = hiera('max_overflow', min($::processorcount * 5 + 0, 60 + 0))
|
||||
$idle_timeout = hiera('idle_timeout', '3600')
|
||||
$max_retries = hiera('max_retries', '-1')
|
||||
|
||||
if hiera('nova_quota') {
|
||||
$nova_quota_driver = 'nova.quota.DbQuotaDriver'
|
||||
|
@ -142,6 +142,8 @@ class openstack_tasks::openstack_controller::openstack_controller {
|
|||
$nova_quota_driver = 'nova.quota.NoopQuotaDriver'
|
||||
}
|
||||
|
||||
$notify_on_state_change = 'vm_and_task_state'
|
||||
|
||||
if hiera('use_vcenter', false) or hiera('libvirt_type') == 'vcenter' {
|
||||
$multi_host = false
|
||||
} else {
|
||||
|
@ -164,8 +166,6 @@ class openstack_tasks::openstack_controller::openstack_controller {
|
|||
|
||||
$memcached_addresses = suffix($memcached_server, inline_template(":<%= @memcached_port %>"))
|
||||
|
||||
$nova_notify_on_state_change = 'vm_and_task_state'
|
||||
|
||||
$rpc_backend = 'nova.openstack.common.rpc.impl_kombu'
|
||||
$amqp_hosts = hiera('amqp_hosts','')
|
||||
$amqp_user = $rabbit_hash['user']
|
||||
|
@ -198,12 +198,12 @@ class openstack_tasks::openstack_controller::openstack_controller {
|
|||
service_down_time => $nova_service_down_time,
|
||||
notify_api_faults => pick($nova_hash['notify_api_faults'], false),
|
||||
notification_driver => $ceilometer_hash['notification_driver'],
|
||||
notify_on_state_change => $nova_notify_on_state_change,
|
||||
memcached_servers => $memcached_addresses,
|
||||
cinder_catalog_info => pick($nova_hash['cinder_catalog_info'], 'volumev2:cinderv2:internalURL'),
|
||||
database_max_pool_size => $max_pool_size,
|
||||
database_max_retries => $max_retries,
|
||||
database_max_overflow => $max_overflow,
|
||||
notify_on_state_change => $notify_on_state_change,
|
||||
}
|
||||
|
||||
# TODO(aschultz): this is being removed in M, do we need it?
|
||||
|
@ -441,7 +441,7 @@ class openstack_tasks::openstack_controller::openstack_controller {
|
|||
class { '::nova::ironic::common':
|
||||
admin_username => pick($ironic_hash['auth_name'],'ironic'),
|
||||
admin_password => pick($ironic_hash['user_password'],'ironic'),
|
||||
admin_url => $keystone_identity_uri,
|
||||
admin_url => "${keystone_identity_uri}v2.0",
|
||||
admin_tenant_name => pick($ironic_hash['tenant'],'services'),
|
||||
api_endpoint => "${ironic_protocol}://${ironic_endpoint}:6385/v1",
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ describe manifest do
|
|||
end
|
||||
|
||||
shared_examples 'catalog' do
|
||||
|
||||
nova_hash = Noop.hiera_structure 'nova'
|
||||
|
||||
ironic_user_password = Noop.hiera_structure 'ironic/user_password'
|
||||
ironic_enabled = Noop.hiera_structure 'ironic/enabled'
|
||||
|
||||
|
@ -28,6 +31,14 @@ describe manifest do
|
|||
nova_db_user = Noop.hiera_structure 'nova/db_user', 'nova'
|
||||
nova_db_name = Noop.hiera_structure 'nova/db_name', 'nova'
|
||||
|
||||
use_stderr = Noop.hiera 'use_stderr', false
|
||||
|
||||
if nova_hash['notification_driver']
|
||||
nova_notification_driver = nova_hash['notification_driver']
|
||||
else
|
||||
nova_notification_driver = []
|
||||
end
|
||||
|
||||
let(:memcache_nodes) do
|
||||
Noop.puppet_function 'get_nodes_hash_by_roles', network_metadata, memcache_roles
|
||||
end
|
||||
|
@ -50,6 +61,11 @@ describe manifest do
|
|||
let(:admin_auth_address) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'keystone','admin', 'hostname', [Noop.hiera('service_endpoint', Noop.hiera('management_vip'))]}
|
||||
let(:admin_uri) { "#{admin_auth_protocol}://#{admin_auth_address}:35357" }
|
||||
|
||||
let(:glance_endpoint_default) { Noop.hiera 'glance_endpoint', Noop.hiera('management_vip') }
|
||||
let(:glance_protocol) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'glance','internal','protocol','http' }
|
||||
let(:glance_endpoint) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'glance','internal','hostname', glance_endpoint_default}
|
||||
let(:glance_api_servers) { Noop.hiera 'glance_api_servers', "#{glance_protocol}://#{glance_endpoint}:9292" }
|
||||
|
||||
if ironic_enabled
|
||||
it 'nova config should have correct ironic settings' do
|
||||
should contain_nova_config('ironic/admin_password').with(:value => ironic_user_password)
|
||||
|
@ -109,8 +125,25 @@ describe manifest do
|
|||
else
|
||||
extra_params = '?charset=utf8'
|
||||
end
|
||||
facts[:processorcount] = 10
|
||||
max_overflow = Noop.hiera 'max_overflow', [facts[:processorcount] * 5 + 0, 60 + 0].min
|
||||
idle_timeout = Noop.hiera 'idle_timeout', '3600'
|
||||
max_retries = Noop.hiera 'max_retries', '-1'
|
||||
max_pool_size = Noop.hiera 'max_pool_size', [facts[:processorcount] * 5 + 0, 30 + 0].min
|
||||
|
||||
should contain_class('nova').with(
|
||||
:database_connection => "mysql://#{nova_db_user}:#{nova_db_password}@#{database_vip}/#{nova_db_name}#{extra_params}"
|
||||
:database_connection => "mysql://#{nova_db_user}:#{nova_db_password}@#{database_vip}/#{nova_db_name}#{extra_params}",
|
||||
:cinder_catalog_info => Noop.puppet_function('pick', nova_hash['cinder_catalog_info'], 'volumev2:cinderv2:internalURL'),
|
||||
:use_stderr => use_stderr,
|
||||
:notification_driver => nova_notification_driver,
|
||||
:glance_api_servers => glance_api_servers,
|
||||
:database_max_overflow => max_overflow,
|
||||
:database_idle_timeout => idle_timeout,
|
||||
:database_max_retries => max_retries,
|
||||
:database_max_pool_size => max_pool_size,
|
||||
)
|
||||
should contain_class('nova::compute').with(
|
||||
:allow_resize_to_same_host => Noop.puppet_function('pick', nova_hash['allow_resize_to_same_host'], true)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -201,6 +201,12 @@ describe manifest do
|
|||
end
|
||||
|
||||
it 'should configure nova with the basics' do
|
||||
facts[:processorcount] = 10
|
||||
max_pool_size = Noop.hiera 'max_pool_size', [facts[:processorcount] * 5 + 0, 30 + 0].min
|
||||
max_overflow = Noop.hiera 'max_overflow', [facts[:processorcount] * 5 + 0, 60 + 0].min
|
||||
idle_timeout = Noop.hiera 'idle_timeout', '3600'
|
||||
max_retries = Noop.hiera 'max_retries', '-1'
|
||||
|
||||
should contain_class('nova').with(
|
||||
:rpc_backend => 'nova.openstack.common.rpc.impl_kombu',
|
||||
:rabbit_hosts => rabbit_hosts,
|
||||
|
@ -212,16 +218,16 @@ describe manifest do
|
|||
:log_facility => syslog_log_facility_nova,
|
||||
:use_syslog => use_syslog,
|
||||
:use_stderr => use_stderr,
|
||||
:database_idle_timeout => '3600',
|
||||
:database_idle_timeout => idle_timeout,
|
||||
:report_interval => nova_report_interval,
|
||||
:service_down_time => nova_service_down_time,
|
||||
:notify_api_faults => notify_api_faults,
|
||||
:notification_driver => ceilometer_hash['notification_driver'],
|
||||
:notify_on_state_change => 'vm_and_task_state',
|
||||
:cinder_catalog_info => cinder_catalog_info,
|
||||
:database_max_pool_size => 20,
|
||||
:database_max_retries => '-1',
|
||||
:database_max_overflow => 20
|
||||
:database_max_pool_size => max_pool_size,
|
||||
:database_max_retries => max_retries,
|
||||
:database_max_overflow => max_overflow,
|
||||
:notify_on_state_change => 'vm_and_task_state',
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -423,7 +429,7 @@ describe manifest do
|
|||
'admin_username' => ironic_user,
|
||||
'admin_password' => ironic_password,
|
||||
'admin_tenant_name' => ironic_tenant,
|
||||
'admin_url' => keystone_identity_uri,
|
||||
'admin_url' => "#{keystone_identity_uri}v2.0",
|
||||
'api_endpoint' => "#{ironic_protocol}://#{ironic_endpoint}:6385/v1",
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue