Defined Type: alerts::deploy::instance

Defined in:
modules/alerts/manifests/deploy/instance.pp

Overview

Parameters:

  • alerts_dir (String)
  • deploy_dir (String)
  • deploy_tag (Optional[String]) (defaults to: undef)
  • deploy_site (Optional[Wmflib::Sites]) (defaults to: undef)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'modules/alerts/manifests/deploy/instance.pp', line 8

define alerts::deploy::instance (
  String $alerts_dir,
  String $deploy_dir,
  Optional[String] $deploy_tag = undef,
  Optional[Wmflib::Sites] $deploy_site = undef,
) {
    if !defined(File[$deploy_dir]) {
        file { $deploy_dir:
            ensure => directory,
            owner  => 'alerts-deploy',
            group  => 'alerts-deploy',
            mode   => '0755',
        }
    }

    $service_name = "alerts-deploy@${title}"

    systemd::unit { $service_name:
        ensure  => present,
        content => systemd_template('alerts-deploy@'),
        before  => Git::Clone['operations/alerts'],
    }

    exec { "enable ${service_name}":
        command => "/bin/systemctl enable ${service_name}",
        unless  => "/bin/systemctl -q is-enabled ${service_name}",
        require => Systemd::Unit[$service_name],
    }
}