Support configuration and dependencies for iLO and Drac drivers
Provides two new manifests for installing the dependencies for these drivers (python-dracclient and python-proliantutils). Also provides a couple of useful options for the iLO driver. Change-Id: Ibf1ed5253aacbbd88157d34d0c91bb909afb644c
This commit is contained in:
33
manifests/drivers/drac.pp
Normal file
33
manifests/drivers/drac.pp
Normal file
@ -0,0 +1,33 @@
|
||||
# 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.
|
||||
|
||||
# Configure the DRAC driver in Ironic
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (optional) The state of the dracclient package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
|
||||
class ironic::drivers::drac (
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
ensure_packages('python-dracclient',
|
||||
{
|
||||
ensure => $package_ensure,
|
||||
tag => ['openstack', 'ironic-package'],
|
||||
}
|
||||
)
|
||||
|
||||
}
|
65
manifests/drivers/ilo.pp
Normal file
65
manifests/drivers/ilo.pp
Normal file
@ -0,0 +1,65 @@
|
||||
# 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.
|
||||
|
||||
# Configure the iLO driver in Ironic
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*client_timeout*]
|
||||
# (optional) Maximum time in seconds to wait for iLO commands.
|
||||
# Should be an interger value
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*client_port*]
|
||||
# (optional) Port to use for iLO operations.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*use_web_server_for_images*]
|
||||
# (optional) Whether to use the Web server (the same as used for iPXE)
|
||||
# to host virtual media images.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*default_boot_mode*]
|
||||
# (optional) The default boot mode to use when no boot mode is explicitly
|
||||
# requested. Accepts values "uefi", "bios" and "auto". The "auto" value will
|
||||
# use UEFI if it's available on the machine, BIOS otherwise.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (optional) The state of the proliantutils package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
|
||||
class ironic::drivers::ilo (
|
||||
$client_timeout = $::os_service_default,
|
||||
$client_port = $::os_service_default,
|
||||
$use_web_server_for_images = $::os_service_default,
|
||||
$default_boot_mode = $::os_service_default,
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
# Configure ironic.conf
|
||||
ironic_config {
|
||||
'ilo/client_timeout': value => $client_timeout;
|
||||
'ilo/client_port': value => $client_port;
|
||||
'ilo/use_web_server_for_images': value => $use_web_server_for_images;
|
||||
'ilo/default_boot_mode': value => $default_boot_mode;
|
||||
}
|
||||
|
||||
ensure_packages('python-proliantutils',
|
||||
{
|
||||
ensure => $package_ensure,
|
||||
tag => ['openstack', 'ironic-package'],
|
||||
}
|
||||
)
|
||||
|
||||
}
|
6
releasenotes/notes/ilo-drac-2e42b985b41159ce.yaml
Normal file
6
releasenotes/notes/ilo-drac-2e42b985b41159ce.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- Add new manifest "ironic::drivers::ilo" for configuring parameters
|
||||
related to Ironic iLO drivers.
|
||||
- Add new manifest "ironic::drivers::drac" for configuring parameters
|
||||
related to Ironic DRAC drivers.
|
47
spec/classes/ironic_drivers_drac_spec.rb
Normal file
47
spec/classes/ironic_drivers_drac_spec.rb
Normal file
@ -0,0 +1,47 @@
|
||||
# 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::drac class
|
||||
#
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'ironic::drivers::drac' do
|
||||
|
||||
let :params do
|
||||
{}
|
||||
end
|
||||
|
||||
shared_examples_for 'ironic drac driver' do
|
||||
|
||||
it 'installs dracclient package' do
|
||||
is_expected.to contain_package('python-dracclient').with(
|
||||
:ensure => 'present',
|
||||
:name => 'python-dracclient',
|
||||
:tag => ['openstack', 'ironic-package'],
|
||||
)
|
||||
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())
|
||||
end
|
||||
it_configures 'ironic drac driver'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
72
spec/classes/ironic_drivers_ilo_spec.rb
Normal file
72
spec/classes/ironic_drivers_ilo_spec.rb
Normal file
@ -0,0 +1,72 @@
|
||||
# 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::ilo class
|
||||
#
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'ironic::drivers::ilo' do
|
||||
|
||||
let :params do
|
||||
{}
|
||||
end
|
||||
|
||||
shared_examples_for 'ironic ilo driver' do
|
||||
let :p do
|
||||
params
|
||||
end
|
||||
|
||||
it 'configures ironic.conf' do
|
||||
is_expected.to contain_ironic_config('ilo/client_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_ironic_config('ilo/client_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_ironic_config('ilo/use_web_server_for_images').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_ironic_config('ilo/default_boot_mode').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
it 'installs proliantutils package' do
|
||||
is_expected.to contain_package('python-proliantutils').with(
|
||||
:ensure => 'present',
|
||||
:name => 'python-proliantutils',
|
||||
:tag => ['openstack', 'ironic-package'],
|
||||
)
|
||||
end
|
||||
|
||||
context 'when overriding parameters' do
|
||||
before do
|
||||
params.merge!(:client_timeout => 120,
|
||||
:client_port => 8888,
|
||||
:use_web_server_for_images => true,
|
||||
:default_boot_mode => 'bios')
|
||||
end
|
||||
it 'should replace default parameter with new value' do
|
||||
is_expected.to contain_ironic_config('ilo/client_timeout').with_value(120)
|
||||
is_expected.to contain_ironic_config('ilo/client_port').with_value(8888)
|
||||
is_expected.to contain_ironic_config('ilo/use_web_server_for_images').with_value(true)
|
||||
is_expected.to contain_ironic_config('ilo/default_boot_mode').with_value('bios')
|
||||
end
|
||||
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())
|
||||
end
|
||||
it_configures 'ironic ilo driver'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user