Hello everyone.

I send patch for review.

Regards,
From 3a27ef5bf3001f5f5ad2e71a4fc76a7a5c104e88 Mon Sep 17 00:00:00 2001
From: "Ariel O. Barria" <ariel.o.bar...@gmail.com>
Date: Tue, 26 Jul 2016 09:32:26 -0500
Subject: [PATCH] freeipa arielb 0002 Add client install option to set
 ipa_backup_server

Add ipa backup_server on sssd.conf using ipa-client-install

https://fedorahosted.org/freeipa/ticket/4016
---
 client/ipa-client-install | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/client/ipa-client-install b/client/ipa-client-install
index 05b6b6e0da07353750d0dca4e6df9d1f58d69c35..af5d72a5d9e0b89edbb1a5bb974621ae2f02b85a 100755
--- a/client/ipa-client-install
+++ b/client/ipa-client-install
@@ -115,6 +115,10 @@ def parse_options():
     basic_group = OptionGroup(parser, "basic options")
     basic_group.add_option("--domain", dest="domain", help="domain name")
     basic_group.add_option("--server", dest="server", help="IPA server", action="append")
+    basic_group.add_option("--ipa-backup-server", dest="ipa_backup_server",
+                      default=False,
+                      help="Configure sssd to use backup server if no primary"
+                           " servers can be reached.")
     basic_group.add_option("--realm", dest="realm_name", help="realm name")
     basic_group.add_option("--fixed-primary", dest="primary", action="store_true",
                       default=False, help="Configure sssd to use fixed server as primary IPA server")
@@ -231,6 +235,13 @@ def parse_options():
     if (options.server and not options.domain):
         parser.error("--server cannot be used without providing --domain")
 
+    if (options.server and not options.domain):
+        parser.error("--server cannot be used without providing --domain")
+
+    if (options.ipa_backup_server and not options.primary):
+        parser.error("--ipa-backup-server cannot be used without providing "
+                     "--fixed-primary")
+
     if options.domain:
         try:
             validate_domain_name(options.domain)
@@ -1273,6 +1284,9 @@ def configure_sssd_conf(fstore, cli_realm, cli_domain, cli_server, options, clie
     if not options.on_master:
         if options.primary:
             domain.set_option('ipa_server', ', '.join(cli_server))
+            if options.ipa_backup_server:
+                domain.set_option('ipa_backup_server',
+                       options.ipa_backup_server)
         else:
             domain.set_option('ipa_server', '_srv_, %s' % ', '.join(cli_server))
     else:
-- 
2.7.4

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to