From 7fe265156be4309bb7da3392cae17711e13bbf13 Mon Sep 17 00:00:00 2001 From: pmelse Date: Fri, 23 Aug 2019 16:41:33 -0400 Subject: [PATCH 1/2] Pmelse domain free 1 1 (#1) Create a mode to allow for a standalone samba server - no id mapping - no kerberos, winbind - an even more classic classic mode --- manifests/classic.pp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/manifests/classic.pp b/manifests/classic.pp index f3e9704..9eb0869 100644 --- a/manifests/classic.pp +++ b/manifests/classic.pp @@ -55,19 +55,16 @@ $globaloptions = {}, $globalabsentoptions = [], $joinou = undef, + $standalonemode = false, Optional[String] $default_realm = undef, Array $additional_realms = [], ) inherits samba::params{ - - unless is_domain_name($realm){ - fail('realm must be a valid domain') - } - +unless $standalonemode { unless is_domain_name($realm){ fail('realm must be a valid domain') } - +} validate_slength($smbname, 15) unless is_domain_name("${smbname}.${realm}"){ fail('smbname must be a valid domain') @@ -91,9 +88,9 @@ $realmlowercase = downcase($realm) $realmuppercase = upcase($realm) $globaloptsexclude = concat(keys($globaloptions), $globalabsentoptions) - - $_default_realm = pick($default_realm, $realmuppercase) - + unless $standalonemode { + $_default_realm = pick($default_realm, $realmuppercase) + } file { '/etc/samba/': ensure => 'directory', @@ -258,6 +255,17 @@ 'winbind separator' => '+', } } + elsif $standalonemode { + $mandatoryglobaloptions = { + 'workgroup' => $domain, + 'realm' => undef, + 'netbios name' => $smbname, + 'security' => $security, + 'map acl inherit' => 'No', + 'store dos attributes' => 'Yes', + 'map untrusted to domain' => 'No ', + } + } else { $mandatoryglobaloptions = { 'workgroup' => $domain, From c2ddd24599fc9324dab2ce429d117bd2e1ae62e2 Mon Sep 17 00:00:00 2001 From: pmelse Date: Fri, 23 Aug 2019 16:48:08 -0400 Subject: [PATCH 2/2] removed trailing whitespace --- manifests/classic.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/classic.pp b/manifests/classic.pp index 9eb0869..180d1a0 100644 --- a/manifests/classic.pp +++ b/manifests/classic.pp @@ -264,7 +264,7 @@ 'map acl inherit' => 'No', 'store dos attributes' => 'Yes', 'map untrusted to domain' => 'No ', - } + } } else { $mandatoryglobaloptions = {