aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem/scanner.pp
blob: 26622e957b5abea18852ac3a596be59892b35e73 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class nodo::subsystem::scanner {
  package { 'sane':
    ensure  => present,
  }

  group { [ 'lp', 'saned', 'scanner' ]:
    ensure    => present,
    allowdupe => false,
  }

  user { 'saned':
    ensure    => present,
    comment   => 'saned',
    gid       => 'saned',
    home      => '/home/saned',
    shell     => '/bin/false',
    allowdupe => false,
    require   => Group['lp', 'saned', 'scanner'],
  }

  file { '/etc/default/saned' :
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    source  => 'puppet:///modules/nodo/etc/default/saned',
    require => Package['saned'],
  }

  file { '/etc/sane.d/saned.conf' :
    ensure  => present,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    source  => 'puppet:///modules/nodo/etc/sane.d/saned.conf',
    require => Package['sane'],
  }

  service { 'saned' :
    ensure    => running,
    enable    => true,
    require   => Package['saned'],
    subscribe => [ File['/etc/default/saned/', '/etc/sane.d/saned.conf'], User['saned'] ],
  }

  # Firewall
  shorewall::rule { "saned":
    action          => 'ACCEPT',
    source          => 'net',
    destination     => '$FW',
    proto           => 'tcp',
    destinationport => "6566",
    ratelimit       => '-',
    order           => 200,
  }

  shorewall::rule { "saned-range":
    action          => 'ACCEPT',
    source          => 'net',
    destination     => '$FW',
    proto           => 'tcp',
    destinationport => "10000:10100",
    ratelimit       => '-',
    order           => 200,
  }
}