Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

kandra: Chown to zulip:zulip after mounting.

Alex Vandiverec81f5f29b30
diff --git a/puppet/kandra/manifests/app_frontend_tmpfs.pp b/puppet/kandra/manifests/app_frontend_tmpfs.pp
index 5a6e8323b8a..a0d2eb2aad3 100644
--- a/puppet/kandra/manifests/app_frontend_tmpfs.pp
+++ b/puppet/kandra/manifests/app_frontend_tmpfs.pp
@@ -22,8 +22,6 @@ class kandra::app_frontend_tmpfs {
file { '/tmp/slack-conversions':
ensure => 'directory',
mode => '0755',
- owner => 'root',
- group => 'root',
}
mount { '/tmp/slack-conversions':
ensure => 'mounted',
@@ -33,4 +31,13 @@ class kandra::app_frontend_tmpfs {
options => 'defaults,noatime,discard,commit=60,errors=remount-ro',
require => Exec['format partition'],
}
+
+ # We want ownership to be enforced after the mount, so the File
+ # directive above doesn't have user/group, and we manage it
+ # explicitly via chown.
+ exec { 'chown-slack-conversions':
+ command => '/bin/chown zulip:zulip /tmp/slack-conversions',
+ unless => '/usr/bin/test "$(stat -c %U:%G /tmp/slack-conversions)" = "zulip:zulip"',
+ require => Mount['/tmp/slack-conversions'],
+ }
}