diff options
| author | Marc <mmontgomery@pcch.org> | 2012-08-17 09:39:52 -0400 | 
|---|---|---|
| committer | Marc <mmontgomery@pcch.org> | 2012-08-17 09:39:52 -0400 | 
| commit | e78a712e1152fd8981b87a6bb035777d0256f268 (patch) | |
| tree | e832d32239fbbbec9d5cb584b836a5917cf788ce /manifests/share.pp | |
| download | puppet-samba-e78a712e1152fd8981b87a6bb035777d0256f268.tar.gz puppet-samba-e78a712e1152fd8981b87a6bb035777d0256f268.tar.bz2  | |
initial commit current progress creates shares in ensures samba is installed and daemon is running, can add shares to smb.conf, and can set global variables
Diffstat (limited to 'manifests/share.pp')
| -rw-r--r-- | manifests/share.pp | 26 | 
1 files changed, 26 insertions, 0 deletions
diff --git a/manifests/share.pp b/manifests/share.pp new file mode 100644 index 0000000..7690fbc --- /dev/null +++ b/manifests/share.pp @@ -0,0 +1,26 @@ +define samba::share($ensure=present, +              $description, +              $path, +              $browsable, +              $mask, +              $guestok="no", +              $readonly="no" ) { +   +  $share = $name +  $context = "/files/etc/samba/smb.conf" +  $target = "target[. = '${name}']" + +  augeas { "${share}": +    context => $context, +    changes => $ensure ? { +      present => [ "set ${target} ${name}", +                    "set ${target}/comment ${description}", +                    "set ${target}/path ${path}", +                    "set ${target}/browsable ${browsable}", +                    "set ${target}/mask ${mask}" ], +      default => ["rm ${target} ${name}"], +    }, +    require => Class["samba::server::config"] +  } +   +}  | 
