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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
define samba::server::share($ensure = present,
$comment = '',
$path = '',
$browsable = '',
$copy = '',
$create_mask = '',
$directory_mask = '',
$force_create_mask = '',
$force_directory_mask = '',
$guest_ok = '',
$read_only = '') {
$context = "/files/etc/samba/smb.conf"
$target = "target[. = '${name}']"
augeas { "${name}-section":
context => $context,
changes => $ensure ? {
present => "set ${target} '${name}'",
default => "rm ${target} '${name}'",
},
require => Class["samba::server::config"],
notify => Class["samba::server::service"]
}
if $ensure == "present" {
augeas { "${name}-comment":
context => $context,
changes => $comment ? {
default => "set ${target}/comment '${comment}'",
'' => "rm ${target}/comment",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-path":
context => $context,
changes => $path ? {
default => "set ${target}/path '${path}'",
'' => "rm ${target}/path",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-browsable":
context => $context,
changes => $browsable ? {
true => "set ${target}/browsable yes",
false => "set ${target}/browsable no",
default => "rm ${target}/browsable",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-copy":
context => $context,
changes => $copy ? {
default => "set ${target}/copy '${copy}'",
'' => "rm ${target}/copy",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-create_mask":
context => $context,
changes => $create_mask ? {
default => "set \"${target}/create mask\" '${create_mask}'",
'' => "rm \"${target}/create mask\"",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-directory_mask":
context => $context,
changes => $directory_mask ? {
default => "set \"${target}/directory mask\" '${directory_mask}'",
'' => "rm \"${target}/directory mask\"",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-force_create_mask":
context => $context,
changes => $force_create_mask ? {
default => "set \"${target}/force create mask\" '${force_create_mask}'",
'' => "rm \"${target}/force create mask\"",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-force_directory_mask":
context => $context,
changes => $force_directory_mask ? {
default => "set \"${target}/force directory mask\" '${force_directory_mask}'",
'' => "rm \"${target}/force directory mask\"",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-guest_ok":
context => $context,
changes => $guest_ok ? {
true => "set \"${target}/guest ok\" yes",
false => "set \"${target}/guest ok\" no",
default => "rm \"${target}/guest ok\"",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
augeas { "${name}-read_only":
context => $context,
changes => $read_only ? {
true => "set \"${target}/read only\" yes",
false => "set \"${target}/read only\" no",
default => "rm \"${target}/read_only\"",
},
require => Augeas["${name}-section"],
notify => Class["samba::server::service"]
}
}
}
|