Skip to content

Commit

Permalink
puppet: Extract zulip::analytics.
Browse files Browse the repository at this point in the history
I'm not altogether happy with this (a better solution would be
database-level locking), but I think it solves the immediate problem
of folks with 2 servers being very likely to run analytics on both of
them.
  • Loading branch information
timabbott committed Feb 7, 2017
1 parent f79bced commit ba5f454
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
11 changes: 11 additions & 0 deletions puppet/zulip/manifests/analytics.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default configuration for a Zulip app frontend
class zulip::analytics {
# This should only be enabled on exactly 1 Zulip server in a cluster.
file { "/etc/cron.d/update-analytics-counts":
ensure => file,
owner => "root",
group => "root",
mode => 644,
source => "puppet:///modules/zulip/cron.d/update-analytics-counts",
}
}
10 changes: 2 additions & 8 deletions puppet/zulip/manifests/app_frontend.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Default configuration for a Zulip app frontend
class zulip::app_frontend {
include zulip::app_frontend_base
# For a single-server setup, run analytics on that server
include zulip::analytics

file { "/etc/nginx/sites-available/zulip-enterprise":
require => Package["nginx-full"],
Expand Down Expand Up @@ -42,12 +44,4 @@
mode => 644,
source => "puppet:///modules/zulip/cron.d/restart-zulip",
}
# This should only be enabled on exactly 1 Zulip server in a cluster.
file { "/etc/cron.d/update-analytics-counts":
ensure => file,
owner => "root",
group => "root",
mode => 644,
source => "puppet:///modules/zulip/cron.d/update-analytics-counts",
}
}
1 change: 1 addition & 0 deletions puppet/zulip_ops/manifests/prod_app_frontend.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class zulip_ops::prod_app_frontend {
include zulip_ops::base
include zulip_ops::app_frontend
include zulip::analytics

file { "/etc/nginx/sites-available/zulip":
require => Package["nginx-full"],
Expand Down

0 comments on commit ba5f454

Please sign in to comment.