Add mkhomedir option to ipa-client-install

To allow PAM to create home directory for
user who do not have one, ipa-client-install
need an option. This is added by MakeHomeDir
variable.

This commit includes a fix from ykarel to fix the
new variable type.

Related-bug: #1823727

Change-Id: I040014482e9126947b8c4a1d7b1bf7645f926c4b
Signed-off-by: Cyril Lopez <cylopez@redhat.com>
(cherry-picked from commit 2471642f6f and
 e3ad34aece)
This commit is contained in:
Cyril Lopez 2019-04-08 15:47:28 +02:00 committed by Ade Lee
parent 306412539a
commit 5c37edc49a
2 changed files with 14 additions and 0 deletions

View File

@ -32,6 +32,10 @@ parameters:
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
MakeHomeDir:
type: boolean
description: Configure PAM to create a users home directory if it does not exist.
default: False
outputs:
role_data:
@ -43,6 +47,8 @@ outputs:
host_prep_tasks:
- name: enroll client in ipa and get metadata
become: yes
vars:
makehomedir: {get_param: MakeHomeDir}
block:
- name: install needed packages
package:
@ -132,6 +138,9 @@ outputs:
if [ -n "$realm" ]; then
OPTS="$OPTS --realm=$realm"
fi
if [ "${makehomedir,,}" = "true" ]; then
OPTS="$OPTS --mkhomedir"
fi
# Ensure we have the proper domain in /etc/resolv.conf
domain=$(hostname -d)

View File

@ -0,0 +1,5 @@
---
features:
- |
To allow PAM to create home directory for user who do not have one,
ipa-client-install need an option. This change allow to enable it.