Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed notify for winbind if manage_winbind is false #75

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions manifests/classic.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,16 @@
$joinou = undef,
Optional[String] $default_realm = undef,
Array $additional_realms = [],
) inherits samba::params{


unless is_domain_name($realm){
) inherits samba::params {
unless ($realm =~ Variant[Stdlib::Fqdn, Stdlib::Dns::Zone]) {
fail('realm must be a valid domain')
}

unless is_domain_name($realm){
fail('realm must be a valid domain')
unless ($smbname =~ String[1,15]) {
fail('smbname too short or too long')
}

validate_slength($smbname, 15)
unless is_domain_name("${smbname}.${realm}"){
unless ("${smbname}.${realm}" =~ Variant[Stdlib::Fqdn, Stdlib::Dns::Zone]) {
fail('smbname must be a valid domain')
}

Expand All @@ -94,6 +91,12 @@

$_default_realm = pick($default_realm, $realmuppercase)

if $manage_winbind {
$services_to_notify = ['SambaSmb', 'SambaWinBind']
}
else {
$services_to_notify = ['SambaSmb']
}

file { '/etc/samba/':
ensure => 'directory',
Expand All @@ -111,7 +114,7 @@
ensure => present,
mode => '0644',
content => template("${module_name}/krb5.conf.erb"),
notify => Service['SambaSmb', 'SambaWinBind'],
notify => Service[$services_to_notify];
}
}

Expand Down Expand Up @@ -281,12 +284,6 @@
$mandatoryglobaloptionsindex = prefix(keys($mandatoryglobaloptions),
'[global]')

if $manage_winbind {
$services_to_notify = ['SambaSmb', 'SambaWinBind']
}
else {
$services_to_notify = ['SambaSmb']
}
samba::option{ $mandatoryglobaloptionsindex:
options => $mandatoryglobaloptions,
section => 'global',
Expand Down
2 changes: 1 addition & 1 deletion manifests/dc.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
fail("role must be in [${checkrolestr}]")
}

unless is_domain_name($realm){
unless ($realm =~ Variant[Stdlib::Fqdn, Stdlib::Dns::Zone]) {
fail('realm must be a valid domain')
}

Expand Down
18 changes: 8 additions & 10 deletions manifests/dc/ppolicy_param.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@
String $value,
){

validate_re(
$option,
'^--.*$',
"option must start with '--' and be \
if $option !~ /^--.*$/ {
fail("option must start with '--' and be \
a valid 'samba-tool domain passwordsettings' option",
)
)
}

validate_re(
$show_string,
'^.*:$',
"show_string must end with ':' \
if $show_string !~ /^.*:$/ {
fail("show_string must end with ':' \
and be the string in 'samba-tool domain passwordsettings show' \
corresponding to option",
)
)
}

exec{"cmd_ppolicy_param ${option}":
path => '/bin:/sbin:/usr/bin:/usr/sbin',
Expand Down
2 changes: 1 addition & 1 deletion manifests/log.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$classliststr = join($classlist, ', ')

if $sambaclassloglevel != undef {
unless is_hash($sambaclassloglevel)
unless $sambaclassloglevel =~ Hash
and difference(keys($sambaclassloglevel), $classlist) == [] {
fail("sambaclassloglevel must be a hash with keys in [${classliststr}]")
}
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": [
{
"name": "puppetlabs-stdlib",
"version_requirement": ">= 3.0.0 < 5.0.0"
"version_requirement": ">= 9.0.0 < 9.4.0"
},
{
"name": "herculesteam-augeasproviders_pam",
Expand Down Expand Up @@ -43,8 +43,8 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"16.04"
"20.04",
"21.04"
]
},
{
Expand All @@ -54,7 +54,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.10.0 < 6.0.0"
"version_requirement": ">= 6.0.0 < 9.0.0"
}
]
}