]> gitweb.fluxo.info Git - puppet-samba.git/commitdiff
Add option to set profile acls on a share
authorPete Brown <pete@abstractit.com.au>
Tue, 28 Jun 2016 15:52:42 +0000 (01:52 +1000)
committerAdam Jahn <ajjahn@gmail.com>
Sun, 10 Jul 2016 18:01:26 +0000 (14:01 -0400)
Add specs for profile acls option

manifests/server/share.pp
spec/defines/samba__server__share_spec.rb

index be4ee1e0ef0a764113cdc520ebdde9af75700c11..9a5d0300222b7d76a54126a474bcb85c7c9e54f2 100644 (file)
@@ -27,6 +27,7 @@ define samba::server::share($ensure = present,
                             $follow_symlinks = '',
                             $wide_links = '',
                             $map_acl_inherit = '',
+                            $profile_acls = '',
                             $store_dos_attributes = '',
                             $strict_allocate = '',
                             $hide_dot_files = '',
@@ -149,6 +150,11 @@ define samba::server::share($ensure = present,
         false   => "set \"${target}/map acl inherit\" no",
         default => "rm  \"${target}/map acl inherit\"",
       },
+      $profile_acls ? {
+        true    => "set \"${target}/profile acls\" yes",
+        false   => "set \"${target}/profile acls\" no",
+        default => "rm  \"${target}/profile acls\"",
+      },
       $store_dos_attributes ? {
         true    => "set \"${target}/store dos attributes\" yes",
         false   => "set \"${target}/store dos attributes\" no",
index 50441f08930e1358cc125f5e8180fa51b6ea332a..62ccf928693440e25c60467c6bf6e8636436b70a 100644 (file)
@@ -26,6 +26,7 @@ shared_examples "default share" do
     set.with("follow symlinks")
     set.with("wide links")
     set.with("map acl inherit")
+    set.with("profile acls")
     set.with("store dos attributes")
     set.with("strict allocate")
     set.with("valid users")
@@ -431,6 +432,24 @@ describe 'samba::server::share', :type => :define do
         let(:change_set) { default_changes.with("map acl inherit", "no") }
       end
 
+      context 'with profile_acls set to true' do
+        include_examples "default share"
+        let(:params) {{
+          :ensure          => 'present',
+          :profile_acls    => true,
+        }}
+        let(:change_set) { default_changes.with("profile acls", "yes") }
+      end
+
+      context 'with profile_acls set to false' do
+        include_examples "default share"
+        let(:params) {{
+          :ensure          => 'present',
+          :profile_acls    => false,
+        }}
+        let(:change_set) { default_changes.with("profile acls", "no") }
+      end
+
       context 'with store_dos_attributes set to true' do
         include_examples "default share"
         let(:params) {{