install ipmitool on ubuntu if driver enabled

If pxe_ipmitool driver is enabled, install ipmitool package on Ubuntu.

See https://bugs.launchpad.net/cloud-archive/+bug/1572800
to be fixed in packaging one day.

In the meantime, automatically install it, and fix orchestration to make
sure the package is installed before ironic-conductor get started
otherwise service will fail to load the driver.

Change-Id: I34014d3c44876091f698023c6b896f3d55b7756d
This commit is contained in:
Emilien Macchi 2016-04-20 22:26:19 -04:00
parent d0e53354b9
commit 76cb4f73e0
3 changed files with 21 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class ironic::conductor (
# Install package
if $::ironic::params::conductor_package {
Package['ironic-conductor'] -> Service['ironic-conductor']
Package<| tag == 'ironic-package' |> -> Service['ironic-conductor']
package { 'ironic-conductor':
ensure => $package_ensure,
name => $::ironic::params::conductor_package,

View File

@ -247,6 +247,17 @@ class ironic (
validate_array($enabled_drivers)
# 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') and $::osfamily == 'Debian' {
ensure_packages('ipmitool',
{
ensure => $package_ensure,
tag => ['openstack', 'ironic-package'],
}
)
}
if is_array($glance_api_servers) {
ironic_config {
'glance/glance_api_servers': value => join($glance_api_servers, ',');

View File

@ -251,6 +251,15 @@ describe 'ironic' do
end
it_configures 'ironic'
# https://bugs.launchpad.net/cloud-archive/+bug/1572800
it 'installs ipmitool package' do
is_expected.to contain_package('ipmitool').with(
:ensure => 'present',
:name => 'ipmitool',
:tag => ['openstack', 'ironic-package'],
)
end
end
context 'on RedHat platforms' do