Puppet Class: loki::service

Defined in:
manifests/service.pp

Summary

A short summary of the purpose of this class

Overview



4
5
6
7
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
37
38
39
# File 'manifests/service.pp', line 4

class loki::service {
  if $loki::manage_service {
    case $loki::service_provider {
      'systemd': {
        if $loki::manage_unit_file {
          ::systemd::unit_file { "${loki::service_name}.service":
            content => epp('loki/loki.service.epp'),
            before  => Service['loki'],
          }
        }
      }
      default: {
        fail("Service provider ${loki::service_provider} not supported")
      }
    }

    case $loki::install_method {
      'archive': {}
      'package': {
        Service['loki'] {
          subscribe => Package['loki'],
        }
      }
      default: {
        fail("Installation method ${loki::install_method} not supported")
      }
    }

    service { 'loki':
      ensure   => $loki::service_ensure,
      enable   => true,
      name     => $loki::service_name,
      provider => $loki::service_provider,
    }
  }
}