Skip to content

Commit

Permalink
cherry picked PR 317
Browse files Browse the repository at this point in the history
  • Loading branch information
poquirion committed Mar 21, 2024
1 parent 12fd459 commit b6b2ed2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ This class configures external authentication domains
| `domains` | Config dictionary of domains that can authenticate | Hash[String, Any] |
| `access_tags` | List of host tags that domain user can connect to | Array[String] |
| `deny_access` | Deny access to the domains on the host including this class, if undef, the access is defined by tags. | Optional[Boolean] |
| `mkhomedir` | Installs and enable oddjob-mkhomedir. | Optional[Boolean] |

<details>
<summary>default values</summary>
Expand Down
18 changes: 18 additions & 0 deletions site/profile/manifests/sssd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Hash[String, Any] $domains = {},
Array[String] $access_tags = ['login', 'node'],
Optional[Boolean] $deny_access = undef,
Optional[Boolean] $mkhomedir = false,
){
ensure_resource('service', 'sssd', { 'ensure' => running, 'enable' => true })

Expand All @@ -20,6 +21,23 @@
$extra_config = {}
}

if $mkhomedir {
package { 'oddjob-mkhomedir': }
ensure_resource('service', 'oddjobd', { 'ensure' => running, 'enable' => true })
file_line { 'pam_password_auth_oddjob_mkhomedir':
ensure => present,
path => '/etc/pam.d/password-auth',
line => 'session optional pam_oddjob_mkhomedir.so debug umask=0077',
notify => Service['oddjobd', 'sssd']
}
file_line { 'pam_system_auth_oddjob_mkhomedir':
ensure => present,
path => '/etc/pam.d/system-auth',
line => 'session optional pam_oddjob_mkhomedir.so debug umask=0077',
notify => Service['oddjobd', 'sssd']
}
}

$domains.map | $domain, $config | {
file { "/etc/sssd/conf.d/${domain}.conf":
ensure => 'present',
Expand Down

0 comments on commit b6b2ed2

Please sign in to comment.