diff options
author | Jirgn Mssnr <jirgn76@googlemail.com> | 2016-02-22 13:47:19 +0100 |
---|---|---|
committer | Jirgn Mssnr <jirgn76@googlemail.com> | 2016-02-22 13:47:19 +0100 |
commit | 0385193ee30c830e81be53b1d7484ae27cdd2b85 (patch) | |
tree | 5b197ac02b82e0ae49041944d2efdd750cdb246e | |
parent | 6c90437c34e749d42b0041097bd12747d63aad4c (diff) | |
download | puppet-samba-0385193ee30c830e81be53b1d7484ae27cdd2b85.tar.gz puppet-samba-0385193ee30c830e81be53b1d7484ae27cdd2b85.tar.bz2 |
added param users for use in hiera
added tests for samba::server::users
-rw-r--r-- | manifests/server.pp | 4 | ||||
-rw-r--r-- | spec/classes/samba__server_spec.rb | 27 |
2 files changed, 28 insertions, 3 deletions
diff --git a/manifests/server.pp b/manifests/server.pp index 59d5d51..cbc61a9 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -20,7 +20,8 @@ class samba::server($interfaces = '', $os_level = '', $preferred_master = '', $bind_interfaces_only = 'yes', - $shares = {},) { + $shares = {}, + $users = {}, ) { include samba::server::install include samba::server::config @@ -63,4 +64,5 @@ class samba::server($interfaces = '', } create_resources(samba::server::share, $shares) + create_resources(samba::server::user, $users) } diff --git a/spec/classes/samba__server_spec.rb b/spec/classes/samba__server_spec.rb index d19fe6a..46c5b15 100644 --- a/spec/classes/samba__server_spec.rb +++ b/spec/classes/samba__server_spec.rb @@ -36,8 +36,31 @@ describe 'samba::server' do } } }} - it { should contain_samba__server__share( 'testShare' ) } - it { should contain_samba__server__share( 'testShare2' ) } + it { + should contain_samba__server__share( 'testShare' ).with({ + 'path' => '/path/to/some/share', + 'browsable' => true, + 'writable' => true, + 'guest_ok' => true, + 'guest_only' => true, + }) + } + it { should contain_samba__server__share( 'testShare2' ).with_path('/some/other/path') } + end + + context 'with hiera users hash' do + let(:params) {{ + 'users' => { + 'testUser' => { + 'password' => 'testpass01' + }, + 'testUser2' => { + 'password' => 'testpass02' + } + } + }} + it { should contain_samba__server__user( 'testUser' ).with_password('testpass01') } + it { should contain_samba__server__user( 'testUser2' ).with_password('testpass02') } end end |