Merge "Replace removed ironic api_endpoint by endpoint_override"
This commit is contained in:
commit
602fe3d6a4
|
@ -1,9 +1,5 @@
|
||||||
# == Class: nova::ironic::common
|
# == Class: nova::ironic::common
|
||||||
#
|
#
|
||||||
# [*api_endpoint*]
|
|
||||||
# The url for Ironic api endpoint.
|
|
||||||
# Defaults to 'http://127.0.0.1:6385/v1'
|
|
||||||
#
|
|
||||||
# [*auth_plugin*]
|
# [*auth_plugin*]
|
||||||
# The authentication plugin to use when connecting to nova.
|
# The authentication plugin to use when connecting to nova.
|
||||||
# Defaults to 'password'
|
# Defaults to 'password'
|
||||||
|
@ -24,6 +20,10 @@
|
||||||
# The admin username for Ironic to connect to Nova.
|
# The admin username for Ironic to connect to Nova.
|
||||||
# Defaults to 'admin'
|
# Defaults to 'admin'
|
||||||
#
|
#
|
||||||
|
# [*endpoint_override*]
|
||||||
|
# (optional) Override the endpoint to use to talk to Ironic.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
# [*api_max_retries*]
|
# [*api_max_retries*]
|
||||||
# Max times for ironic driver to poll ironic api
|
# Max times for ironic driver to poll ironic api
|
||||||
#
|
#
|
||||||
|
@ -38,32 +38,45 @@
|
||||||
# (Optional) Name of domain for $project_domain_name
|
# (Optional) Name of domain for $project_domain_name
|
||||||
# Defaults to 'Default'
|
# Defaults to 'Default'
|
||||||
#
|
#
|
||||||
|
# DEPRECATED PARAMETERS
|
||||||
|
#
|
||||||
|
# [*api_endpoint*]
|
||||||
|
# The url for Ironic api endpoint.
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
class nova::ironic::common (
|
class nova::ironic::common (
|
||||||
$api_endpoint = 'http://127.0.0.1:6385/v1',
|
|
||||||
$auth_plugin = 'password',
|
$auth_plugin = 'password',
|
||||||
$auth_url = 'http://127.0.0.1:5000/',
|
$auth_url = 'http://127.0.0.1:5000/',
|
||||||
$password = 'ironic',
|
$password = 'ironic',
|
||||||
$project_name = 'services',
|
$project_name = 'services',
|
||||||
$username = 'admin',
|
$username = 'admin',
|
||||||
|
$endpoint_override = $::os_service_default,
|
||||||
$api_max_retries = $::os_service_default,
|
$api_max_retries = $::os_service_default,
|
||||||
$api_retry_interval = $::os_service_default,
|
$api_retry_interval = $::os_service_default,
|
||||||
$user_domain_name = 'Default',
|
$user_domain_name = 'Default',
|
||||||
$project_domain_name = 'Default',
|
$project_domain_name = 'Default',
|
||||||
|
# DEPRECATED PARAMETERS
|
||||||
|
$api_endpoint = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include nova::deps
|
include nova::deps
|
||||||
|
|
||||||
|
if $api_endpoint != undef {
|
||||||
|
warning('nova::ironic::common::api_endpoint is deprecated and has no effect. \
|
||||||
|
Use nova::ironic::common::endpoint_override instead.')
|
||||||
|
}
|
||||||
|
|
||||||
nova_config {
|
nova_config {
|
||||||
'ironic/auth_plugin': value => $auth_plugin;
|
'ironic/auth_plugin': value => $auth_plugin;
|
||||||
'ironic/username': value => $username;
|
'ironic/username': value => $username;
|
||||||
'ironic/password': value => $password, secret => true;
|
'ironic/password': value => $password, secret => true;
|
||||||
'ironic/auth_url': value => $auth_url;
|
'ironic/auth_url': value => $auth_url;
|
||||||
'ironic/project_name': value => $project_name;
|
'ironic/project_name': value => $project_name;
|
||||||
'ironic/api_endpoint': value => $api_endpoint;
|
'ironic/endpoint_override': value => $endpoint_override;
|
||||||
'ironic/api_max_retries': value => $api_max_retries;
|
'ironic/api_max_retries': value => $api_max_retries;
|
||||||
'ironic/api_retry_interval': value => $api_retry_interval;
|
'ironic/api_retry_interval': value => $api_retry_interval;
|
||||||
'ironic/user_domain_name': value => $user_domain_name;
|
'ironic/user_domain_name': value => $user_domain_name;
|
||||||
'ironic/project_domain_name': value => $project_domain_name;
|
'ironic/project_domain_name': value => $project_domain_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The nova::ironic::common::api_endpoint is deprecated and has no effect,
|
||||||
|
because the corresponding [ironic]api_endpoint was removed in Nova.
|
||||||
|
The nova::ironic::common::endpoint_override should be used instead.
|
|
@ -11,7 +11,7 @@ describe 'nova::ironic::common' do
|
||||||
is_expected.to contain_nova_config('ironic/password').with_value('ironic').with_secret(true)
|
is_expected.to contain_nova_config('ironic/password').with_value('ironic').with_secret(true)
|
||||||
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://127.0.0.1:5000/')
|
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://127.0.0.1:5000/')
|
||||||
is_expected.to contain_nova_config('ironic/project_name').with_value('services')
|
is_expected.to contain_nova_config('ironic/project_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/endpoint_override').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '<SERVICE DEFAULT>')
|
is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_nova_config('ironic/user_domain_name').with_value('Default')
|
is_expected.to contain_nova_config('ironic/user_domain_name').with_value('Default')
|
||||||
|
@ -27,7 +27,7 @@ describe 'nova::ironic::common' do
|
||||||
:password => 's3cr3t',
|
:password => 's3cr3t',
|
||||||
:auth_url => 'http://10.0.0.10:5000/',
|
:auth_url => 'http://10.0.0.10:5000/',
|
||||||
:project_name => 'services2',
|
:project_name => 'services2',
|
||||||
:api_endpoint => 'http://10.0.0.10:6385/v1',
|
:endpoint_override => 'http://10.0.0.10:6385/v1',
|
||||||
:api_max_retries => 60,
|
:api_max_retries => 60,
|
||||||
:api_retry_interval => 2,
|
:api_retry_interval => 2,
|
||||||
:user_domain_name => 'custom_domain',
|
:user_domain_name => 'custom_domain',
|
||||||
|
@ -41,7 +41,7 @@ describe 'nova::ironic::common' do
|
||||||
is_expected.to contain_nova_config('ironic/password').with_value('s3cr3t').with_secret(true)
|
is_expected.to contain_nova_config('ironic/password').with_value('s3cr3t').with_secret(true)
|
||||||
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://10.0.0.10:5000/')
|
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://10.0.0.10:5000/')
|
||||||
is_expected.to contain_nova_config('ironic/project_name').with_value('services2')
|
is_expected.to contain_nova_config('ironic/project_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/endpoint_override').with_value('http://10.0.0.10:6385/v1')
|
||||||
is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '60')
|
is_expected.to contain_nova_config('ironic/api_max_retries').with('value' => '60')
|
||||||
is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '2')
|
is_expected.to contain_nova_config('ironic/api_retry_interval').with('value' => '2')
|
||||||
is_expected.to contain_nova_config('ironic/user_domain_name').with('value' => 'custom_domain')
|
is_expected.to contain_nova_config('ironic/user_domain_name').with('value' => 'custom_domain')
|
||||||
|
@ -49,19 +49,6 @@ describe 'nova::ironic::common' do
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with deprecated parameters' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:api_endpoint => 'http://10.0.0.10:6385/v1',
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures ironic in nova.conf' do
|
|
||||||
is_expected.to contain_nova_config('ironic/api_endpoint').with_value('http://10.0.0.10:6385/v1')
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
|
Loading…
Reference in New Issue