Move parameters from ironic::drivers::deploy to ironic::conductor

Both http_url and http_root are no longer specific to the PXE driver,
they can be used by several drivers for different purpose.
Also ironic::drivers::deploy is a confusing name: there is no "deploy driver"
in Ironic, we have deploy interface, with several implementations.

This change deprecates ironic::drivers::deploy and moves its parameters
to ironic::conductor where they actually belong.

Change-Id: I513d826e3af2dd3b9e754f8845e3a6602b142550
This commit is contained in:
Dmitry Tantsur 2016-08-26 12:08:53 +02:00
parent b5d2769041
commit 3ef3fb1419
6 changed files with 40 additions and 63 deletions

View File

@ -38,6 +38,14 @@
# state (False).
# Defaults to true.
#
# [*http_url*]
# (optional) ironic-conductor node's HTTP server URL.
# Defaults to $::os_service_default
#
# [*http_root*]
# (optional) ironic-conductor node's HTTP root path.
# Defaults to $::os_service_default
#
# [*automated_clean*]
# (optional) Whether to enable automated cleaning on nodes.
# Defaults to $::os_service_default
@ -79,6 +87,8 @@ class ironic::conductor (
$enabled = true,
$max_time_interval = '120',
$force_power_state_during_sync = true,
$http_url = $::os_service_default,
$http_root = $::os_service_default,
$automated_clean = $::os_service_default,
$swift_account = $::os_service_default,
$cleaning_network_uuid = $::os_service_default,
@ -89,6 +99,7 @@ class ironic::conductor (
) {
include ::ironic::params
include ::ironic::drivers::deploy
Ironic_config<||> ~> Service['ironic-conductor']
@ -115,6 +126,9 @@ class ironic::conductor (
}
}
$http_url_real = pick($::ironic::drivers::deploy::http_url, $http_url)
$http_root_real = pick($::ironic::drivers::deploy::http_root, $http_root)
# Configure ironic.conf
ironic_config {
'conductor/max_time_interval': value => $max_time_interval;
@ -124,6 +138,8 @@ class ironic::conductor (
'glance/swift_account': value => $swift_account;
'neutron/cleaning_network_uuid': value => $cleaning_network_uuid;
'neutron/provisioning_network_uuid': value => $provisioning_network_uuid;
'deploy/http_url': value => $http_url_real;
'deploy/http_root': value => $http_root_real;
'deploy/erase_devices_priority': value => $erase_devices_priority;
'deploy/erase_devices_metadata_priority': value => $erase_devices_metadata_priority;
'deploy/continue_if_disk_secure_erase_fails': value => $continue_if_disk_secure_erase_fails;

View File

@ -11,26 +11,30 @@
# under the License.
# Configure the deploy_utils in Ironic
# This manifest is deprecated, use ironic::conductor directly instead.
#
# === Parameters
#
# [*http_url*]
# (optional) ironic-conductor node's HTTP server URL.
# Defaults to $::os_service_default
# (optional) ironic-conductor node's HTTP server URL. DEPRECATED.
# Defaults to undef
#
# [*http_root*]
# (optional) ironic-conductor node's HTTP root path.
# Defaults to $::os_service_default
# (optional) ironic-conductor node's HTTP root path. DEPRECATED.
# Defaults to undef
#
class ironic::drivers::deploy (
$http_url = $::os_service_default,
$http_root = $::os_service_default,
$http_url = undef,
$http_root = undef,
) {
ironic_config {
'deploy/http_url': value => $http_url;
'deploy/http_root': value => $http_root;
if $http_url {
warning('http_url is deprecated and will be removed after Newton cycle.')
}
if $http_root {
warning('http_root is deprecated and will be removed after Newton cycle.')
}
}

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
Deprecated ``ironic::drivers::deploy`` manifest, use parameters from
``ironic::conductor`` instead.

View File

@ -59,7 +59,6 @@ describe 'basic ironic' do
ssl => false,
}
class { '::ironic::drivers::ipmi': }
class { '::ironic::drivers::deploy': }
# Ironic inspector resources
case $::osfamily {

View File

@ -67,6 +67,8 @@ describe 'ironic::conductor' do
is_expected.to contain_ironic_config('neutron/cleaning_network_uuid').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('neutron/provisioning_network_uuid').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('deploy/continue_if_disk_secure_erase_fails').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('deploy/http_url').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('deploy/http_root').with(:value => '<SERVICE DEFAULT>')
end
context 'when overriding parameters' do
@ -80,6 +82,8 @@ describe 'ironic::conductor' do
:api_url => 'https://127.0.0.1:6385',
:provisioning_network_uuid => '00000000-0000-0000-0000-000000000000',
:cleaning_disk_erase => 'metadata',
:http_url => 'http://host:port',
:http_root => '/src/www',
)
end
it 'should replace default parameter with new value' do
@ -92,6 +96,8 @@ describe 'ironic::conductor' do
is_expected.to contain_ironic_config('neutron/provisioning_network_uuid').with_value('00000000-0000-0000-0000-000000000000')
is_expected.to contain_ironic_config('deploy/erase_devices_priority').with_value(0)
is_expected.to contain_ironic_config('deploy/erase_devices_metadata_priority').with_value(10)
is_expected.to contain_ironic_config('deploy/http_url').with_value(p[:http_url])
is_expected.to contain_ironic_config('deploy/http_root').with_value(p[:http_root])
end
end

View File

@ -1,53 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# Unit tests for ironic::drivers::deploy class
#
require 'spec_helper'
describe 'ironic::drivers::deploy' do
shared_examples_for 'ironic deploy utils' do
context 'with default parameters' do
it { is_expected.to contain_ironic_config('deploy/http_url').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ironic_config('deploy/http_root').with_value('<SERVICE DEFAULT>') }
end
context 'when overriding parameters' do
let :params do
{ :http_url => 'http://foo',
:http_root => '/httpboot' }
end
it { is_expected.to contain_ironic_config('deploy/http_url').with_value('http://foo') }
it { is_expected.to contain_ironic_config('deploy/http_root').with_value('/httpboot') }
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({
:processorcount => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
it_configures 'ironic deploy utils'
end
end
end