Add option to enable pam_mkhomedirs in the IPA client installer

This commit is contained in:
rcrit 2010-03-15 13:41:07 -04:00 committed by Jason Gerard DeRose
parent 3998078461
commit a887922fa9
2 changed files with 15 additions and 5 deletions

View File

@ -74,6 +74,8 @@ def parse_options():
help="use this option when run on a master", default=False)
parser.add_option("--permit", dest="permit", action="store_true",
help="disable access rules by default, permit all access.", default=False)
parser.add_option("--mkhomedir", dest="mkhomedir", action="store_true",
help="create home directories for users on their first login", default=False)
parser.add_option("", "--uninstall", dest="uninstall", action="store_true",
default=False, help="uninstall an existing installation")
@ -134,7 +136,7 @@ def uninstall(options):
print "Disabling client Kerberos and Ldap configurations"
try:
run(["/usr/sbin/authconfig", "--disableldap", "--disablekrb5", "--disablesssd", "--disablesssdauth", "--update"])
run(["/usr/sbin/authconfig", "--disableldap", "--disablekrb5", "--disablesssd", "--disablesssdauth", "--disablemkhomedir", "--update"])
except Exception, e:
print "Failed to remove krb5/ldap configuration. " +str(e)
sys.exit(1)
@ -522,11 +524,16 @@ def main():
# Modify nsswitch/pam stack
if options.sssd:
run(["/usr/sbin/authconfig", "--enablesssd", "--enablesssdauth", "--update"])
print "SSSD enabled"
cmd = ["/usr/sbin/authconfig", "--enablesssd", "--enablesssdauth", "--update"]
message = "SSSD enabled"
else:
run(["/usr/sbin/authconfig", "--enableldap", "--update"])
print "LDAP enabled"
cmd = ["/usr/sbin/authconfig", "--enableldap", "--update"]
message = "LDAP enabled"
if options.mkhomedir:
cmd.append("--enablemkhomedir")
run(cmd)
print message
#Check nss_ldap is working properly
if not options.on_master:

View File

@ -68,6 +68,9 @@ Principal to use to join the IPA realm.
\fB\-\-permit\fR
Set the SSSD access rules to permit all access. Otherwise the machine will be controlled by the Host-based Access Controls on the IPA server.
.TP
\fB\-\-mkhomedir\fR
Create a users home directory if it does not exist.
.TP
\fB\-\-uninstall\fR
Remove the IPA client software and restore the configuration to the pre-IPA state.
.SH "EXIT STATUS"