|
@@ -722,14 +722,30 @@ def upgrade(ctx):
|
|
|
click.echo("No hosts defined in: %s" % oo_cfg.config_path)
|
|
|
sys.exit(1)
|
|
|
|
|
|
- # Update config to reflect the version we're targetting, we'll write
|
|
|
- # to disk once ansible completes successfully, not before.
|
|
|
old_variant = oo_cfg.settings['variant']
|
|
|
old_version = oo_cfg.settings['variant_version']
|
|
|
- if oo_cfg.settings['variant'] == 'enterprise':
|
|
|
- oo_cfg.settings['variant'] = 'openshift-enterprise'
|
|
|
- version = find_variant(oo_cfg.settings['variant'])[1]
|
|
|
- oo_cfg.settings['variant_version'] = version.name
|
|
|
+
|
|
|
+
|
|
|
+ message = """
|
|
|
+ This tool will help you upgrade your existing OpenShift installation.
|
|
|
+"""
|
|
|
+ click.echo(message)
|
|
|
+ click.echo("Version {} found. Do you want to update to the latest version of {} " \
|
|
|
+ "or migrate to the next major release?".format(old_version, old_version))
|
|
|
+ resp = click.prompt("(1) Update to latest {} (2) Migrate to next relese".format(old_version))
|
|
|
+
|
|
|
+ if resp == "2":
|
|
|
+ # TODO: Make this a lot more flexible
|
|
|
+ new_version = "3.1"
|
|
|
+ # Update config to reflect the version we're targetting, we'll write
|
|
|
+ # to disk once ansible completes successfully, not before.
|
|
|
+ if oo_cfg.settings['variant'] == 'enterprise':
|
|
|
+ oo_cfg.settings['variant'] = 'openshift-enterprise'
|
|
|
+ version = find_variant(oo_cfg.settings['variant'])[1]
|
|
|
+ oo_cfg.settings['variant_version'] = version.name
|
|
|
+ else:
|
|
|
+ new_version = old_version
|
|
|
+
|
|
|
click.echo("Openshift will be upgraded from %s %s to %s %s on the following hosts:\n" % (
|
|
|
old_variant, old_version, oo_cfg.settings['variant'],
|
|
|
oo_cfg.settings['variant_version']))
|
|
@@ -743,7 +759,7 @@ def upgrade(ctx):
|
|
|
click.echo("Upgrade cancelled.")
|
|
|
sys.exit(0)
|
|
|
|
|
|
- retcode = openshift_ansible.run_upgrade_playbook(verbose)
|
|
|
+ retcode = openshift_ansible.run_upgrade_playbook(old_version, new_version, verbose)
|
|
|
if retcode > 0:
|
|
|
click.echo("Errors encountered during upgrade, please check %s." %
|
|
|
oo_cfg.settings['ansible_log_path'])
|