diff --git a/puppet/zulip/manifests/app_frontend_base.pp b/puppet/zulip/manifests/app_frontend_base.pp index 4e4a06b449..2396f172a8 100644 --- a/puppet/zulip/manifests/app_frontend_base.pp +++ b/puppet/zulip/manifests/app_frontend_base.pp @@ -240,15 +240,7 @@ class zulip::app_frontend_base { content => template('zulip/logrotate/zulip.template.erb'), } - file { "${zulip::common::nagios_plugins_dir}/zulip_app_frontend": - require => Package[$zulip::common::nagios_plugins], - recurse => true, - purge => true, - owner => 'root', - group => 'root', - mode => '0755', - source => 'puppet:///modules/zulip/nagios_plugins/zulip_app_frontend', - } + zulip::nagios_plugins {'zulip_app_frontend': } # This cron job does nothing unless RATE_LIMIT_TOR_TOGETHER is enabled. zulip::cron { 'fetch-tor-exit-nodes': diff --git a/puppet/zulip/manifests/nagios_plugins.pp b/puppet/zulip/manifests/nagios_plugins.pp new file mode 100644 index 0000000000..e61a62a0f3 --- /dev/null +++ b/puppet/zulip/manifests/nagios_plugins.pp @@ -0,0 +1,14 @@ +# @summary Installs a subdirectory from puppet/zulip/files/nagios_plugins/ +define zulip::nagios_plugins () { + include zulip::common + + file { "${zulip::common::nagios_plugins_dir}/${name}": + require => Package[$zulip::common::nagios_plugins], + recurse => true, + purge => true, + owner => 'root', + group => 'root', + mode => '0755', + source => "puppet:///modules/zulip/nagios_plugins/${name}", + } +} diff --git a/puppet/zulip/manifests/postgresql_base.pp b/puppet/zulip/manifests/postgresql_base.pp index a393c13b56..c30e3a6b4f 100644 --- a/puppet/zulip/manifests/postgresql_base.pp +++ b/puppet/zulip/manifests/postgresql_base.pp @@ -62,15 +62,7 @@ class zulip::postgresql_base { mode => '0644', source => 'puppet:///modules/zulip/postgresql/zulip_english.stop', } - file { "${zulip::common::nagios_plugins_dir}/zulip_postgresql": - require => Package[$zulip::common::nagios_plugins], - recurse => true, - purge => true, - owner => 'root', - group => 'root', - mode => '0755', - source => 'puppet:///modules/zulip/nagios_plugins/zulip_postgresql', - } + zulip::nagios_plugins { 'zulip_postgresql': } $pgroonga = zulipconf('machine', 'pgroonga', false) if $pgroonga { diff --git a/puppet/zulip/manifests/profile/base.pp b/puppet/zulip/manifests/profile/base.pp index 110d067993..f694977097 100644 --- a/puppet/zulip/manifests/profile/base.pp +++ b/puppet/zulip/manifests/profile/base.pp @@ -136,13 +136,5 @@ class zulip::profile::base { mode => '0750', } - file { "${zulip::common::nagios_plugins_dir}/zulip_base": - require => Package[$zulip::common::nagios_plugins], - recurse => true, - purge => true, - owner => 'root', - group => 'root', - mode => '0755', - source => 'puppet:///modules/zulip/nagios_plugins/zulip_base', - } + zulip::nagios_plugins { 'zulip_base': } }