mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
puppet: Ensure a snakeoil certificate, for Postfix and PostgreSQL.
We use the snakeoil TLS certificate for PostgreSQL and Postfix; some VMs install the `ssl-cert` package but (reasonably) don't build the snakeoil certs into the image. Build them as needed. Fixes #14955.
This commit is contained in:
committed by
Tim Abbott
parent
bdb20a8002
commit
9de35d98d3
@@ -1,4 +1,5 @@
|
||||
class zulip::postfix_localmail {
|
||||
include zulip::snakeoil
|
||||
$postfix_packages = [ 'postfix', ]
|
||||
|
||||
if $::fqdn == '' {
|
||||
@@ -11,6 +12,7 @@ class zulip::postfix_localmail {
|
||||
}
|
||||
|
||||
service { 'postfix':
|
||||
require => Exec['generate-default-snakeoil'],
|
||||
}
|
||||
|
||||
file {'/etc/mailname':
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class zulip::postgresql_common {
|
||||
include zulip::snakeoil
|
||||
$version = zulipconf('postgresql', 'version', undef)
|
||||
case $::osfamily {
|
||||
'debian': {
|
||||
@@ -8,8 +9,6 @@ class zulip::postgresql_common {
|
||||
$postgresql,
|
||||
# tools for database monitoring; formerly ptop
|
||||
'pgtop',
|
||||
# Needed just to support adding postgres user to 'zulip' group
|
||||
'ssl-cert',
|
||||
# our dictionary
|
||||
'hunspell-en-us',
|
||||
# PostgreSQL Nagios check plugin
|
||||
@@ -59,7 +58,10 @@ class zulip::postgresql_common {
|
||||
}
|
||||
}
|
||||
|
||||
zulip::safepackage { $postgresql_packages: ensure => 'installed' }
|
||||
zulip::safepackage { $postgresql_packages:
|
||||
ensure => 'installed',
|
||||
require => Exec['generate-default-snakeoil'],
|
||||
}
|
||||
|
||||
if $::osfamily == 'debian' {
|
||||
# The logrotate file only created in debian-based systems
|
||||
|
||||
12
puppet/zulip/manifests/snakeoil.pp
Normal file
12
puppet/zulip/manifests/snakeoil.pp
Normal file
@@ -0,0 +1,12 @@
|
||||
class zulip::snakeoil {
|
||||
zulip::safepackage { 'ssl-cert': ensure => 'installed' }
|
||||
|
||||
# We use the snakeoil certificate for PostgreSQL and Postfix; some VMs
|
||||
# install the `ssl-cert` package but (reasonably) don't build the
|
||||
# snakeoil certs into the image; build them as needed.
|
||||
exec { 'generate-default-snakeoil':
|
||||
require => Package['ssl-cert'],
|
||||
creates => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
|
||||
command => '/usr/sbin/make-ssl-cert generate-default-snakeoil',
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user