Add ironic driver's parameters to poll ironic-api
Baremetal server's power on test time is usually very long, ironic driver's default values are not enough for some servers. Add those two parameter, so downstream project like fuel can have custom config. Change-Id: I9c74a322b0d9093a20cd54bc8787772b8a638dd1
This commit is contained in:
parent
972b6209d5
commit
1dcd3cd4eb
@ -24,6 +24,12 @@
|
||||
# The admin username for Ironic to connect to Nova.
|
||||
# Defaults to 'admin'
|
||||
#
|
||||
# [*api_max_retries*]
|
||||
# Max times for ironic driver to poll ironic api
|
||||
#
|
||||
# [*api_retry_interval*]
|
||||
# Interval in second for ironic driver to poll ironic api
|
||||
#
|
||||
# === DEPRECATED
|
||||
#
|
||||
# [*admin_username*]
|
||||
@ -43,17 +49,19 @@
|
||||
# Defaults to 'services'
|
||||
#
|
||||
class nova::ironic::common (
|
||||
$api_endpoint = 'http://127.0.0.1:6385/v1',
|
||||
$auth_plugin = 'password',
|
||||
$auth_url = 'http://127.0.0.1:35357/',
|
||||
$password = 'ironic',
|
||||
$project_name = 'services',
|
||||
$username = 'admin',
|
||||
$api_endpoint = 'http://127.0.0.1:6385/v1',
|
||||
$auth_plugin = 'password',
|
||||
$auth_url = 'http://127.0.0.1:35357/',
|
||||
$password = 'ironic',
|
||||
$project_name = 'services',
|
||||
$username = 'admin',
|
||||
$api_max_retries = $::os_service_default,
|
||||
$api_retry_interval = $::os_service_default,
|
||||
# DEPRECATED
|
||||
$admin_username = undef,
|
||||
$admin_password = undef,
|
||||
$admin_tenant_name = undef,
|
||||
$admin_url = undef,
|
||||
$admin_username = undef,
|
||||
$admin_password = undef,
|
||||
$admin_tenant_name = undef,
|
||||
$admin_url = undef,
|
||||
) {
|
||||
|
||||
include ::nova::deps
|
||||
@ -83,12 +91,14 @@ class nova::ironic::common (
|
||||
|
||||
|
||||
nova_config {
|
||||
'ironic/auth_plugin': value => $auth_plugin;
|
||||
'ironic/username': value => $username_real;
|
||||
'ironic/password': value => $password_real;
|
||||
'ironic/auth_url': value => $auth_url_real;
|
||||
'ironic/project_name': value => $project_name_real;
|
||||
'ironic/api_endpoint': value => $api_endpoint;
|
||||
'ironic/auth_plugin': value => $auth_plugin;
|
||||
'ironic/username': value => $username_real;
|
||||
'ironic/password': value => $password_real;
|
||||
'ironic/auth_url': value => $auth_url_real;
|
||||
'ironic/project_name': value => $project_name_real;
|
||||
'ironic/api_endpoint': value => $api_endpoint;
|
||||
'ironic/api_max_retries': value => $api_max_retries;
|
||||
'ironic/api_retry_interval': value => $api_retry_interval;
|
||||
}
|
||||
|
||||
# TODO(aschultz): these are deprecated, remove in P
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- Adds the api_max_retries and api_retry_interval config
|
||||
parameters for nova ironic driver to poll ironic api.
|
||||
If not specify explicitly, use service's default value.
|
@ -12,6 +12,8 @@ describe 'nova::ironic::common' do
|
||||
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://127.0.0.1:35357/')
|
||||
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/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/admin_username').with_value('admin')
|
||||
is_expected.to contain_nova_config('ironic/admin_password').with_value('ironic')
|
||||
@ -23,11 +25,13 @@ describe 'nova::ironic::common' do
|
||||
context 'with parameters' do
|
||||
let :params do
|
||||
{
|
||||
:username => 'ironic',
|
||||
:password => 's3cr3t',
|
||||
:auth_url => 'http://10.0.0.10:35357/',
|
||||
:project_name => 'services2',
|
||||
:api_endpoint => 'http://10.0.0.10:6385/v1',
|
||||
:username => 'ironic',
|
||||
:password => 's3cr3t',
|
||||
:auth_url => 'http://10.0.0.10:35357/',
|
||||
:project_name => 'services2',
|
||||
:api_endpoint => 'http://10.0.0.10:6385/v1',
|
||||
:api_max_retries => 60,
|
||||
:api_retry_interval => 2,
|
||||
}
|
||||
end
|
||||
|
||||
@ -38,6 +42,8 @@ describe 'nova::ironic::common' do
|
||||
is_expected.to contain_nova_config('ironic/auth_url').with_value('http://10.0.0.10:35357/')
|
||||
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/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/admin_username').with_value('ironic')
|
||||
is_expected.to contain_nova_config('ironic/admin_password').with_value('s3cr3t')
|
||||
|
Loading…
Reference in New Issue
Block a user