Deprecate and unset the enabled_drivers option

The classic drivers are being removed, with the removal of pxe_ipmitool
already planned. The enabled_drivers option is deprecated in this change
and is made no-op, since there are no more classic drivers to enable
with it. We also force it to be empty, since the ironic team is planning
on a validate that is not set on ironic-conductor start up.

Change-Id: I6e02f59807c98643923d1c2333fcb25114735f25
This commit is contained in:
Dmitry Tantsur 2018-06-27 17:20:14 +02:00
parent b77a2d5ab1
commit d04996c9d3
3 changed files with 21 additions and 13 deletions

View File

@ -27,10 +27,6 @@
# (optional) Define if the service must be enabled or not.
# Defaults to true.
#
# [*enabled_drivers*]
# (optional) Array of drivers to load during service initialization.
# Defaults to ['pxe_ipmitool'].
#
# [*enabled_hardware_types*]
# (optional) Array of hardware types to load during service initialization.
# Defaults to ['ipmi'].
@ -140,10 +136,16 @@
# so that the baremetal node is in the desired new power state.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*enabled_drivers*]
# (optional) Array of drivers to load during service initialization.
# Deprecated and does nothing since the classic drivers have been removed.
# Defaults to undef
#
class ironic::conductor (
$package_ensure = 'present',
$enabled = true,
$enabled_drivers = ['pxe_ipmitool'],
$enabled_hardware_types = ['ipmi'],
$max_time_interval = '120',
$force_power_state_during_sync = true,
@ -165,6 +167,7 @@ class ironic::conductor (
$provisioning_network_name = undef,
$rescuing_network_name = undef,
$power_state_change_timeout = $::os_service_default,
$enabled_drivers = undef,
) {
include ::ironic::deps
@ -185,7 +188,6 @@ class ironic::conductor (
fail('rescuing_network_name and rescuing_network can not be specified in the same time.')
}
validate_array($enabled_drivers)
validate_array($enabled_hardware_types)
# NOTE(dtantsur): all in-tree drivers are IPA-based, so it won't hurt
@ -194,8 +196,7 @@ class ironic::conductor (
# On Ubuntu, ipmitool dependency is missing and ironic-conductor fails to start.
# https://bugs.launchpad.net/cloud-archive/+bug/1572800
if (member($enabled_drivers, 'pxe_ipmitool') or
member($enabled_hardware_types, 'ipmi')) and $::osfamily == 'Debian' {
if member($enabled_hardware_types, 'ipmi') and $::osfamily == 'Debian' {
ensure_packages('ipmitool',
{
ensure => $package_ensure,
@ -229,7 +230,8 @@ class ironic::conductor (
# Configure ironic.conf
ironic_config {
'DEFAULT/enabled_drivers': value => join($enabled_drivers, ',');
# Force removal of the deprecated options to avoid failures. Remove in Stein.
'DEFAULT/enabled_drivers': ensure => absent;
'DEFAULT/enabled_hardware_types': value => join($enabled_hardware_types, ',');
'conductor/max_time_interval': value => $max_time_interval;
'conductor/force_power_state_during_sync': value => $force_power_state_during_sync;

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The ``enabled_drivers`` configuration option will be unset on upgrade.
deprecations:
- |
The ``ironic::conductor::enabled_drivers`` option is deprecated and has
no effect. Use ``ironic::conductor::enabled_hardware_types`` to configure
the enabled hardware types.

View File

@ -25,7 +25,6 @@ describe 'ironic::conductor' do
let :default_params do
{ :package_ensure => 'present',
:enabled => true,
:enabled_drivers => ['pxe_ipmitool'],
:enabled_hardware_types => ['ipmi'],
:max_time_interval => '120',
:force_power_state_during_sync => true }
@ -63,7 +62,7 @@ describe 'ironic::conductor' do
end
it 'configures ironic.conf' do
is_expected.to contain_ironic_config('DEFAULT/enabled_drivers').with_value('pxe_ipmitool')
is_expected.to contain_ironic_config('DEFAULT/enabled_drivers').with_ensure('absent')
is_expected.to contain_ironic_config('DEFAULT/enabled_hardware_types').with_value('ipmi')
is_expected.to contain_ironic_config('conductor/max_time_interval').with_value(p[:max_time_interval])
is_expected.to contain_ironic_config('conductor/force_power_state_during_sync').with_value(p[:force_power_state_during_sync])
@ -86,7 +85,6 @@ describe 'ironic::conductor' do
context 'when overriding parameters' do
before :each do
params.merge!(
:enabled_drivers => ['pxe_ilo', 'agent_ilo'],
:enabled_hardware_types => ['ipmi', 'irmc'],
:max_time_interval => '50',
:force_power_state_during_sync => false,
@ -106,7 +104,6 @@ describe 'ironic::conductor' do
)
end
it 'should replace default parameter with new value' do
is_expected.to contain_ironic_config('DEFAULT/enabled_drivers').with_value('pxe_ilo,agent_ilo')
is_expected.to contain_ironic_config('DEFAULT/enabled_hardware_types').with_value('ipmi,irmc')
is_expected.to contain_ironic_config('conductor/max_time_interval').with_value(p[:max_time_interval])
is_expected.to contain_ironic_config('conductor/force_power_state_during_sync').with_value(p[:force_power_state_during_sync])