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

This commit is contained in:
Jenkins
2016-09-01 16:18:25 +00:00
committed by Gerrit Code Review
6 changed files with 40 additions and 63 deletions

View File

@@ -42,6 +42,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
@@ -84,6 +92,8 @@ class ironic::conductor (
$enabled_drivers = ['pxe_ipmitool'],
$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,
@@ -94,6 +104,7 @@ class ironic::conductor (
) {
include ::ironic::params
include ::ironic::drivers::deploy
Ironic_config<||> ~> Service['ironic-conductor']
@@ -135,6 +146,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 {
'DEFAULT/enabled_drivers': value => join($enabled_drivers_real, ',');
@@ -145,6 +159,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

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

View File

@@ -69,6 +69,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
@@ -83,6 +85,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
@@ -96,6 +100,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