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.

puppet: Don't run thumbor services in production.

Mateusz Mandera57d3ef42b890
diff --git a/puppet/zulip/manifests/dockervoyager.pp b/puppet/zulip/manifests/dockervoyager.pp
index 1c003c6684a..15b42fd8539 100644
--- a/puppet/zulip/manifests/dockervoyager.pp
+++ b/puppet/zulip/manifests/dockervoyager.pp
@@ -9,7 +9,6 @@ class zulip::dockervoyager {
include zulip::app_frontend
include zulip::supervisor
include zulip::process_fts_updates
- include zulip::thumbor
file { "${zulip::common::supervisor_conf_dir}/cron.conf":
ensure => file,
diff --git a/puppet/zulip/manifests/supervisor.pp b/puppet/zulip/manifests/supervisor.pp
index 5fdf2c41074..0ea8f2c2298 100644
--- a/puppet/zulip/manifests/supervisor.pp
+++ b/puppet/zulip/manifests/supervisor.pp
@@ -81,4 +81,18 @@ class zulip::supervisor {
source => 'puppet:///modules/zulip/supervisor/supervisord.conf',
notify => Exec['supervisor-restart'],
}
+
+ # We need a block here to handle deleting the old thumbor.conf file,
+ # unless zulip::thumbor has been enabled. It would be cleaner
+ # to use tidy instead of exec here, but notify is broken with it
+ # (https://tickets.puppetlabs.com/browse/PUP-6021)
+ # so we wouldn't be able to notify the supervisor service.
+ $thumbor_enabled = defined(Class['zulip::thumbor'])
+ if !$thumbor_enabled {
+ exec { 'cleanup_thumbor_supervisor_conf_file':
+ command => "rm ${zulip::common::supervisor_conf_dir}/thumbor.conf",
+ onlyif => "test -e ${zulip::common::supervisor_conf_dir}/thumbor.conf",
+ notify => Service[$zulip::common::supervisor_service],
+ }
+ }
}
diff --git a/puppet/zulip/manifests/voyager.pp b/puppet/zulip/manifests/voyager.pp
index 9a967b5a5e0..6615055c52c 100644
--- a/puppet/zulip/manifests/voyager.pp
+++ b/puppet/zulip/manifests/voyager.pp
@@ -33,5 +33,4 @@ class zulip::voyager {
include zulip::localhost_camo
}
include zulip::static_asset_compiler
- include zulip::thumbor
}