Merge "Allow to set max_concurrent_build for ironic compute"
This commit is contained in:
@@ -34,16 +34,21 @@
|
|||||||
# [*admin_passwd*]
|
# [*admin_passwd*]
|
||||||
# (optional) DEPRECATED: Use admin_password instead.
|
# (optional) DEPRECATED: Use admin_password instead.
|
||||||
#
|
#
|
||||||
|
# [*max_concurrent_builds*]
|
||||||
|
# (optional) Maximum number of instance builds to run concurrently
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
class nova::compute::ironic (
|
class nova::compute::ironic (
|
||||||
$admin_username = 'admin',
|
$admin_username = 'admin',
|
||||||
$admin_password = 'ironic',
|
$admin_password = 'ironic',
|
||||||
$admin_url = 'http://127.0.0.1:35357/v2.0',
|
$admin_url = 'http://127.0.0.1:35357/v2.0',
|
||||||
$admin_tenant_name = 'services',
|
$admin_tenant_name = 'services',
|
||||||
$api_endpoint = 'http://127.0.0.1:6385/v1',
|
$api_endpoint = 'http://127.0.0.1:6385/v1',
|
||||||
|
$max_concurrent_builds = $::os_service_default,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$admin_user = undef,
|
$admin_user = undef,
|
||||||
$admin_passwd = undef,
|
$admin_passwd = undef,
|
||||||
$compute_driver = 'ironic.IronicDriver'
|
$compute_driver = 'ironic.IronicDriver'
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::nova::deps
|
include ::nova::deps
|
||||||
@@ -66,5 +71,6 @@ class nova::compute::ironic (
|
|||||||
'ironic/admin_tenant_name': value => $admin_tenant_name;
|
'ironic/admin_tenant_name': value => $admin_tenant_name;
|
||||||
'ironic/api_endpoint': value => $api_endpoint;
|
'ironic/api_endpoint': value => $api_endpoint;
|
||||||
'DEFAULT/compute_driver': value => $compute_driver;
|
'DEFAULT/compute_driver': value => $compute_driver;
|
||||||
|
'DEFAULT/max_concurrent_builds': value => $max_concurrent_builds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,8 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'nova::compute::ironic' do
|
describe 'nova::compute::ironic' do
|
||||||
|
|
||||||
|
shared_examples_for 'nova-compute-ironic' do
|
||||||
|
|
||||||
context 'with default parameters' do
|
context 'with default parameters' do
|
||||||
it 'configures ironic in nova.conf' do
|
it 'configures ironic in nova.conf' do
|
||||||
is_expected.to contain_nova_config('ironic/admin_username').with_value('admin')
|
is_expected.to contain_nova_config('ironic/admin_username').with_value('admin')
|
||||||
@@ -10,18 +12,20 @@ describe 'nova::compute::ironic' do
|
|||||||
is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services')
|
is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services')
|
||||||
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://127.0.0.1:6385/v1')
|
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://127.0.0.1:6385/v1')
|
||||||
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('ironic.IronicDriver')
|
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('ironic.IronicDriver')
|
||||||
|
is_expected.to contain_nova_config('DEFAULT/max_concurrent_builds').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with overridden parameters' do
|
context 'with overridden parameters' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:admin_username => 'ironic',
|
:admin_username => 'ironic',
|
||||||
:admin_password => 's3cr3t',
|
:admin_password => 's3cr3t',
|
||||||
:admin_url => 'http://10.0.0.10:35357/v2.0',
|
:admin_url => 'http://10.0.0.10:35357/v2.0',
|
||||||
:admin_tenant_name => 'services2',
|
:admin_tenant_name => 'services2',
|
||||||
:api_endpoint => 'http://10.0.0.10:6385/v1',
|
:api_endpoint => 'http://10.0.0.10:6385/v1',
|
||||||
:compute_driver => 'ironic.FoobarDriver'
|
:compute_driver => 'ironic.FoobarDriver',
|
||||||
|
:max_concurrent_builds => 15,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -32,6 +36,7 @@ describe 'nova::compute::ironic' do
|
|||||||
is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services2')
|
is_expected.to contain_nova_config('ironic/admin_tenant_name').with_value('services2')
|
||||||
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://10.0.0.10:6385/v1')
|
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://10.0.0.10:6385/v1')
|
||||||
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('ironic.FoobarDriver')
|
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('ironic.FoobarDriver')
|
||||||
|
is_expected.to contain_nova_config('DEFAULT/max_concurrent_builds').with_value(15)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -47,4 +52,29 @@ describe 'nova::compute::ironic' do
|
|||||||
is_expected.to contain_nova_config('ironic/admin_password').with_value('ironic-s3cr3t')
|
is_expected.to contain_nova_config('ironic/admin_password').with_value('ironic-s3cr3t')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
on_supported_os({
|
||||||
|
:supported_os => OSDefaults.get_supported_os
|
||||||
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge!(OSDefaults.get_facts({
|
||||||
|
:fqdn => 'some.host.tld',
|
||||||
|
:processorcount => 2,
|
||||||
|
:concat_basedir => '/var/lib/puppet/concat'
|
||||||
|
}))
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:platform_params) do
|
||||||
|
case facts[:osfamily]
|
||||||
|
when 'Debian'
|
||||||
|
{}
|
||||||
|
when 'RedHat'
|
||||||
|
{}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
it_configures 'nova-compute-ironic'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user