From 95483d3b9f0973e825cf37340f8ca91b567ab134 Mon Sep 17 00:00:00 2001 From: Ana Krivokapic Date: Fri, 30 Aug 2013 16:05:01 +0200 Subject: 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 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'ipa-client/ipa-install/ipa-client-install') diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index 280edd793..3bfd5a445 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 -- cgit