puppet: Switch memcached to using common total_memory_mb value.

This just cuts a bit of unnecessary code duplication.
This commit is contained in:
Tim Abbott
2018-05-24 09:49:43 -07:00
parent a0e24e6d1f
commit b83ba85100

View File

@@ -2,8 +2,7 @@ class zulip::memcached {
$memcached_packages = ['memcached']
package { $memcached_packages: ensure => 'installed' }
$total_memory_mb = regsubst(file('/proc/meminfo'), '^.*MemTotal:\s*(\d+) kB.*$', '\1', 'M') / 1024
$memcached_memory = zulipconf('memcached', 'memory', $total_memory_mb / 8)
$memcached_memory = zulipconf('memcached', 'memory', $zulip::base::total_memory_mb / 8)
file { '/etc/memcached.conf':
ensure => file,
require => Package[memcached],