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

Manage domains via sssd::domains class parameter #116

Open
wants to merge 2 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
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Tue Nov 09 2021 Steven Pritchard <[email protected]> - 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 <[email protected]> - 7.2.0
- Add an option in sssd::install to not install sssd client.
This aids in better compatibility with non RedHat based systems
Expand Down
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ Default value: ``false``

##### <a name="domains"></a>`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.

Expand Down Expand Up @@ -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)

##### <a name="install_user_tools"></a>`install_user_tools`

Expand All @@ -393,6 +397,14 @@ Ensure setting for all packages installed by this module

Default value: `simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' })`

##### <a name="install_client"></a>`install_client`

Data type: `Boolean`



Default value: ``true``

### <a name="sssdinstallclient"></a>`sssd::install::client`

Install the sssd-client package
Expand Down
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -112,6 +115,16 @@
Boolean $auto_add_ipa_domain = true,
Optional[String[1]] $custom_config = undef
) {
if $domains =~ Hash {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test should be added that evaluates this input type.

$domains.each |$key, $value| {
sssd::domain { $key:
* => $value,
}
}
$_domains = $domains.keys
} else {
$_domains = $domains
}
include 'sssd::install'
include 'sssd::config'

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down