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

adds parameter mkhomedir that installs and enables oddjob-mkhomedir #317

Open
wants to merge 2 commits into
base: main
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
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
Loading