WIP: [wallaby-only] FFWD3: System upgrade UC

Change-Id: I7e1f956f993fb0523e07064963fee944225823e7
This commit is contained in:
Lukas Bezdicka 2023-01-16 15:06:18 +01:00 committed by Juan Badia Payno
parent b780e6d1fb
commit 1223dbd878
4 changed files with 32 additions and 6 deletions

View File

@ -192,6 +192,10 @@ DEPLOY_ANSIBLE_ACTIONS = {
'playbook': 'upgrade_steps_playbook.yaml',
'skip_tags': 'validation'
},
'system-upgrade': {
'playbook': 'upgrade_steps_playbook.yaml',
'tags': 'system_upgrade'
},
'post-upgrade': {
'playbook': 'post_upgrade_steps_playbook.yaml',
'skip_tags': 'validation'

View File

@ -915,6 +915,9 @@ class Deploy(command.Command):
"--standalone. "))
parser.add_argument('--upgrade', default=False, action='store_true',
help=_("Upgrade an existing deployment."))
parser.add_argument('--system-upgrade', default=False,
action='store_true',
help=_("System-upgrade an existing deployment."))
parser.add_argument('-y', '--yes', default=False, action='store_true',
help=_("Skip yes/no prompt (assume yes)."))
parser.add_argument('--stack',
@ -1317,14 +1320,20 @@ class Deploy(command.Command):
self._kill_heat(parsed_args)
if not parsed_args.output_only:
operations = list()
if parsed_args.upgrade:
# Run Upgrade tasks before the deployment
if parsed_args.system_upgrade:
# Run System Upgrade tasks before the deployment
operations.append(
constants.DEPLOY_ANSIBLE_ACTIONS['upgrade']
constants.DEPLOY_ANSIBLE_ACTIONS['system-upgrade']
)
else:
if parsed_args.upgrade:
# Run Upgrade tasks before the deployment
operations.append(
constants.DEPLOY_ANSIBLE_ACTIONS['upgrade']
)
operations.append(
constants.DEPLOY_ANSIBLE_ACTIONS['deploy']
)
operations.append(
constants.DEPLOY_ANSIBLE_ACTIONS['deploy']
)
if parsed_args.upgrade:
# Run Post Upgrade tasks after the deployment
operations.append(

View File

@ -194,6 +194,14 @@ class UpgradeUndercloud(InstallUndercloud):
help=_("Flag to skip the package update when "
"performing upgrades and updates"),
)
parser.add_argument(
'--system-upgrade',
dest='system_upgrade',
action='store',
default=None,
help=_("Run system upgrade while using "
"provided environment yaml file."),
)
return parser
def _update_extra_packages(self, packages=[], dry_run=False):
@ -218,6 +226,7 @@ class UpgradeUndercloud(InstallUndercloud):
cmd = undercloud_config.\
prepare_undercloud_deploy(
upgrade=True,
system_upgrade=parsed_args.system_upgrade,
yes=parsed_args.yes,
no_validations=parsed_args.
no_validations,

View File

@ -436,6 +436,7 @@ def _process_chrony_acls(env):
def prepare_undercloud_deploy(upgrade=False, no_validations=True,
system_upgrade=None,
verbose_level=1, yes=False,
force_stack_update=False, dry_run=False,
inflight=False,
@ -822,6 +823,9 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=True,
if reproducer:
deploy_args.append('--reproduce-command')
if system_upgrade:
deploy_args += ['--system-upgrade', '-e', system_upgrade]
if disable_container_prepare:
deploy_args.append('--disable-container-prepare')