aboutsummaryrefslogtreecommitdiff
path: root/manifests/server.pp
blob: b4e99558dbb4eab57bbef4721705e0df260cee48 (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
67
68
69
70
71
72
73
74
75
76
77
78
# == Class samba::server
#
class samba::server($interfaces = '',
                    $security = '',
                    $server_string = '',
                    $unix_password_sync = '',
                    $netbios_name = '',
                    $workgroup = '',
                    $socket_options = '',
                    $deadtime = '',
                    $keepalive = '',
                    $load_printers = '',
                    $printing = '',
                    $printcap_name = '',
                    $map_to_guest = '',
                    $disable_spoolss = '',
                    $kernel_oplocks = '',
                    $pam_password_change = '',
                    $os_level = '',
                    $preferred_master = '',
                    $bind_interfaces_only = 'yes',) {

  include samba::server::install
  include samba::server::config
  include samba::server::service

  $incl    = '/etc/samba/smb.conf'
  $context = '/files/etc/samba/smb.conf'
  $target  = 'target[. = "global"]'

  augeas { 'global-section':
    incl    => $incl,
    lens    => 'Samba.lns',
    context => $context,
    changes => "set ${target} global",
    require => Class['samba::server::config'],
    notify  => Class['samba::server::service']
  }

  samba::server::option {
    'interfaces':           value => $interfaces;
    'bind interfaces only': value => $bind_interfaces_only;
    'security':             value => $security;
    'server string':        value => $server_string;
    'unix password sync':   value => $unix_password_sync;
    'netbios name':         value => $netbios_name;
    'workgroup':            value => $workgroup;
    'socket_options':       value => $socket_options;
    'deadtime':             value => $deadtime;
    'keepalive':            value => $keepalive;
    'load printers':        value => $load_printers;
    'printing':             value => $printing;
    'printcap_name':        value => $printcap_name;
    'map to guest':         value => $map_to_guest;
    'disable_spoolss':      value => $disable_spoolss;
    'kernel oplocks':       value => $kernel_oplocks;
    'pam password change':  value => $pam_password_change;
    'os level':             value => $os_level;
    'preferred master':     value => $preferred_master;
  }

  file {'/sbin/check_samba_user':
    # script checks to see if a samba account exists for a given user
    owner   => root,
    group   => root,
    mode    => '0755',
    content => template("${module_name}/check_samba_user"),
  }

  file {'/sbin/add_samba_user':
    # script creates a new samba account for a given user and password
    owner   => root,
    group   => root,
    mode    => '0755',
    content => template("${module_name}/add_samba_user"),
  }

}