aboutsummaryrefslogtreecommitdiff
path: root/manifests/server.pp
blob: 1f1702c32daaa76e63fb81b67fbebc3e501c18cc (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
class samba::server($workgroup = pcch) {
	include samba::server::install
	include samba::server::config
	include samba::server::service

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

  augeas { 'global-section':
    context => $context,
    changes => "set ${target} global",
    require => Class["samba::server::config"]
  }

  augeas { 'global-workgroup':
    context => $context,
    changes => $workgroup ? {
      default => "set ${target}/workgroup $workgroup",
      '' => "rm ${target}/workgroup",
    },
    require => Augeas['global-section'],
  }

}