Support ironic-lib package and orchestrate Ironic upgrade

The ironic-lib package is required on all Ironic nodes and is now
managed by puppet-ironic.
When upgrading Ironic, we need to notify the services if common & lib
packages are updated.

Change-Id: I7ee4f71ece9908e29a8aa3ad89245500e7827787
This commit is contained in:
Emilien Macchi 2016-08-25 12:09:57 -04:00
parent 43c57a0026
commit c07444ebfb
4 changed files with 27 additions and 3 deletions

View File

@ -380,6 +380,14 @@ class ironic (
name => $::ironic::params::common_package_name, name => $::ironic::params::common_package_name,
tag => ['openstack', 'ironic-package'], tag => ['openstack', 'ironic-package'],
} }
Package['ironic-common'] ~> Service<| tag == 'ironic-service' |>
package { 'ironic-lib':
ensure => $package_ensure,
name => $::ironic::params::lib_package_name,
tag => ['openstack', 'ironic-package'],
}
Package['ironic-lib'] ~> Service<| tag == 'ironic-service' |>
validate_array($enabled_drivers) validate_array($enabled_drivers)

View File

@ -30,6 +30,7 @@ class ironic::params {
case $::osfamily { case $::osfamily {
'RedHat': { 'RedHat': {
$common_package_name = 'openstack-ironic-common' $common_package_name = 'openstack-ironic-common'
$lib_package_name = 'python-ironic-lib'
$api_package = 'openstack-ironic-api' $api_package = 'openstack-ironic-api'
$api_service = 'openstack-ironic-api' $api_service = 'openstack-ironic-api'
$conductor_package = 'openstack-ironic-conductor' $conductor_package = 'openstack-ironic-conductor'
@ -44,6 +45,7 @@ class ironic::params {
} }
'Debian': { 'Debian': {
$common_package_name = 'ironic-common' $common_package_name = 'ironic-common'
$lib_package_name = 'python-ironic-lib'
$api_service = 'ironic-api' $api_service = 'ironic-api'
$api_package = 'ironic-api' $api_package = 'ironic-api'
$conductor_service = 'ironic-conductor' $conductor_service = 'ironic-conductor'

View File

@ -0,0 +1,4 @@
---
features:
- Manage ironic-lib package, called python-ironic-lib.
Also make sure the packages notify Ironic services to facilitate upgrade orchestration.

View File

@ -76,7 +76,7 @@ describe 'ironic' do
it { is_expected.to contain_class('ironic::logging') } it { is_expected.to contain_class('ironic::logging') }
it { is_expected.to contain_class('ironic::params') } it { is_expected.to contain_class('ironic::params') }
it 'installs ironic package' do it 'installs ironic-common package' do
is_expected.to contain_package('ironic-common').with( is_expected.to contain_package('ironic-common').with(
:ensure => 'present', :ensure => 'present',
:name => platform_params[:common_package_name], :name => platform_params[:common_package_name],
@ -84,6 +84,14 @@ describe 'ironic' do
) )
end end
it 'installs ironic-lib package' do
is_expected.to contain_package('ironic-lib').with(
:ensure => 'present',
:name => platform_params[:lib_package_name],
:tag => ['openstack', 'ironic-package'],
)
end
it 'passes purge to resource' do it 'passes purge to resource' do
is_expected.to contain_resources('ironic_config').with({ is_expected.to contain_resources('ironic_config').with({
:purge => false :purge => false
@ -285,7 +293,8 @@ describe 'ironic' do
end end
let :platform_params do let :platform_params do
{ :common_package_name => 'ironic-common' } { :common_package_name => 'ironic-common',
:lib_package_name => 'python-ironic-lib' }
end end
it_configures 'ironic' it_configures 'ironic'
@ -306,7 +315,8 @@ describe 'ironic' do
end end
let :platform_params do let :platform_params do
{ :common_package_name => 'openstack-ironic-common' } { :common_package_name => 'openstack-ironic-common',
:lib_package_name => 'python-ironic-lib' }
end end
it_configures 'ironic' it_configures 'ironic'