diff --git a/CHANGELOG b/CHANGELOG index 68ee26c..eb9acc0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +* Tue Nov 09 2021 Steven Pritchard - 7.3.0 +- Allow `$sssd::domains` to accept a `Hash` of `sssd::domain` + resources (to allow for managing domains via hiera) + * Fri Aug 27 2021 Henry Pauli - 7.2.0 - Add an option in sssd::install to not install sssd client. This aids in better compatibility with non RedHat based systems diff --git a/README.md b/README.md index ef12131..444ef62 100644 --- a/README.md +++ b/README.md @@ -122,29 +122,18 @@ simp_options::auditd: true ### Creating Domains and Providers -To create an SSSD domain you must instantiate a sssd::domain defined type and -add the domain name to the array of domains in hiera: - -In hiera: +To create an SSSD domain you must add the domain configuration to hiera: ```yaml -sssd::domains: ['ldapusers', 'LOCAL'] -``` - -Create a manifest: - -```puppet -sssd::domain { 'ldapusers': - id_provider => 'ldap', - auth_provider => 'krb5', - access_provider => 'krb5', - ...etc -} - -sssd::domain { 'LOCAL': - id_provider => 'local', - ...etc -} +sssd::domains: + ldapusers: + id_provider: 'ldap' + auth_provider: 'krb5' + access_provider: 'krb5' + # ...etc + LOCAL: + id_provider: 'local' + # ...etc ``` To include configuration options for the providers of the SSSD domain, you must diff --git a/REFERENCE.md b/REFERENCE.md index f43324d..dd7d258 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -105,7 +105,10 @@ Default value: ``false`` ##### `domains` -Data type: `Array[String[1, 255]]` +Data type: `Variant[ + Array[String[1, 255]], + Hash[String[1, 255], Any] + ]` The sssd `domains` to be managed. @@ -375,6 +378,7 @@ The following parameters are available in the `sssd::install` class: * [`install_user_tools`](#install_user_tools) * [`package_ensure`](#package_ensure) +* [`install_client`](#install_client) ##### `install_user_tools` @@ -393,6 +397,14 @@ Ensure setting for all packages installed by this module Default value: `simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })` +##### `install_client` + +Data type: `Boolean` + + + +Default value: ``true`` + ### `sssd::install::client` Install the sssd-client package diff --git a/manifests/config.pp b/manifests/config.pp index 4ddb740..82f3a97 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -21,11 +21,11 @@ if ($sssd::auto_add_ipa_domain and $facts['ipa']) { # this host has joined an IPA domain - $_domains = unique(concat($sssd::domains, $facts['ipa']['domain'])) + $_domains = unique(concat($sssd::_domains, $facts['ipa']['domain'])) include 'sssd::config::ipa_domain' } else { - $_domains = unique($sssd::domains) + $_domains = unique($sssd::_domains) } $_debug_level = $sssd::debug_level diff --git a/manifests/init.pp b/manifests/init.pp index ae35f3b..0dcdba6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -85,7 +85,10 @@ # class sssd ( Boolean $authoritative = false, - Array[String[1, 255]] $domains = [], + Variant[ + Array[String[1, 255]], + Hash[String[1, 255], Any] + ] $domains = [], Optional[Sssd::DebugLevel] $debug_level = undef, Boolean $debug_timestamps = true, Boolean $debug_microseconds = false, @@ -112,6 +115,16 @@ Boolean $auto_add_ipa_domain = true, Optional[String[1]] $custom_config = undef ) { + if $domains =~ Hash { + $domains.each |$key, $value| { + sssd::domain { $key: + * => $value, + } + } + $_domains = $domains.keys + } else { + $_domains = $domains + } include 'sssd::install' include 'sssd::config' diff --git a/metadata.json b/metadata.json index 59f91f5..110ea7d 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "simp-sssd", - "version": "7.2.0", + "version": "7.3.0", "author": "SIMP Team", "summary": "Manages SSSD", "license": "Apache-2.0",