From 76cb4f73e08fe17bf781355c87cfa87771ff9b40 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 20 Apr 2016 22:26:19 -0400 Subject: [PATCH] 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 --- manifests/conductor.pp | 2 +- manifests/init.pp | 11 +++++++++++ spec/classes/ironic_init_spec.rb | 9 +++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/manifests/conductor.pp b/manifests/conductor.pp index 77a386bb..ffad6626 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -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, diff --git a/manifests/init.pp b/manifests/init.pp index 8d82ac62..5aedcd3e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, ','); diff --git a/spec/classes/ironic_init_spec.rb b/spec/classes/ironic_init_spec.rb index 42f31788..643878b9 100644 --- a/spec/classes/ironic_init_spec.rb +++ b/spec/classes/ironic_init_spec.rb @@ -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