Repository: ambari Updated Branches: refs/heads/branch-2.1 9bacc2557 -> 8dfb83512
AMBARI-13847. Ranger smart config - AD url missing ldap:// (or ldaps://). (jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8dfb8351 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8dfb8351 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8dfb8351 Branch: refs/heads/branch-2.1 Commit: 8dfb835127bfc51702c3a69d795ccef4efe91968 Parents: 9bacc25 Author: Jaimin Jetly <[email protected]> Authored: Thu Nov 12 11:07:33 2015 -0800 Committer: Jaimin Jetly <[email protected]> Committed: Thu Nov 12 11:10:03 2015 -0800 ---------------------------------------------------------------------- .../resources/stacks/HDP/2.0.6/services/stack_advisor.py | 6 +++++- .../main/resources/stacks/HDP/2.3/services/stack_advisor.py | 6 +++++- .../test/python/stacks/2.0.6/common/test_stack_advisor.py | 8 ++++---- .../src/test/python/stacks/2.3/common/test_stack_advisor.py | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/8dfb8351/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py index 7181122..878b2cd 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py @@ -318,7 +318,11 @@ class HDP206StackAdvisor(DefaultStackAdvisor): if 'authentication.ldap.managerDn' in serverProperties: putUserSyncProperty('SYNC_LDAP_BIND_DN', serverProperties['authentication.ldap.managerDn']) if 'authentication.ldap.primaryUrl' in serverProperties: - putUserSyncProperty('SYNC_LDAP_URL', serverProperties['authentication.ldap.primaryUrl']) + ldap_protocol = 'ldap://' + if 'authentication.ldap.useSSL' in serverProperties and serverProperties['authentication.ldap.useSSL'] == 'true': + ldap_protocol = 'ldaps://' + ldapUrl = ldap_protocol + serverProperties['authentication.ldap.primaryUrl'] if serverProperties['authentication.ldap.primaryUrl'] else serverProperties['authentication.ldap.primaryUrl'] + putUserSyncProperty('SYNC_LDAP_URL', ldapUrl) if 'authentication.ldap.userObjectClass' in serverProperties: putUserSyncProperty('SYNC_LDAP_USER_OBJECT_CLASS', serverProperties['authentication.ldap.userObjectClass']) if 'authentication.ldap.usernameAttribute' in serverProperties: http://git-wip-us.apache.org/repos/asf/ambari/blob/8dfb8351/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py index ef54efe..3038fa3 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py @@ -388,7 +388,11 @@ class HDP23StackAdvisor(HDP22StackAdvisor): if 'authentication.ldap.managerDn' in serverProperties: putRangerUgsyncSite('ranger.usersync.ldap.binddn', serverProperties['authentication.ldap.managerDn']) if 'authentication.ldap.primaryUrl' in serverProperties: - putRangerUgsyncSite('ranger.usersync.ldap.url', serverProperties['authentication.ldap.primaryUrl']) + ldap_protocol = 'ldap://' + if 'authentication.ldap.useSSL' in serverProperties and serverProperties['authentication.ldap.useSSL'] == 'true': + ldap_protocol = 'ldaps://' + ldapUrl = ldap_protocol + serverProperties['authentication.ldap.primaryUrl'] if serverProperties['authentication.ldap.primaryUrl'] else serverProperties['authentication.ldap.primaryUrl'] + putRangerUgsyncSite('ranger.usersync.ldap.url', ldapUrl) if 'authentication.ldap.userObjectClass' in serverProperties: putRangerUgsyncSite('ranger.usersync.ldap.user.objectclass', serverProperties['authentication.ldap.userObjectClass']) if 'authentication.ldap.usernameAttribute' in serverProperties: http://git-wip-us.apache.org/repos/asf/ambari/blob/8dfb8351/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py index f29d147..99ea217 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py @@ -803,12 +803,12 @@ class TestHDP206StackAdvisor(TestCase): "authentication.ldap.bindAnonymously" : "false", "authentication.ldap.baseDn" : "dc=apache,dc=org", "authentication.ldap.groupNamingAttr" : "cn", - "authentication.ldap.primaryUrl" : "c6403.ambari.apache.org:389", + "authentication.ldap.primaryUrl" : "c6403.ambari.apache.org:636", "authentication.ldap.userObjectClass" : "posixAccount", - "authentication.ldap.secondaryUrl" : "c6403.ambari.apache.org:389", + "authentication.ldap.secondaryUrl" : "c6403.ambari.apache.org:636", "authentication.ldap.usernameAttribute" : "uid", "authentication.ldap.dnAttribute" : "dn", - "authentication.ldap.useSSL" : "false", + "authentication.ldap.useSSL" : "true", "authentication.ldap.managerPassword" : "/etc/ambari-server/conf/ldap-password.dat", "authentication.ldap.groupMembershipAttr" : "memberUid", "authentication.ldap.groupObjectClass" : "posixGroup", @@ -824,7 +824,7 @@ class TestHDP206StackAdvisor(TestCase): 'ranger-env': {'properties': {}}, 'usersync-properties': { 'properties': { - 'SYNC_LDAP_URL': 'c6403.ambari.apache.org:389', + 'SYNC_LDAP_URL': 'ldaps://c6403.ambari.apache.org:636', 'SYNC_LDAP_BIND_DN': 'uid=hdfs,ou=people,ou=dev,dc=apache,dc=org', 'SYNC_LDAP_USER_OBJECT_CLASS': 'posixAccount', 'SYNC_LDAP_USER_NAME_ATTRIBUTE': 'uid' http://git-wip-us.apache.org/repos/asf/ambari/blob/8dfb8351/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py index e1f5226..4db688c 100644 --- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py @@ -1108,7 +1108,7 @@ class TestHDP23StackAdvisor(TestCase): 'ranger.usersync.ldap.binddn': 'uid=hdfs,ou=people,ou=dev,dc=apache,dc=org', 'ranger.usersync.ldap.user.nameattribute': 'uid', 'ranger.usersync.ldap.user.objectclass': 'posixAccount', - 'ranger.usersync.ldap.url': 'c6403.ambari.apache.org:389', + 'ranger.usersync.ldap.url': 'ldap://c6403.ambari.apache.org:389', 'ranger.usersync.ldap.searchBase': 'dc=apache,dc=org' } },
