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
|
include zulip::localhost_sso
|
||||||
|
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$apache_packages = [ 'apache2', 'libapache2-mod-wsgi-py3', ]
|
$apache_packages = [ 'apache2', 'libapache2-mod-wsgi-py3', ]
|
||||||
$conf_dir = '/etc/apache2'
|
$conf_dir = '/etc/apache2'
|
||||||
$apache2 = 'apache2'
|
$apache2 = 'apache2'
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$apache_packages = [ 'httpd', 'python36u-mod_wsgi', ]
|
$apache_packages = [ 'httpd', 'python36u-mod_wsgi', ]
|
||||||
$conf_dir = '/etc/httpd'
|
$conf_dir = '/etc/httpd'
|
||||||
$apache2 = 'httpd'
|
$apache2 = 'httpd'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class zulip::app_frontend_base {
|
|||||||
include zulip::supervisor
|
include zulip::supervisor
|
||||||
include zulip::tornado_sharding
|
include zulip::tornado_sharding
|
||||||
|
|
||||||
if $::os['family'] == 'debian' {
|
if $::os['family'] == 'Debian' {
|
||||||
# Upgrade and other tooling wants to be able to get a database
|
# Upgrade and other tooling wants to be able to get a database
|
||||||
# shell. This is not necessary on CentOS because the PostgreSQL
|
# shell. This is not necessary on CentOS because the PostgreSQL
|
||||||
# package already includes the client. This may get us a more
|
# package already includes the client. This may get us a more
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class zulip::common {
|
class zulip::common {
|
||||||
# Common parameters
|
# Common parameters
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$nagios_plugins = 'monitoring-plugins-basic'
|
$nagios_plugins = 'monitoring-plugins-basic'
|
||||||
$nagios_plugins_dir = '/usr/lib/nagios/plugins'
|
$nagios_plugins_dir = '/usr/lib/nagios/plugins'
|
||||||
$nginx = 'nginx-full'
|
$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_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'
|
$supervisor_status = '/etc/init.d/supervisor status'
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$nagios_plugins = 'nagios-plugins'
|
$nagios_plugins = 'nagios-plugins'
|
||||||
$nagios_plugins_dir = '/usr/lib64/nagios/plugins'
|
$nagios_plugins_dir = '/usr/lib64/nagios/plugins'
|
||||||
$nginx = 'nginx'
|
$nginx = 'nginx'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class zulip::nginx {
|
|||||||
]
|
]
|
||||||
package { $web_packages: ensure => 'installed' }
|
package { $web_packages: ensure => 'installed' }
|
||||||
|
|
||||||
if $::os['family'] == 'redhat' {
|
if $::os['family'] == 'RedHat' {
|
||||||
file { '/etc/nginx/sites-available':
|
file { '/etc/nginx/sites-available':
|
||||||
ensure => 'directory',
|
ensure => 'directory',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
@@ -80,7 +80,7 @@ class zulip::nginx {
|
|||||||
source => 'puppet:///modules/zulip/nginx/dhparam.pem',
|
source => 'puppet:///modules/zulip/nginx/dhparam.pem',
|
||||||
}
|
}
|
||||||
|
|
||||||
if $::os['family'] == 'debian' {
|
if $::os['family'] == 'Debian' {
|
||||||
$ca_crt = '/etc/ssl/certs/ca-certificates.crt'
|
$ca_crt = '/etc/ssl/certs/ca-certificates.crt'
|
||||||
} else {
|
} else {
|
||||||
$ca_crt = '/etc/pki/tls/certs/ca-bundle.crt'
|
$ca_crt = '/etc/pki/tls/certs/ca-bundle.crt'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class zulip::postgresql_base {
|
|||||||
include zulip::process_fts_updates
|
include zulip::process_fts_updates
|
||||||
|
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$postgresql = "postgresql-${zulip::postgresql_common::version}"
|
$postgresql = "postgresql-${zulip::postgresql_common::version}"
|
||||||
$postgresql_sharedir = "/usr/share/postgresql/${zulip::postgresql_common::version}"
|
$postgresql_sharedir = "/usr/share/postgresql/${zulip::postgresql_common::version}"
|
||||||
$postgresql_confdirs = [
|
$postgresql_confdirs = [
|
||||||
@@ -20,7 +20,7 @@ class zulip::postgresql_base {
|
|||||||
$postgresql_dict_dict = '/var/cache/postgresql/dicts/en_us.dict'
|
$postgresql_dict_dict = '/var/cache/postgresql/dicts/en_us.dict'
|
||||||
$postgresql_dict_affix = '/var/cache/postgresql/dicts/en_us.affix'
|
$postgresql_dict_affix = '/var/cache/postgresql/dicts/en_us.affix'
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$postgresql = "postgresql${zulip::postgresql_common::version}"
|
$postgresql = "postgresql${zulip::postgresql_common::version}"
|
||||||
$postgresql_sharedir = "/usr/pgsql-${zulip::postgresql_common::version}/share"
|
$postgresql_sharedir = "/usr/pgsql-${zulip::postgresql_common::version}/share"
|
||||||
$postgresql_confdirs = [
|
$postgresql_confdirs = [
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class zulip::postgresql_common {
|
|||||||
include zulip::snakeoil
|
include zulip::snakeoil
|
||||||
$version = zulipconf('postgresql', 'version', undef)
|
$version = zulipconf('postgresql', 'version', undef)
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$postgresql = "postgresql-${version}"
|
$postgresql = "postgresql-${version}"
|
||||||
$postgresql_packages = [
|
$postgresql_packages = [
|
||||||
# The database itself
|
# The database itself
|
||||||
@@ -21,7 +21,7 @@ class zulip::postgresql_common {
|
|||||||
Package['ssl-cert'],
|
Package['ssl-cert'],
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$postgresql = "postgresql${version}"
|
$postgresql = "postgresql${version}"
|
||||||
$postgresql_packages = [
|
$postgresql_packages = [
|
||||||
$postgresql,
|
$postgresql,
|
||||||
@@ -63,7 +63,7 @@ class zulip::postgresql_common {
|
|||||||
require => Exec['generate-default-snakeoil'],
|
require => Exec['generate-default-snakeoil'],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $::os['family'] == 'debian' {
|
if $::os['family'] == 'Debian' {
|
||||||
# The logrotate file only created in debian-based systems
|
# The logrotate file only created in debian-based systems
|
||||||
exec { 'disable_logrotate':
|
exec { 'disable_logrotate':
|
||||||
# lint:ignore:140chars
|
# lint:ignore:140chars
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
class zulip::process_fts_updates {
|
class zulip::process_fts_updates {
|
||||||
include zulip::supervisor
|
include zulip::supervisor
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$fts_updates_packages = [
|
$fts_updates_packages = [
|
||||||
# Needed to run process_fts_updates
|
# Needed to run process_fts_updates
|
||||||
'python3-psycopg2', # TODO: use a virtualenv instead
|
'python3-psycopg2', # TODO: use a virtualenv instead
|
||||||
]
|
]
|
||||||
zulip::safepackage { $fts_updates_packages: ensure => 'installed' }
|
zulip::safepackage { $fts_updates_packages: ensure => 'installed' }
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
exec {'pip_process_fts_updates':
|
exec {'pip_process_fts_updates':
|
||||||
command => 'python3 -m pip install psycopg2',
|
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)
|
$nginx_listen_port = zulipconf('application_server', 'nginx_listen_port', 443)
|
||||||
}
|
}
|
||||||
$ssl_dir = $::os['family'] ? {
|
$ssl_dir = $::os['family'] ? {
|
||||||
'debian' => '/etc/ssl',
|
'Debian' => '/etc/ssl',
|
||||||
'redhat' => '/etc/pki/tls',
|
'RedHat' => '/etc/pki/tls',
|
||||||
}
|
}
|
||||||
file { '/etc/nginx/sites-available/zulip-enterprise':
|
file { '/etc/nginx/sites-available/zulip-enterprise':
|
||||||
ensure => file,
|
ensure => file,
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
class zulip::profile::base {
|
class zulip::profile::base {
|
||||||
include zulip::common
|
include zulip::common
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
include zulip::apt_repository
|
include zulip::apt_repository
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
include zulip::yum_repository
|
include zulip::yum_repository
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -16,7 +16,7 @@ class zulip::profile::base {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$base_packages = [
|
$base_packages = [
|
||||||
# Basics
|
# Basics
|
||||||
'python3',
|
'python3',
|
||||||
@@ -40,7 +40,7 @@ class zulip::profile::base {
|
|||||||
'cron',
|
'cron',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$base_packages = [
|
$base_packages = [
|
||||||
'python3',
|
'python3',
|
||||||
'python3-pyyaml',
|
'python3-pyyaml',
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ class zulip::profile::memcached {
|
|||||||
include zulip::systemd_daemon_reload
|
include zulip::systemd_daemon_reload
|
||||||
|
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$memcached_packages = [ 'memcached', 'sasl2-bin' ]
|
$memcached_packages = [ 'memcached', 'sasl2-bin' ]
|
||||||
$memcached_user = 'memcache'
|
$memcached_user = 'memcache'
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$memcached_packages = [ 'memcached', 'cyrus-sasl' ]
|
$memcached_packages = [ 'memcached', 'cyrus-sasl' ]
|
||||||
$memcached_user = 'memcached'
|
$memcached_user = 'memcached'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class zulip::profile::rabbitmq {
|
class zulip::profile::rabbitmq {
|
||||||
include zulip::profile::base
|
include zulip::profile::base
|
||||||
$erlang = $::os['family'] ? {
|
$erlang = $::os['family'] ? {
|
||||||
'debian' => 'erlang-base',
|
'Debian' => 'erlang-base',
|
||||||
'redhat' => 'erlang',
|
'RedHat' => 'erlang',
|
||||||
}
|
}
|
||||||
$rabbitmq_packages = [
|
$rabbitmq_packages = [
|
||||||
$erlang,
|
$erlang,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
class zulip::profile::redis {
|
class zulip::profile::redis {
|
||||||
include zulip::profile::base
|
include zulip::profile::base
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$redis = 'redis-server'
|
$redis = 'redis-server'
|
||||||
$redis_dir = '/etc/redis'
|
$redis_dir = '/etc/redis'
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$redis = 'redis'
|
$redis = 'redis'
|
||||||
$redis_dir = '/etc'
|
$redis_dir = '/etc'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class zulip::sasl_modules {
|
class zulip::sasl_modules {
|
||||||
$sasl_module_packages = $::os['family'] ? {
|
$sasl_module_packages = $::os['family'] ? {
|
||||||
'debian' => [ 'libsasl2-modules' ],
|
'Debian' => [ 'libsasl2-modules' ],
|
||||||
'redhat' => [ 'cyrus-sasl-plain' ],
|
'RedHat' => [ 'cyrus-sasl-plain' ],
|
||||||
}
|
}
|
||||||
package { $sasl_module_packages: ensure => 'installed' }
|
package { $sasl_module_packages: ensure => 'installed' }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
class zulip::static_asset_compiler {
|
class zulip::static_asset_compiler {
|
||||||
case $::os['family'] {
|
case $::os['family'] {
|
||||||
'debian': {
|
'Debian': {
|
||||||
$static_asset_compiler_packages = [
|
$static_asset_compiler_packages = [
|
||||||
# Used by makemessages i18n
|
# Used by makemessages i18n
|
||||||
'gettext',
|
'gettext',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
'redhat': {
|
'RedHat': {
|
||||||
$static_asset_compiler_packages = [
|
$static_asset_compiler_packages = [
|
||||||
'gettext',
|
'gettext',
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user