diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index 772f369ec..8d1f94888 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -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' diff --git a/tripleoclient/v1/tripleo_deploy.py b/tripleoclient/v1/tripleo_deploy.py index 8b6dafccc..c3e097a95 100644 --- a/tripleoclient/v1/tripleo_deploy.py +++ b/tripleoclient/v1/tripleo_deploy.py @@ -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( diff --git a/tripleoclient/v1/undercloud.py b/tripleoclient/v1/undercloud.py index eb2aaaebd..abcd2c532 100644 --- a/tripleoclient/v1/undercloud.py +++ b/tripleoclient/v1/undercloud.py @@ -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, diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index 9e8f64325..005e8f5f6 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -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')