aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jahn <ajjahn@gmail.com>2016-07-10 21:02:50 -0400
committerAdam Jahn <ajjahn@gmail.com>2016-07-10 21:02:50 -0400
commit293bcc94cba842737a89e37339d46ad5bb8cd6ab (patch)
treeeee62f5826b102119ce89fec3eceebc503795687
parente4a25276936fecb5465a7abdab34bee1c88e7df8 (diff)
downloadpuppet-samba-293bcc94cba842737a89e37339d46ad5bb8cd6ab.tar.gz
puppet-samba-293bcc94cba842737a89e37339d46ad5bb8cd6ab.tar.bz2
re-implement guest account on the share level
-rw-r--r--manifests/server/share.pp5
-rw-r--r--spec/defines/samba__server__share_spec.rb10
2 files changed, 15 insertions, 0 deletions
diff --git a/manifests/server/share.pp b/manifests/server/share.pp
index 86cbb13..5544caf 100644
--- a/manifests/server/share.pp
+++ b/manifests/server/share.pp
@@ -39,6 +39,7 @@ define samba::server::share($ensure = present,
$delete_readonly = '',
$printer_name = '',
$msdfs_root = '',
+ $guest_account = '',
) {
$incl = $samba::server::incl
@@ -234,6 +235,10 @@ define samba::server::share($ensure = present,
false => "set \"${target}/msdfs root\" no",
default => "rm \"${target}/msdfs root\"",
},
+ $guest_account ? {
+ '' => "rm \"${target}/guest account\"",
+ default => "set \"${target}/guest account\" '${guest_account}'",
+ },
]
augeas { "${name}-changes":
diff --git a/spec/defines/samba__server__share_spec.rb b/spec/defines/samba__server__share_spec.rb
index 7e1c8a0..894f334 100644
--- a/spec/defines/samba__server__share_spec.rb
+++ b/spec/defines/samba__server__share_spec.rb
@@ -43,6 +43,7 @@ shared_examples "default share" do
set.with("delete readonly")
set.with("printer name")
set.with("msdfs root")
+ set.with("guest account")
end
let(:change_set) { default_changes }
let(:changes) { change_set.to_a }
@@ -672,6 +673,15 @@ describe 'samba::server::share', :type => :define do
}}
let(:change_set) { default_changes.with("msdfs root", "no") }
end
+
+ context 'with guest_account set to "killing trees"' do
+ include_examples "default share"
+ let(:params) {{
+ :ensure => 'present',
+ :guest_account => 'someone',
+ }}
+ let(:change_set) { default_changes.with("guest account", "'someone'") }
+ end
end
end
end