diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-03-24 14:18:03 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-03-24 14:18:03 -0300 |
commit | 309d5859d9c801218075789fe068869ab49065f5 (patch) | |
tree | dc31d7e0e39b48f75475f374d5301bba10c7c64a /manifests/server.pp | |
parent | 846ed365f19187b50f9aff0c7911b533880398a7 (diff) | |
parent | eb97a2b642499fde7afdb64dfd3e2b7e8c14eacc (diff) | |
download | puppet-samba-309d5859d9c801218075789fe068869ab49065f5.tar.gz puppet-samba-309d5859d9c801218075789fe068869ab49065f5.tar.bz2 |
Merge branch 'master' of https://github.com/ajjahn/puppet-samba
Conflicts:
manifests/server/service.pp
Diffstat (limited to 'manifests/server.pp')
-rw-r--r-- | manifests/server.pp | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/manifests/server.pp b/manifests/server.pp index bc1e3d7..cbc61a9 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -1,46 +1,68 @@ +# == Class samba::server +# class samba::server($interfaces = '', $security = '', $server_string = '', $unix_password_sync = '', - $workgroup = '') { + $netbios_name = '', + $workgroup = '', + $socket_options = '', + $deadtime = '', + $keepalive = '', + $load_printers = '', + $printing = '', + $printcap_name = '', + $map_to_guest = 'Never', + $guest_account = '', + $disable_spoolss = '', + $kernel_oplocks = '', + $pam_password_change = '', + $os_level = '', + $preferred_master = '', + $bind_interfaces_only = 'yes', + $shares = {}, + $users = {}, ) { 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']" + $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'] } - - set_samba_option { + samba::server::option { 'interfaces': value => $interfaces; - 'bind interfaces only': value => 'yes'; + '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; - } -} - -define set_samba_option ( $value = '', $signal = 'samba::server::service' ) { - $context = $samba::server::context - $target = $samba::server::target - $changes = $value ? { - default => "set \"${target}/$name\" \"$value\"", - '' => "rm ${target}/$name", + '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; + 'guest account': value => $guest_account; + '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; } - augeas { "samba-$name": - context => $context, - changes => $changes, - require => Augeas['global-section'], - notify => Class[$signal] - } + create_resources(samba::server::share, $shares) + create_resources(samba::server::user, $users) } |