aboutsummaryrefslogtreecommitdiff
path: root/manifests/service.pp
blob: e9eb3696cd36df588d5bf3f0d8cdb079608944a0 (plain)
1
2
3
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
#
# @api private
#
# @summary This class handles the configuration file. Avoid modifying private classes.
#
class ferm::service {

  # this is a private class
  assert_private("You're not supposed to do that!")

  if $ferm::manage_service {
    service{'ferm':
      ensure => 'running',
      enable => true,
    }

    # on Ubuntu, we can't start the service, unless we set ENABLED=true in /etc/default/ferm...
    if ($facts['os']['name'] in ['Ubuntu', 'Debian']) {
      file_line{'enable_ferm':
        path   => '/etc/default/ferm',
        line   => 'ENABLED="yes"',
        match  => 'ENABLED=',
        notify => Service['ferm'],
      }
      file_line{'disable_ferm_cache':
        path   => '/etc/default/ferm',
        line   => 'CACHE="no"',
        match  => 'CACHE=',
        notify => Service['ferm'],
      }
    }
  }
}