From d4eefbbeea2a54bd27723c05cc69fb6ccda270d4 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 14 Feb 2022 16:24:04 -0800 Subject: [PATCH] puppet: Switch from $::osfamily to non-legacy $::os. --- puppet/zulip/manifests/apache_sso.pp | 2 +- puppet/zulip/manifests/app_frontend_base.pp | 2 +- puppet/zulip/manifests/common.pp | 2 +- puppet/zulip/manifests/nginx.pp | 4 ++-- puppet/zulip/manifests/postgresql_base.pp | 2 +- puppet/zulip/manifests/postgresql_common.pp | 4 ++-- puppet/zulip/manifests/process_fts_updates.pp | 2 +- puppet/zulip/manifests/profile/app_frontend.pp | 2 +- puppet/zulip/manifests/profile/base.pp | 4 ++-- puppet/zulip/manifests/profile/memcached.pp | 2 +- puppet/zulip/manifests/profile/rabbitmq.pp | 2 +- puppet/zulip/manifests/profile/redis.pp | 2 +- puppet/zulip/manifests/sasl_modules.pp | 2 +- puppet/zulip/manifests/static_asset_compiler.pp | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/puppet/zulip/manifests/apache_sso.pp b/puppet/zulip/manifests/apache_sso.pp index 4efa565bf1..9983476c46 100644 --- a/puppet/zulip/manifests/apache_sso.pp +++ b/puppet/zulip/manifests/apache_sso.pp @@ -1,7 +1,7 @@ class zulip::apache_sso { include zulip::localhost_sso - case $::osfamily { + case $::os['family'] { 'debian': { $apache_packages = [ 'apache2', 'libapache2-mod-wsgi-py3', ] $conf_dir = '/etc/apache2' diff --git a/puppet/zulip/manifests/app_frontend_base.pp b/puppet/zulip/manifests/app_frontend_base.pp index d26dc48a2d..03c6ccf8b7 100644 --- a/puppet/zulip/manifests/app_frontend_base.pp +++ b/puppet/zulip/manifests/app_frontend_base.pp @@ -6,7 +6,7 @@ class zulip::app_frontend_base { include zulip::supervisor include zulip::tornado_sharding - if $::osfamily == 'debian' { + if $::os['family'] == 'debian' { # Upgrade and other tooling wants to be able to get a database # shell. This is not necessary on CentOS because the PostgreSQL # package already includes the client. This may get us a more diff --git a/puppet/zulip/manifests/common.pp b/puppet/zulip/manifests/common.pp index 8663edcb50..1adffa1fb5 100644 --- a/puppet/zulip/manifests/common.pp +++ b/puppet/zulip/manifests/common.pp @@ -1,6 +1,6 @@ class zulip::common { # Common parameters - case $::osfamily { + case $::os['family'] { 'debian': { $nagios_plugins = 'monitoring-plugins-basic' $nagios_plugins_dir = '/usr/lib/nagios/plugins' diff --git a/puppet/zulip/manifests/nginx.pp b/puppet/zulip/manifests/nginx.pp index 0ad56fe874..38d02c6018 100644 --- a/puppet/zulip/manifests/nginx.pp +++ b/puppet/zulip/manifests/nginx.pp @@ -6,7 +6,7 @@ class zulip::nginx { ] package { $web_packages: ensure => 'installed' } - if $::osfamily == 'redhat' { + if $::os['family'] == 'redhat' { file { '/etc/nginx/sites-available': ensure => 'directory', owner => 'root', @@ -80,7 +80,7 @@ class zulip::nginx { source => 'puppet:///modules/zulip/nginx/dhparam.pem', } - if $::osfamily == 'debian' { + if $::os['family'] == 'debian' { $ca_crt = '/etc/ssl/certs/ca-certificates.crt' } else { $ca_crt = '/etc/pki/tls/certs/ca-bundle.crt' diff --git a/puppet/zulip/manifests/postgresql_base.pp b/puppet/zulip/manifests/postgresql_base.pp index 2ec9058ff0..2406f0e245 100644 --- a/puppet/zulip/manifests/postgresql_base.pp +++ b/puppet/zulip/manifests/postgresql_base.pp @@ -3,7 +3,7 @@ class zulip::postgresql_base { include zulip::postgresql_common include zulip::process_fts_updates - case $::osfamily { + case $::os['family'] { 'debian': { $postgresql = "postgresql-${zulip::postgresql_common::version}" $postgresql_sharedir = "/usr/share/postgresql/${zulip::postgresql_common::version}" diff --git a/puppet/zulip/manifests/postgresql_common.pp b/puppet/zulip/manifests/postgresql_common.pp index 210bd6c90a..80b4c7c914 100644 --- a/puppet/zulip/manifests/postgresql_common.pp +++ b/puppet/zulip/manifests/postgresql_common.pp @@ -1,7 +1,7 @@ class zulip::postgresql_common { include zulip::snakeoil $version = zulipconf('postgresql', 'version', undef) - case $::osfamily { + case $::os['family'] { 'debian': { $postgresql = "postgresql-${version}" $postgresql_packages = [ @@ -63,7 +63,7 @@ class zulip::postgresql_common { require => Exec['generate-default-snakeoil'], } - if $::osfamily == 'debian' { + if $::os['family'] == 'debian' { # The logrotate file only created in debian-based systems exec { 'disable_logrotate': # lint:ignore:140chars diff --git a/puppet/zulip/manifests/process_fts_updates.pp b/puppet/zulip/manifests/process_fts_updates.pp index 4ad2847ca3..9845bdd073 100644 --- a/puppet/zulip/manifests/process_fts_updates.pp +++ b/puppet/zulip/manifests/process_fts_updates.pp @@ -1,6 +1,6 @@ class zulip::process_fts_updates { include zulip::supervisor - case $::osfamily { + case $::os['family'] { 'debian': { $fts_updates_packages = [ # Needed to run process_fts_updates diff --git a/puppet/zulip/manifests/profile/app_frontend.pp b/puppet/zulip/manifests/profile/app_frontend.pp index abb1ba4dfb..6e10743450 100644 --- a/puppet/zulip/manifests/profile/app_frontend.pp +++ b/puppet/zulip/manifests/profile/app_frontend.pp @@ -10,7 +10,7 @@ class zulip::profile::app_frontend { } else { $nginx_listen_port = zulipconf('application_server', 'nginx_listen_port', 443) } - $ssl_dir = $::osfamily ? { + $ssl_dir = $::os['family'] ? { 'debian' => '/etc/ssl', 'redhat' => '/etc/pki/tls', } diff --git a/puppet/zulip/manifests/profile/base.pp b/puppet/zulip/manifests/profile/base.pp index d5cc07edf3..1d0d05f51a 100644 --- a/puppet/zulip/manifests/profile/base.pp +++ b/puppet/zulip/manifests/profile/base.pp @@ -4,7 +4,7 @@ # be able to be deployed on their own host. class zulip::profile::base { include zulip::common - case $::osfamily { + case $::os['family'] { 'debian': { include zulip::apt_repository } @@ -15,7 +15,7 @@ class zulip::profile::base { fail('osfamily not supported') } } - case $::osfamily { + case $::os['family'] { 'debian': { $base_packages = [ # Basics diff --git a/puppet/zulip/manifests/profile/memcached.pp b/puppet/zulip/manifests/profile/memcached.pp index ec049a96b2..3db5564fd3 100644 --- a/puppet/zulip/manifests/profile/memcached.pp +++ b/puppet/zulip/manifests/profile/memcached.pp @@ -3,7 +3,7 @@ class zulip::profile::memcached { include zulip::sasl_modules include zulip::systemd_daemon_reload - case $::osfamily { + case $::os['family'] { 'debian': { $memcached_packages = [ 'memcached', 'sasl2-bin' ] $memcached_user = 'memcache' diff --git a/puppet/zulip/manifests/profile/rabbitmq.pp b/puppet/zulip/manifests/profile/rabbitmq.pp index 81c3ed864e..583d88b629 100644 --- a/puppet/zulip/manifests/profile/rabbitmq.pp +++ b/puppet/zulip/manifests/profile/rabbitmq.pp @@ -1,6 +1,6 @@ class zulip::profile::rabbitmq { include zulip::profile::base - $erlang = $::osfamily ? { + $erlang = $::os['family'] ? { 'debian' => 'erlang-base', 'redhat' => 'erlang', } diff --git a/puppet/zulip/manifests/profile/redis.pp b/puppet/zulip/manifests/profile/redis.pp index 083bfb2305..9e5f2c6048 100644 --- a/puppet/zulip/manifests/profile/redis.pp +++ b/puppet/zulip/manifests/profile/redis.pp @@ -1,6 +1,6 @@ class zulip::profile::redis { include zulip::profile::base - case $::osfamily { + case $::os['family'] { 'debian': { $redis = 'redis-server' $redis_dir = '/etc/redis' diff --git a/puppet/zulip/manifests/sasl_modules.pp b/puppet/zulip/manifests/sasl_modules.pp index d8da646a9d..34b190098f 100644 --- a/puppet/zulip/manifests/sasl_modules.pp +++ b/puppet/zulip/manifests/sasl_modules.pp @@ -1,5 +1,5 @@ class zulip::sasl_modules { - $sasl_module_packages = $::osfamily ? { + $sasl_module_packages = $::os['family'] ? { 'debian' => [ 'libsasl2-modules' ], 'redhat' => [ 'cyrus-sasl-plain' ], } diff --git a/puppet/zulip/manifests/static_asset_compiler.pp b/puppet/zulip/manifests/static_asset_compiler.pp index a523b678da..1a31678493 100644 --- a/puppet/zulip/manifests/static_asset_compiler.pp +++ b/puppet/zulip/manifests/static_asset_compiler.pp @@ -1,5 +1,5 @@ class zulip::static_asset_compiler { - case $::osfamily { + case $::os['family'] { 'debian': { $static_asset_compiler_packages = [ # Used by makemessages i18n