puppet: Move top-level zulip deployments into "profile" directory.

This moves the puppet configuration closer to the "roles and profiles
method"[1] which is suggested for organizing puppet classes.  Notably,
here it makes clear which classes are meant to be able to stand alone
as deployments.

Shims are left behind at the previous names, for compatibility with
existing `zulip.conf` files when upgrading.

[1] https://puppet.com/docs/pe/2019.8/the_roles_and_profiles_method
This commit is contained in:
Alex Vandiver
2020-10-19 17:49:54 -07:00
committed by Tim Abbott
parent 27cfb14d92
commit c2185a81d6
37 changed files with 638 additions and 602 deletions

View File

@@ -122,9 +122,10 @@ read -r -a APT_OPTIONS <<<"${APT_OPTIONS:-}"
# Install additional packages.
read -r -a ADDITIONAL_PACKAGES <<<"${ADDITIONAL_PACKAGES:-}"
# Comma-separated list of Puppet manifests to install. default is
# zulip::voyager for an all-in-one system or zulip::dockervoyager for
# Docker. Use e.g. zulip::app_frontend for a Zulip frontend server.
PUPPET_CLASSES="${PUPPET_CLASSES:-zulip::voyager}"
# zulip::profile::voyager for an all-in-one system or
# zulip::profile::dockervoyager for Docker. Use
# e.g. zulip::profile::app_frontend for a Zulip frontend server.
PUPPET_CLASSES="${PUPPET_CLASSES:-zulip::profile::voyager}"
VIRTUALENV_NEEDED="${VIRTUALENV_NEEDED:-yes}"
POSTGRES_VERSION="${POSTGRES_VERSION:-12}"
@@ -232,7 +233,7 @@ EOF
fi
case ",$PUPPET_CLASSES," in
*,zulip::voyager,* | *,zulip::postgres_appdb_tuned,*)
*,zulip::profile::voyager,* | *,zulip::profile::postgres_appdb_tuned,*)
if [ "$package_system" = apt ]; then
# We're going to install Postgres from the Postgres apt
# repository; this may conflict with the existing Postgres.
@@ -286,7 +287,7 @@ elif [ "$package_system" = yum ]; then
fi
# Check early for missing SSL certificates
if [ "$PUPPET_CLASSES" = "zulip::voyager" ] && [ -z "$USE_CERTBOT""$SELF_SIGNED_CERT" ] && { ! [ -e "/etc/ssl/private/zulip.key" ] || ! [ -e "/etc/ssl/certs/zulip.combined-chain.crt" ]; }; then
if [ "$PUPPET_CLASSES" = "zulip::profile::voyager" ] && [ -z "$USE_CERTBOT""$SELF_SIGNED_CERT" ] && { ! [ -e "/etc/ssl/private/zulip.key" ] || ! [ -e "/etc/ssl/certs/zulip.combined-chain.crt" ]; }; then
set +x
cat <<EOF
@@ -458,7 +459,7 @@ elif [ "$package_system" = yum ]; then
:
fi
if has_class "zulip::nginx" && ! has_class "zulip::dockervoyager"; then
if has_class "zulip::nginx" && ! has_class "zulip::profile::dockervoyager"; then
# Check nginx was configured properly now that we've installed it.
# Most common failure mode is certs not having been installed.
if ! nginx -t; then
@@ -479,7 +480,7 @@ EOF
fi
fi
if has_class "zulip::rabbit"; then
if has_class "zulip::profile::rabbit"; then
if ! rabbitmqctl status >/dev/null; then
set +x
cat <<EOF