mirror of https://github.com/zulip/zulip.git
puppet: Switch puppet to using include-style class declarations
This allows us to declare classes more than once, which we need as we're making our class dependency graph more complicated. See http://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html#aside-history-the-future-and-best-practices (imported from commit d4199b0df0d92d166fbc3559957f67ee9cf2ecdc)
This commit is contained in:
parent
0073014ea9
commit
b3e6d49d2f
|
@ -1,5 +1,5 @@
|
|||
class zulip-internal::base {
|
||||
class { 'zulip::base': }
|
||||
include zulip::base
|
||||
|
||||
$org_base_packages = [ "nagios-plugins-basic", "munin-node", "munin-plugins-extra" ]
|
||||
package { $org_base_packages: ensure => "installed" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::bots {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip::supervisor': }
|
||||
include zulip-internal::base
|
||||
include zulip::supervisor
|
||||
|
||||
file { '/etc/supervisor/conf.d/feedback-bot.conf':
|
||||
ensure => absent,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class zulip-internal::builder {
|
||||
class { 'zulip-internal::base': }
|
||||
include zulip-internal::base
|
||||
|
||||
$buildd_packages = [
|
||||
"apt-spy",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class zulip-internal::git {
|
||||
class { 'zulip-internal::base': }
|
||||
include zulip-internal::base
|
||||
|
||||
$git_packages = [ ]
|
||||
package { $git_packages: ensure => "installed" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::loadbalancer {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip::nginx': }
|
||||
include zulip-internal::base
|
||||
include zulip::nginx
|
||||
|
||||
file { "/etc/nginx/zulip-include/":
|
||||
require => Package[nginx],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class zulip-internal::mediawiki {
|
||||
class { 'zulip-internal::postgres-common': }
|
||||
include zulip-internal::postgres-common
|
||||
|
||||
|
||||
$mediawiki_packages = [ "mediawiki", "mediawiki-extensions" ]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::nagios {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip-internal::apache': }
|
||||
include zulip-internal::base
|
||||
include zulip-internal::apache
|
||||
|
||||
$nagios_packages = [ "nagios3", "munin", "autossh" ]
|
||||
package { $nagios_packages: ensure => "installed" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::postgres-appdb {
|
||||
class { 'zulip-internal::postgres-common': }
|
||||
class { 'zulip::supervisor': }
|
||||
include zulip-internal::postgres-common
|
||||
include zulip::supervisor
|
||||
|
||||
$appdb_packages = [ "python-psycopg2",]
|
||||
package { $appdb_packages: ensure => "installed" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::postgres-master {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip-internal::postgres-appdb': }
|
||||
include zulip-internal::base
|
||||
include zulip-internal::postgres-appdb
|
||||
|
||||
$master_packages = [ "xfsprogs", "mdadm", ]
|
||||
package { $master_packages: ensure => "installed" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::postgres-slave {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip-internal::postgres-appdb': }
|
||||
include zulip-internal::base
|
||||
include zulip-internal::postgres-appdb
|
||||
|
||||
# We bundle a bunch of other sysctl parameters into 40-postgresql.conf
|
||||
file { '/etc/sysctl.d/30-postgresql-shm.conf':
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::prod_app_frontend {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip::app_frontend': }
|
||||
include zulip-internal::base
|
||||
include zulip::app_frontend
|
||||
|
||||
file { "/etc/nginx/sites-available/zulip":
|
||||
require => Package[nginx],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::staging_app_frontend {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip::app_frontend': }
|
||||
include zulip-internal::base
|
||||
include zulip::app_frontend
|
||||
|
||||
$packages = [ "python-html2text" ]
|
||||
package { $packages: ensure => "installed" }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class zulip-internal::stats {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip-internal::apache': }
|
||||
class { 'zulip::supervisor': }
|
||||
include zulip-internal::base
|
||||
include zulip-internal::apache
|
||||
include zulip::supervisor
|
||||
|
||||
$stats_packages = [ "libssl-dev", "zlib1g-dev", "python-twisted", "python-django", "python-django-tagging",
|
||||
"python-carbon", "python-cairo", "python-graphite-web", "python-whisper", "redis-server" ]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class zulip-internal::trac {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip-internal::apache': }
|
||||
class { 'zulip-internal::mediawiki': }
|
||||
include zulip-internal::base
|
||||
include zulip-internal::apache
|
||||
include zulip-internal::mediawiki
|
||||
|
||||
$trac_packages = [ "trac", ]
|
||||
package { $trac_packages: ensure => "installed" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::zmirror {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip::supervisor': }
|
||||
include zulip-internal::base
|
||||
include zulip::supervisor
|
||||
|
||||
$zmirror_packages = [ "cython", "libzephyr-dev", "comerr-dev", "python-dev", "libzephyr4-krb5", "zephyr-clients",
|
||||
"krb5-config", "krb5-user", "krb5-clients", "debathena-kerberos-config", "debathena-zephyr-config"]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip-internal::zmirror_personals {
|
||||
class { 'zulip-internal::base': }
|
||||
class { 'zulip::supervisor': }
|
||||
include zulip-internal::base
|
||||
include zulip::supervisor
|
||||
|
||||
$zmirror_packages = [ "cython", "libzephyr-dev", "comerr-dev", "python-dev", "libzephyr4-krb5", "zephyr-clients",
|
||||
"krb5-config", "krb5-user", "krb5-clients", "debathena-kerberos-config", "debathena-zephyr-config"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class zulip::app_frontend {
|
||||
class { 'zulip::rabbit': }
|
||||
class { 'zulip::nginx': }
|
||||
class { 'zulip::supervisor': }
|
||||
include zulip::rabbit
|
||||
include zulip::nginx
|
||||
include zulip::supervisor
|
||||
|
||||
$web_packages = [ "memcached", "python-pylibmc", "python-tornado", "python-django",
|
||||
"python-pygments", "python-flup", "python-psycopg2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class zulip::local_server {
|
||||
class { 'zulip::base': }
|
||||
class { 'zulip::app_frontend': }
|
||||
include zulip::base
|
||||
include zulip::app_frontend
|
||||
|
||||
package { "postgresql-9.1": ensure => installed }
|
||||
# This should be migrated over to app_frontend, once validated as functional
|
||||
|
|
|
@ -17,11 +17,11 @@ config.read("/etc/zulip/zulip.conf")
|
|||
|
||||
puppet_config = """
|
||||
Exec { path => "/usr/sbin:/usr/bin:/sbin:/bin" }
|
||||
class { 'apt': }
|
||||
include apt
|
||||
"""
|
||||
|
||||
for pclass in re.split(r'\s*,\s*', config.get('machine', 'puppet_classes')):
|
||||
puppet_config += "class { '%s': }\n" % (pclass,)
|
||||
puppet_config += "include %s\n" % (pclass,)
|
||||
|
||||
puppet_cmd = ["puppet", "apply", "-e", puppet_config]
|
||||
puppet_cmd += extra_args
|
||||
|
|
Loading…
Reference in New Issue