base.pp 1.18 KB
Newer Older
1
class shorewall::base {
2

3
    package { 'shorewall':
4
        ensure => $shorewall::ensure_version,
5 6 7
    }

    # This file has to be managed in place, so shorewall can find it
8 9
    file {
      '/etc/shorewall/shorewall.conf':
10
        require => Package[shorewall],
11
        notify => Service[shorewall],
mh's avatar
mh committed
12
        owner => root, group => 0, mode => 0644;
13 14 15 16
      '/etc/shorewall/puppet':
        ensure => directory,
        require => Package[shorewall],
        owner => root, group => 0, mode => 0644;
mh's avatar
mh committed
17
    }
18

19 20 21 22 23 24
    if $shorewall::conf_source {
      File['/etc/shorewall/shorewall.conf']{
        source => $shorewall::conf_source,
      }
    }

25
    require augeas
26

27 28 29 30
    augeas { 'shorewall_module_config_path':
      changes => 'set /files/etc/shorewall/shorewall.conf/CONFIG_PATH \'"/etc/shorewall/puppet:/etc/shorewall:/usr/share/shorewall"\'',
      lens    => 'Shellvars.lns',
      incl    => '/etc/shorewall/shorewall.conf',
31
      notify  => Service[shorewall],
32
      require => [ Package['shorewall'], Class[augeas] ];
33 34
    }

mh's avatar
mh committed
35
    service{shorewall:
36 37 38 39
        ensure  => running,
        enable  => true,
        hasstatus => true,
        hasrestart => true,
40
        require => Package[shorewall],
41 42
    }
}