From c07444ebfb02c61f3f712373e1b2978a7dd34dc1 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 25 Aug 2016 12:09:57 -0400 Subject: [PATCH] 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 --- manifests/init.pp | 8 ++++++++ manifests/params.pp | 2 ++ .../notes/ironic-lib-3e668497a18a9b2c.yaml | 4 ++++ spec/classes/ironic_init_spec.rb | 16 +++++++++++++--- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/ironic-lib-3e668497a18a9b2c.yaml diff --git a/manifests/init.pp b/manifests/init.pp index ceed8feb..67b0e56f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -380,6 +380,14 @@ class ironic ( name => $::ironic::params::common_package_name, 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) diff --git a/manifests/params.pp b/manifests/params.pp index e8e0acd8..35a98c0e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -30,6 +30,7 @@ class ironic::params { case $::osfamily { 'RedHat': { $common_package_name = 'openstack-ironic-common' + $lib_package_name = 'python-ironic-lib' $api_package = 'openstack-ironic-api' $api_service = 'openstack-ironic-api' $conductor_package = 'openstack-ironic-conductor' @@ -44,6 +45,7 @@ class ironic::params { } 'Debian': { $common_package_name = 'ironic-common' + $lib_package_name = 'python-ironic-lib' $api_service = 'ironic-api' $api_package = 'ironic-api' $conductor_service = 'ironic-conductor' diff --git a/releasenotes/notes/ironic-lib-3e668497a18a9b2c.yaml b/releasenotes/notes/ironic-lib-3e668497a18a9b2c.yaml new file mode 100644 index 00000000..b9475f0e --- /dev/null +++ b/releasenotes/notes/ironic-lib-3e668497a18a9b2c.yaml @@ -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. diff --git a/spec/classes/ironic_init_spec.rb b/spec/classes/ironic_init_spec.rb index efdd8272..633ce373 100644 --- a/spec/classes/ironic_init_spec.rb +++ b/spec/classes/ironic_init_spec.rb @@ -76,7 +76,7 @@ describe 'ironic' do it { is_expected.to contain_class('ironic::logging') } 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( :ensure => 'present', :name => platform_params[:common_package_name], @@ -84,6 +84,14 @@ describe 'ironic' do ) 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 is_expected.to contain_resources('ironic_config').with({ :purge => false @@ -285,7 +293,8 @@ describe 'ironic' do end let :platform_params do - { :common_package_name => 'ironic-common' } + { :common_package_name => 'ironic-common', + :lib_package_name => 'python-ironic-lib' } end it_configures 'ironic' @@ -306,7 +315,8 @@ describe 'ironic' do end let :platform_params do - { :common_package_name => 'openstack-ironic-common' } + { :common_package_name => 'openstack-ironic-common', + :lib_package_name => 'python-ironic-lib' } end it_configures 'ironic'