puppet: Work around memcached SASL configuration path bug.

memcached 1.5.22 in Ubuntu 20.04 has a bug where it looks for its SASL
configuration at /etc/sasl2/memcached.conf/memcached.conf instead of
/etc/sasl2/memcached.conf.

https://bugs.launchpad.net/ubuntu/+source/memcached/+bug/1878721

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-05-14 18:12:23 -07:00
parent 27ee527bd6
commit 99e71f3786
2 changed files with 25 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
class zulip::memcached {
include zulip::sasl_modules
include zulip::systemd_daemon_reload
$memcached_packages = $::osfamily ? {
'debian' => [ 'memcached', 'sasl2-bin' ],
@@ -47,6 +48,24 @@ class zulip::memcached {
source => 'puppet:///modules/zulip/sasl2/memcached.conf',
notify => Service[memcached],
}
file { '/etc/systemd/system/memcached.service.d':
ensure => directory,
}
file { '/etc/systemd/system/memcached.service.d/zulip-fix-sasl.conf':
require => File['/etc/systemd/system/memcached.service.d'],
owner => 'root',
group => 'root',
mode => '0644',
content => "\
# https://bugs.launchpad.net/ubuntu/+source/memcached/+bug/1878721
[Service]
Environment=SASL_CONF_PATH=/etc/sasl2
",
notify => [
Class['zulip::systemd_daemon_reload'],
Service['memcached'],
],
}
file { '/etc/memcached.conf':
ensure => file,
require => [
@@ -61,5 +80,6 @@ class zulip::memcached {
service { 'memcached':
ensure => running,
subscribe => File['/etc/memcached.conf'],
require => Class['zulip::systemd_daemon_reload'];
}
}

View File

@@ -0,0 +1,5 @@
class zulip::systemd_daemon_reload {
exec { 'sh -c "! command -v systemctl > /dev/null || systemctl daemon-reload"':
refreshonly => true,
}
}