Puppet Class: samba::config

Inherits:
samba
Defined in:
manifests/config.pp

Overview

@summary: Creates the [global] config section in smb.conf file.



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
# File 'manifests/config.pp', line 3

class samba::config () inherits samba {
  assert_private("Use of private class ${name} by ${caller_module_name}")

  augeas { 'samba-global-section':
    incl    => $samba::incl,
    lens    => lookup('samba::config_lens'),
    changes => "set ${samba::target} global",
    notify  => Class["${module_name}::service"],
  }

  samba::option {
    'workgroup':                value => $samba::workgroup;
    'server string':            value => $samba::server_string;
    'netbios name':             value => $samba::netbios_name;
    'domain master':            value => $samba::domain_master;
    'preferred master':         value => $samba::preferred_master;
    'local master':             value => $samba::local_master;
    'os level':                 value => $samba::os_level;
    'wins support':             value => $samba::wins_support;
    'wins server':              value => $samba::wins_server;
    'name resolve order':       value => $samba::name_resolve_order;
    'server min protocol':      value => $samba::server_min_protocol;
    'client max protocol':      value => $samba::client_max_protocol;
    'client min protocol':      value => $samba::client_min_protocol;
    'hosts allow':              value => $samba::hosts_allow;
    'hosts deny':               value => $samba::hosts_deny;
    'interfaces':               value => $samba::interfaces;
    'bind interfaces only':     value => $samba::bind_interfaces_only;
    'security':                 value => $samba::security;
    'encrypt passwords':        value => $samba::encrypt_passwords;
    'unix password sync':       value => $samba::unix_password_sync;
    'socket options':           value => $samba::socket_options;
    'map to guest':             value => $samba::map_to_guest;
    'passdb backend':           value => $samba::passdb_backend;
    'log file':                 value => $samba::log_file;
    'max log size':             value => $samba::max_log_size;
    'syslog':                   value => $samba::syslog;
    'ntlm auth':                value => $samba::ntlm_auth;
    'machine password timeout': value => $samba::machine_password_timeout;
    'realm':                    value => $samba::realm;
    'kerberos method':          value => $samba::kerberos_method;
    'dedicated keytab file':    value => $samba::dedicated_keytab_file;
    'obey pam restrictions':    value => $samba::obey_pam_restrictions;
  }

  $samba::idmap_config.each | $idmap_domain, $idmap_options | {
    $idmap_options.each | $idmap_option, $idmap_value | {
      samba::option { "idmap config ${idmap_domain} : ${idmap_option}":
        value => $idmap_value,
      }
    }
  }

  create_resources('samba::share', $samba::shares)
}