2016-10-17 04:05:49 +02:00
|
|
|
class zulip_ops::stats {
|
|
|
|
include zulip_ops::base
|
|
|
|
include zulip_ops::apache
|
2013-11-01 20:28:03 +01:00
|
|
|
include zulip::supervisor
|
2013-07-23 18:27:14 +02:00
|
|
|
|
|
|
|
$stats_packages = [ "libssl-dev", "zlib1g-dev", "python-twisted", "python-django", "python-django-tagging",
|
|
|
|
"python-carbon", "python-cairo", "python-graphite-web", "python-whisper", "redis-server" ]
|
|
|
|
package { $stats_packages: ensure => "installed" }
|
|
|
|
|
|
|
|
file { "/root/setup_disks.sh":
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => 744,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => 'puppet:///modules/zulip_ops/graphite/setup_disks.sh',
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
file { "/etc/cron.d/graphite_backup":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/cron.d/graphite_backup",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
exec { "setup_disks":
|
|
|
|
command => "/root/setup_disks.sh",
|
|
|
|
creates => "/srv/graphite"
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "/etc/ssl/certs/stats1.zulip.net.crt":
|
|
|
|
require => File["/etc/apache2/certs/"],
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 640,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/certs/stats1.zulip.net.crt",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { "/opt/graphite/conf/carbon.conf":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/graphite/carbon.conf",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
file { "/opt/graphite/conf/aggregation-rules.conf":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/graphite/aggregation-rules.conf",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
file { "/opt/graphite/conf/storage-aggregation.conf":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/graphite/storage-aggregation.conf",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
file { "/opt/graphite/conf/storage-schemas.conf":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/graphite/storage-schemas.conf",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
file { "/opt/graphite/webapp/graphite/local_settings.py":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/graphite/local_settings.py",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
file { "/opt/graphite/conf/graphite.wsgi":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/graphite/graphite.wsgi",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
|
2013-10-04 19:19:57 +02:00
|
|
|
file { "/home/zulip/graphiti/config/settings.yml":
|
2013-07-23 18:27:14 +02:00
|
|
|
ensure => file,
|
2013-10-04 20:23:48 +02:00
|
|
|
owner => "zulip",
|
|
|
|
group => "zulip",
|
2013-07-23 18:27:14 +02:00
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/graphiti/settings.yml",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
apache2site { 'graphite':
|
|
|
|
require => [File['/etc/apache2/sites-available/'],
|
|
|
|
Apache2mod['headers'], Apache2mod['ssl'],
|
|
|
|
],
|
|
|
|
ensure => present,
|
|
|
|
}
|
|
|
|
apache2site { 'graphiti':
|
|
|
|
require => [File['/etc/apache2/sites-available/'],
|
|
|
|
Apache2mod['headers'], Apache2mod['ssl'],
|
|
|
|
],
|
|
|
|
ensure => present,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "/etc/redis/redis.conf":
|
|
|
|
require => Package[redis-server],
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/statsd/redis.conf",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
service { 'redis-server':
|
|
|
|
ensure => running,
|
|
|
|
subscribe => File['/etc/redis/redis.conf'],
|
|
|
|
}
|
|
|
|
|
|
|
|
file { "/etc/supervisor/conf.d/stats.conf":
|
|
|
|
ensure => file,
|
|
|
|
owner => "root",
|
|
|
|
group => "root",
|
|
|
|
mode => 644,
|
2016-10-17 04:05:49 +02:00
|
|
|
source => "puppet:///modules/zulip_ops/supervisor/conf.d/stats.conf",
|
2013-07-23 18:27:14 +02:00
|
|
|
}
|
|
|
|
}
|