On 09/02/2013 12:55 PM, Petr Viktorin wrote:
> On 08/30/2013 04:10 PM, Ana Krivokapic wrote:
>> Hello,
>>
>> The attached patch addresses ticket
>> https://fedorahosted.org/freeipa/ticket/3740.
>
> Hello,
> Please write a design doc for this RFE.

I updated the Minor Enhancements page:
http://www.freeipa.org/page/V3_Minor_Enhancements. I think it is sufficient in
this case.

> Also you'll need to update the ipa-client-install man page.

Done.

>
> I wonder if `location` is too generic a name for this option.
> Did you think about `--automount-location`,

Good point, I changed `--location` to `--automount-location`.

> plus maybe `--automount` without argument to just use the "default" location?
> It's a bit longer but it would make it immediately clear what the option is
> about.
>

I think this is a bit of an overkill, as "--automount-location=default" does
precisely that. I would rather not complicate things further by adding more 
options.

Thanks for the review, updated patch is attached.

-- 
Regards,

Ana Krivokapic
Associate Software Engineer
FreeIPA team
Red Hat Inc.

From c05660356c50924e5ebf54cd6eb2585aab5f4090 Mon Sep 17 00:00:00 2001
From: Ana Krivokapic <akriv...@redhat.com>
Date: Fri, 30 Aug 2013 16:05:01 +0200
Subject: [PATCH] Add option to ipa-client-install to configure automount

Add the --automount-location option to ipa-client-install. If the option is
used, ipa-client-automount is called at the end of ipa-client-install.

https://fedorahosted.org/freeipa/ticket/3740
---
 ipa-client/ipa-install/ipa-client-install | 27 +++++++++++++++++++++++++++
 ipa-client/man/ipa-client-install.1       |  5 ++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 280edd793326150c416fe1b82f9866435e9c6509..3bfd5a4455c786d638a8ab1984f780dd537a103d 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -148,6 +148,8 @@ def parse_options():
     # only, it isn't meant to be used on clients.
     basic_group.add_option("--on-master", dest="on_master", action="store_true",
                       help=SUPPRESS_HELP, default=False)
+    basic_group.add_option("--automount-location", dest="location",
+                           help="Automount location")
     parser.add_option_group(basic_group)
 
     sssd_group = OptionGroup(parser, "SSSD options")
@@ -1288,6 +1290,28 @@ def configure_sshd_config(fstore, options):
         except Exception, e:
             log_service_error(sshd.service_name, 'restart', e)
 
+
+def configure_automount(options):
+    root_logger.info('\nConfiguring automount:')
+
+    args = [
+        'ipa-client-automount', '--debug', '-U',
+        '--location', options.location
+    ]
+
+    if options.server:
+        args.extend(['--server', options.server[0]])
+    if not options.sssd:
+        args.append('--no-sssd')
+
+    try:
+        stdout, _, _ = run(args)
+    except Exception, e:
+        root_logger.error('Automount configuration failed: %s', str(e))
+    else:
+        root_logger.info(stdout)
+
+
 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).
@@ -2515,6 +2539,9 @@ def install(options, env, fstore, statestore):
     if options.conf_sshd:
         configure_sshd_config(fstore, options)
 
+    if options.location:
+        configure_automount(options)
+
     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 bb19041b13622e3384fb800fca60b7b6f695e8f0..fd9a1d5250e1451b553624172722405b22c1f519 100644
--- a/ipa-client/man/ipa-client-install.1
+++ b/ipa-client/man/ipa-client-install.1
@@ -146,13 +146,16 @@ Print debugging information to stdout
 \fB\-U\fR, \fB\-\-unattended\fR
 Unattended installation. The user will not be prompted.
 .TP
-\fB\-\-ca-cert-file\fR=\fICA_FILE\fR
+\fB\-\-ca\-cert\-file\fR=\fICA_FILE\fR
 Do not attempt to acquire the IPA CA certificate via automated means,
 instead use the CA certificate found locally in in \fICA_FILE\fR.  The
 \fICA_FILE\fR must be an absolute path to a PEM formatted certificate
 file. The CA certificate found in \fICA_FILE\fR is considered
 authoritative and will be installed without checking to see if it's
 valid for the IPA domain.
+.TP
+\fB\-\-automount\-location\fR=\fILOCATION\fR
+Automount location
 
 .SS "SSSD OPTIONS"
 .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