Skip to content

Commit

Permalink
Applying pull request changes from rehanone#37
Browse files Browse the repository at this point in the history
  • Loading branch information
bschonec committed Jan 19, 2024
1 parent 47ed177 commit 38fe02c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
3 changes: 2 additions & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ samba::machine_password_timeout: null
samba::realm: null
samba::kerberos_method: null
samba::dedicated_keytab_file: null
samba::obey_pam_restrictions: false
samba::obey_pam_restrictions: false
samba::idmap_config: {}
8 changes: 8 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,13 @@
'obey pam restrictions': value => $samba::obey_pam_restrictions;
}

$samba::idmap_config.each | $idmap_domain, $idmap_options | {
$idmap_options.each | $idmap_option, $idmap_value | {
samba::option { "idmap config ${idmap_domain} : ${idmap_option}":
value => $idmap_value,
}
}
}

create_resources('samba::share', $samba::shares)
}
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
Optional[String] $kerberos_method,
Optional[String] $dedicated_keytab_file,
Optional[Boolean] $obey_pam_restrictions,
Optional[Hash] $idmap_config,

Check warning on line 158 in manifests/init.pp

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

missing documentation for class parameter samba::idmap_config (check: parameter_documentation)

Check warning on line 158 in manifests/init.pp

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

missing documentation for class parameter samba::idmap_config (check: parameter_documentation)

Hash $shares = {},
) {
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/samba_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@
is_expected.to contain_samba__option('kerberos method').with_value(nil)
is_expected.to contain_samba__option('dedicated keytab file').with_value(nil)
is_expected.to contain_samba__option('obey pam restrictions').with_value(false)
is_expected.to contain_samba__option('idmap config').with_value({})
}

it {
is_expected.to have_samba__option_resource_count(32)
is_expected.to have_samba__option_resource_count(33)
}
end

Expand Down
13 changes: 13 additions & 0 deletions spec/defines/option_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@
)
}
end

context 'with a hash as a value', :compile do
let(:title) { 'test' }
let(:params) { { value: {} } }

it {
is_expected.to contain_augeas('samba option (test=ssl tls)').with(
'incl' => '/etc/samba/smb.conf',
'lens' => 'Samba.lns',
'changes' => 'set "target[. = "global"]/test" "ssl tls"',
)
}
end
end
end
end
2 changes: 1 addition & 1 deletion spec/defines/share_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}

it {
is_expected.to have_samba__option_resource_count(63)
is_expected.to have_samba__option_resource_count(64)
}
end
end
Expand Down

0 comments on commit 38fe02c

Please sign in to comment.