mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
puppet: Switch to the canonical case for $::os['family'].
The == operator in Puppet is case-insensitive for ASCII characters[1], which is potentially surprising. Switch to the canonical case that `$::os['family']` returns. [1] https://puppet.com/docs/puppet/5.5/lang_expressions.html#string-encoding-and-comparisons
This commit is contained in:
committed by
Alex Vandiver
parent
d4eefbbeea
commit
bb4c0799cc
@@ -2,12 +2,12 @@ class zulip::apache_sso {
|
||||
include zulip::localhost_sso
|
||||
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$apache_packages = [ 'apache2', 'libapache2-mod-wsgi-py3', ]
|
||||
$conf_dir = '/etc/apache2'
|
||||
$apache2 = 'apache2'
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$apache_packages = [ 'httpd', 'python36u-mod_wsgi', ]
|
||||
$conf_dir = '/etc/httpd'
|
||||
$apache2 = 'httpd'
|
||||
|
||||
@@ -6,7 +6,7 @@ class zulip::app_frontend_base {
|
||||
include zulip::supervisor
|
||||
include zulip::tornado_sharding
|
||||
|
||||
if $::os['family'] == '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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class zulip::common {
|
||||
# Common parameters
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$nagios_plugins = 'monitoring-plugins-basic'
|
||||
$nagios_plugins_dir = '/usr/lib/nagios/plugins'
|
||||
$nginx = 'nginx-full'
|
||||
@@ -14,7 +14,7 @@ class zulip::common {
|
||||
$supervisor_reload = '/etc/init.d/supervisor restart && (/etc/init.d/supervisor start || /bin/true) && /etc/init.d/supervisor status'
|
||||
$supervisor_status = '/etc/init.d/supervisor status'
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$nagios_plugins = 'nagios-plugins'
|
||||
$nagios_plugins_dir = '/usr/lib64/nagios/plugins'
|
||||
$nginx = 'nginx'
|
||||
|
||||
@@ -6,7 +6,7 @@ class zulip::nginx {
|
||||
]
|
||||
package { $web_packages: ensure => 'installed' }
|
||||
|
||||
if $::os['family'] == '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 $::os['family'] == 'debian' {
|
||||
if $::os['family'] == 'Debian' {
|
||||
$ca_crt = '/etc/ssl/certs/ca-certificates.crt'
|
||||
} else {
|
||||
$ca_crt = '/etc/pki/tls/certs/ca-bundle.crt'
|
||||
|
||||
@@ -4,7 +4,7 @@ class zulip::postgresql_base {
|
||||
include zulip::process_fts_updates
|
||||
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$postgresql = "postgresql-${zulip::postgresql_common::version}"
|
||||
$postgresql_sharedir = "/usr/share/postgresql/${zulip::postgresql_common::version}"
|
||||
$postgresql_confdirs = [
|
||||
@@ -20,7 +20,7 @@ class zulip::postgresql_base {
|
||||
$postgresql_dict_dict = '/var/cache/postgresql/dicts/en_us.dict'
|
||||
$postgresql_dict_affix = '/var/cache/postgresql/dicts/en_us.affix'
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$postgresql = "postgresql${zulip::postgresql_common::version}"
|
||||
$postgresql_sharedir = "/usr/pgsql-${zulip::postgresql_common::version}/share"
|
||||
$postgresql_confdirs = [
|
||||
|
||||
@@ -2,7 +2,7 @@ class zulip::postgresql_common {
|
||||
include zulip::snakeoil
|
||||
$version = zulipconf('postgresql', 'version', undef)
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$postgresql = "postgresql-${version}"
|
||||
$postgresql_packages = [
|
||||
# The database itself
|
||||
@@ -21,7 +21,7 @@ class zulip::postgresql_common {
|
||||
Package['ssl-cert'],
|
||||
]
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$postgresql = "postgresql${version}"
|
||||
$postgresql_packages = [
|
||||
$postgresql,
|
||||
@@ -63,7 +63,7 @@ class zulip::postgresql_common {
|
||||
require => Exec['generate-default-snakeoil'],
|
||||
}
|
||||
|
||||
if $::os['family'] == 'debian' {
|
||||
if $::os['family'] == 'Debian' {
|
||||
# The logrotate file only created in debian-based systems
|
||||
exec { 'disable_logrotate':
|
||||
# lint:ignore:140chars
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
class zulip::process_fts_updates {
|
||||
include zulip::supervisor
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$fts_updates_packages = [
|
||||
# Needed to run process_fts_updates
|
||||
'python3-psycopg2', # TODO: use a virtualenv instead
|
||||
]
|
||||
zulip::safepackage { $fts_updates_packages: ensure => 'installed' }
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
exec {'pip_process_fts_updates':
|
||||
command => 'python3 -m pip install psycopg2',
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ class zulip::profile::app_frontend {
|
||||
$nginx_listen_port = zulipconf('application_server', 'nginx_listen_port', 443)
|
||||
}
|
||||
$ssl_dir = $::os['family'] ? {
|
||||
'debian' => '/etc/ssl',
|
||||
'redhat' => '/etc/pki/tls',
|
||||
'Debian' => '/etc/ssl',
|
||||
'RedHat' => '/etc/pki/tls',
|
||||
}
|
||||
file { '/etc/nginx/sites-available/zulip-enterprise':
|
||||
ensure => file,
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
class zulip::profile::base {
|
||||
include zulip::common
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
include zulip::apt_repository
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
include zulip::yum_repository
|
||||
}
|
||||
default: {
|
||||
@@ -16,7 +16,7 @@ class zulip::profile::base {
|
||||
}
|
||||
}
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$base_packages = [
|
||||
# Basics
|
||||
'python3',
|
||||
@@ -40,7 +40,7 @@ class zulip::profile::base {
|
||||
'cron',
|
||||
]
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$base_packages = [
|
||||
'python3',
|
||||
'python3-pyyaml',
|
||||
|
||||
@@ -4,11 +4,11 @@ class zulip::profile::memcached {
|
||||
include zulip::systemd_daemon_reload
|
||||
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$memcached_packages = [ 'memcached', 'sasl2-bin' ]
|
||||
$memcached_user = 'memcache'
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$memcached_packages = [ 'memcached', 'cyrus-sasl' ]
|
||||
$memcached_user = 'memcached'
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class zulip::profile::rabbitmq {
|
||||
include zulip::profile::base
|
||||
$erlang = $::os['family'] ? {
|
||||
'debian' => 'erlang-base',
|
||||
'redhat' => 'erlang',
|
||||
'Debian' => 'erlang-base',
|
||||
'RedHat' => 'erlang',
|
||||
}
|
||||
$rabbitmq_packages = [
|
||||
$erlang,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
class zulip::profile::redis {
|
||||
include zulip::profile::base
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$redis = 'redis-server'
|
||||
$redis_dir = '/etc/redis'
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$redis = 'redis'
|
||||
$redis_dir = '/etc'
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class zulip::sasl_modules {
|
||||
$sasl_module_packages = $::os['family'] ? {
|
||||
'debian' => [ 'libsasl2-modules' ],
|
||||
'redhat' => [ 'cyrus-sasl-plain' ],
|
||||
'Debian' => [ 'libsasl2-modules' ],
|
||||
'RedHat' => [ 'cyrus-sasl-plain' ],
|
||||
}
|
||||
package { $sasl_module_packages: ensure => 'installed' }
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
class zulip::static_asset_compiler {
|
||||
case $::os['family'] {
|
||||
'debian': {
|
||||
'Debian': {
|
||||
$static_asset_compiler_packages = [
|
||||
# Used by makemessages i18n
|
||||
'gettext',
|
||||
]
|
||||
}
|
||||
'redhat': {
|
||||
'RedHat': {
|
||||
$static_asset_compiler_packages = [
|
||||
'gettext',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user