diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index 9d1b498159..699232b1db 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -234,6 +234,31 @@ subprocess.check_call( [os.path.join(deploy_path, "scripts", "setup", "generate_secrets.py"), "--production"] ) +# Adjust Puppet class names for the manifest renames in the 4.0 release +class_renames = { + "zulip::app_frontend": "zulip::profile::app_frontend", + "zulip::dockervoyager": "zulip::profile::docker", + "zulip::memcached": "zulip::profile::memcached", + "zulip::postgres_appdb_tuned": "zulip::profile::postgresql", + "zulip::postgres_backups": "zulip::postgresql_backups", + "zulip::rabbit": "zulip::profile::rabbitmq", + "zulip::voyager": "zulip::profile::standalone", +} +classes = re.split(r"\s*,\s*", get_config(config_file, "machine", "puppet_classes")) +new_classes = [class_renames.get(c, c) for c in classes if c != "zulip::base"] +if classes != new_classes: + logging.info("Adjusting Puppet classes for renames...") + subprocess.check_call( + [ + "crudini", + "--set", + "/etc/zulip/zulip.conf", + "machine", + "puppet_classes", + ", ".join(new_classes), + ] + ) + # Unpleasant migration: Remove any legacy deployed copies of # images-google-64 from before we renamed that emojiset to # "googleblob": @@ -330,32 +355,6 @@ if cookie_size is not None and cookie_size == 20: logging.info("Generating a secure erlang cookie...") subprocess.check_call(["./scripts/setup/generate-rabbitmq-cookie"]) -# Adjust Puppet class names for the manifest renames in the 4.0 release -class_renames = { - "zulip::app_frontend": "zulip::profile::app_frontend", - "zulip::dockervoyager": "zulip::profile::docker", - "zulip::memcached": "zulip::profile::memcached", - "zulip::postgres_appdb_tuned": "zulip::profile::postgresql", - "zulip::postgres_backups": "zulip::postgresql_backups", - "zulip::rabbit": "zulip::profile::rabbitmq", - "zulip::voyager": "zulip::profile::standalone", -} -classes = re.split(r"\s*,\s*", get_config(config_file, "machine", "puppet_classes")) -new_classes = [class_renames.get(c, c) for c in classes if c != "zulip::base"] -if classes != new_classes: - logging.info("Adjusting Puppet classes for renames...") - subprocess.check_call( - [ - "crudini", - "--set", - "/etc/zulip/zulip.conf", - "machine", - "puppet_classes", - ", ".join(new_classes), - ] - ) - - if not args.skip_puppet: # Puppet may adjust random services; to minimize risk of issues # due to inconsistent state, we shut down the server first.