Hi,

Provides two new options for the ipa-client-install:
    --nisdomain: specifies the NIS domain name
    --no_nisdomain: flag to aviod setting the NIS domain name

In case no --nisdomain is specified and --no_nisdomain flag was
not set, the IPA domain is used.

Manual pages updated.

http://fedorahosted.org/freeipa/ticket/3202

Design page:

http://www.freeipa.org/page/V3_Minor_Enhancements


--
Tomas Babej
Associate Software Engeneer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org

From 3b89b881024a788c3335cad612144e538b1a27af Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Wed, 25 Sep 2013 13:45:45 +0200
Subject: [PATCH] ipa-client: Set NIS domain name in the installer

Provides two new options for the ipa-client-install:
    --nisdomain: specifies the NIS domain name
    --no_nisdomain: flag to aviod setting the NIS domain name

In case no --nisdomain is specified and --no_nisdomain flag was
not set, the IPA domain is used.

Manual pages updated.

http://fedorahosted.org/freeipa/ticket/3202
---
 ipa-client/ipa-install/ipa-client-install | 21 +++++++++++++++++++++
 ipa-client/man/ipa-client-install.1       |  6 ++++++
 2 files changed, 27 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 7e474bd59a850e12f1f9f2f72a81cf9a979f779a..597f43f3bb52c89ff9cb482c355f40ed71ac7044 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -124,6 +124,11 @@ def parse_options():
     basic_group.add_option("", "--force-ntpd", dest="force_ntpd",
                       action="store_true", default=False,
                       help="Stop and disable any time&date synchronization services besides ntpd")
+    basic_group.add_option("--nisdomain", dest="nisdomain",
+                           help="NIS domain name")
+    basic_group.add_option("--no-nisdomain", action="store_true", default=False,
+                      help="do not configure NIS domain name",
+                      dest="no_nisdomain")
     basic_group.add_option("--ssh-trust-dns", dest="trust_sshfp", default=False, action="store_true",
                       help="configure OpenSSH client to trust DNS SSHFP records")
     basic_group.add_option("--no-ssh", dest="conf_ssh", default=True, action="store_false",
@@ -185,6 +190,9 @@ def parse_options():
     if options.force_ntpd and not options.conf_ntp:
         parser.error("--force-ntpd cannot be used together with --no-ntp")
 
+    if options.no_nisdomain and not options.nisdomain:
+        parser.error("--no-nisdomain cannot be used together with --nisdomain")
+
     return safe_opts, options
 
 def logging_setup(options):
@@ -1312,6 +1320,16 @@ def configure_automount(options):
         root_logger.info(stdout)
 
 
+def configure_nisdomain(options, domain):
+    domain = options.nisdomain or domain
+
+    root_logger.info('Configuring %s as NIS domain.' % domain)
+
+    auth_config = ipaservices.authconfig()
+    auth_config.add_parameter("nisdomain", domain)
+    auth_config.add_option("update")
+    auth_config.execute()
+
 def resolve_ipaddress(server):
     """ Connect to the server's LDAP port in order to determine what ip
         address this machine uses as "public" ip (relative to the server).
@@ -2544,6 +2562,9 @@ def install(options, env, fstore, statestore):
     if options.location:
         configure_automount(options)
 
+    if not options.no_nisdomain:
+        configure_nisdomain(options=options, domain=cli_domain)
+
     root_logger.info('Client configuration complete.')
 
     return 0
diff --git a/ipa-client/man/ipa-client-install.1 b/ipa-client/man/ipa-client-install.1
index 65c5c2f73913ce8ae705f3b1ff46f16c7eb4c5c6..6173f6ff16b1ab4387f4f3a411451f879d738dea 100644
--- a/ipa-client/man/ipa-client-install.1
+++ b/ipa-client/man/ipa-client-install.1
@@ -122,6 +122,12 @@ Do not configure or enable NTP.
 \fB\-\-force\-ntpd\fR
 Stop and disable any time&date synchronization services besides ntpd.
 .TP
+\fB\-\-nisdomain\fR=\fINIS_DOMAIN\fR
+Set the NIS domain name as specified. By default, this is set to the IPA domain name.
+.TP
+\fB\-\-no\-nisdomain\fR
+Do not configure NIS domain name.
+.TP
 \fB\-\-ssh\-trust\-dns\fR
 Configure OpenSSH client to trust DNS SSHFP records.
 .TP
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to