I'm attempting to rebuild nwaller's sssd puppet module to be entirely LDAP based and to be a little cleaner. In it we have a resource defined for each authentication domain of the form
define sssd::domain (
$domain = $name,
$domain_description = '',
$domain_type,
$ldap_uri = 'ldap://example.com',
$ldap_search_base = 'dc=example,dc=com',
$simple_allow_groups,
....
)
This definition is then passed as a concat::fragment
which fills out a template for building the final sssd.conf
.
This all works great if I define the LDAP server within each node, as in:
nodes.pp
node "node1.systems.private" {
include "puppet::client"
class {
'sssd':
domains => [ 'LDAP' ],
make_home_dir => true;
}
sssd::domain { 'LDAP':
domain_type => 'ldap',
ldap_uri => 'ldaps://ldap.site.com:636',
ldap_search_base => 'DC=site,DC=com',
ldap_user_search_base => 'OU=People,DC=site,DC=com',
ldap_group_search_base => 'OU=Groups,DC=site,DC=com',
ldap_default_bind_dn => 'CN=bindaccount,OU=Service Accounts,OU=People,DC=site,DC=com',
ldap_default_authtok => 'soopersekretbindpw',
simple_allow_groups => ['SysAdmins','AppAdmins'],
}
}
What I would rather do is a much more hierarchical setup. Keep the sssd::domain
definition as generic as possible, so I can maintain it as a module independent of our organization configurations. Define the LDAP server in a global config, and then within each node define which specific groups need access. So something more like:
modules/org/manifests/default.pp
class org::default {
include "puppet::client"
class {
'sssd':
domains => [ 'LDAP' ],
make_home_dir => true;
}
sssd::domain { 'LDAP':
domain_type => 'ldap',
ldap_uri => 'ldaps://ldap.site.com:636',
ldap_search_base => 'DC=site,DC=com',
ldap_user_search_base => 'OU=People,DC=site,DC=com',
ldap_group_search_base => 'OU=Groups,DC=site,DC=com',
ldap_default_bind_dn => 'CN=bindaccount,OU=Service Accounts,OU=People,DC=site,DC=com',
ldap_default_authtok => 'soopersekretbindpw',
}
}
nodes.pp
node "node1.systems.private" {
include "org::default"
sssd::domain { 'LDAP':
simple_allow_groups => ['SysAdmins','AppAdmins'],
}
}
As expected this results in a duplicate declaration error when attempting to apply the definition. Is there a way to do this, selectively override parameters, or am I stuck with defining the authentication domain within the original definition and then overriding the authorization parameters within each node?