Add "upgrade_cleanup" option to undercloud.conf

When upgrading a non-containerized undercloud to a containerized
undercloud, operators might want to purge old packages/config that were
deployed in Queens. It can be done by setting upgrade_cleanup to
True. The default is false so the cleanup won't happen in default
upgrades.

Change-Id: Ie770f72a8bf9f13ce7258a22ba9f96e5c70a35c1
This commit is contained in:
Emilien Macchi 2018-05-17 21:49:25 -07:00
parent 4437037fa0
commit 4b35d34651
4 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
features:
- |
The new option "upgrade_cleanup" is set to False by default but when
set to True, it'll cleanup the packages and configurations installed
on the undercloud after an upgrade.

View File

@ -277,6 +277,11 @@ class UndercloudConfig(StandaloneConfig):
'Whether to clean overcloud nodes (wipe the hard '
'drive) between deployments and after the '
'introspection.')),
cfg.BoolOpt('upgrade_cleanup',
default=False,
help=_(
'Whether to clean undercloud rpms after an upgrade'
' to a containerized undercloud.')),
cfg.ListOpt('enabled_hardware_types',
default=['ipmi', 'redfish', 'ilo', 'idrac'],
help=_('List of enabled bare metal hardware types '

View File

@ -67,7 +67,8 @@ class TestUndercloudConfig(base.TestCase):
'undercloud_ntp_servers',
'undercloud_public_host',
'undercloud_service_certificate',
'undercloud_update_packages']
'undercloud_update_packages',
'upgrade_cleanup']
self.assertEqual(expected, [x.name for x in ret])
def test_get_opts(self):
@ -124,7 +125,8 @@ class TestUndercloudConfig(base.TestCase):
'undercloud_ntp_servers',
'undercloud_public_host',
'undercloud_service_certificate',
'undercloud_update_packages']
'undercloud_update_packages',
'upgrade_cleanup']
self.assertEqual(expected, [x.name for x in ret])
def test_get_subnet_opts(self):

View File

@ -61,6 +61,7 @@ PARAMETER_MAPPING = {
'scheduler_max_attempts': 'NovaSchedulerMaxAttempts',
'local_mtu': 'UndercloudLocalMtu',
'clean_nodes': 'IronicAutomatedClean',
'upgrade_cleanup': 'UpgradeRemoveUnusedPackages',
'local_subnet': 'UndercloudCtlplaneLocalSubnet',
'enable_routed_networks': 'UndercloudEnableRoutedNetworks',
'local_interface': 'NeutronPublicInterface'