ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gau...@apache.org
Subject ambari git commit: AMBARI-14562. Ranger - If configured audit store is 'solr', then audit_store value should be 'solr'(gautam)
Date Tue, 02 Feb 2016 09:49:02 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 774d689ee -> 6e098207d


AMBARI-14562. Ranger - If configured audit store is 'solr', then audit_store value should
be 'solr'(gautam)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6e098207
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6e098207
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6e098207

Branch: refs/heads/trunk
Commit: 6e098207dd0d8c015df7dd5f7ddede87ee269216
Parents: 774d689
Author: Gautam Borad <gautam@apache.org>
Authored: Fri Jan 22 09:25:37 2016 +0530
Committer: Gautam Borad <gautam@apache.org>
Committed: Tue Feb 2 15:18:48 2016 +0530

----------------------------------------------------------------------
 .../RANGER/0.4.0/package/scripts/setup_ranger_xml.py     |  5 +++++
 .../services/RANGER/configuration/ranger-admin-site.xml  | 10 ++++++++++
 .../resources/stacks/HDP/2.3/services/stack_advisor.py   | 11 +++++++++++
 .../test/python/stacks/2.3/common/test_stack_advisor.py  |  3 ++-
 4 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6e098207/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
index 119da1a..4660cf8 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
@@ -196,6 +196,11 @@ def setup_ranger_db(upgrade_type=None):
     owner = params.unix_user,
   )
 
+  ModifyPropertiesFile(format("{ranger_home}/install.properties"),
+    properties = {'audit_store': params.ranger_audit_source_type},
+    owner = params.unix_user,
+  )
+
   if params.db_flavor.lower() == 'sqla':
     ModifyPropertiesFile(format("{ranger_home}/install.properties"),
       properties = {'SQL_CONNECTOR_JAR': format('{ranger_home}/ews/lib/{jdbc_jar_name}')},

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e098207/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
index e9eecde..07eb7c4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/RANGER/configuration/ranger-admin-site.xml
@@ -164,6 +164,16 @@
     <name>ranger.audit.source.type</name>
     <value>solr</value>
     <description>db or solr, based on the audit destination used</description>
+    <depends-on>
+      <property>
+        <type>ranger-env</type>
+        <name>xasecure.audit.destination.solr</name>
+      </property>
+      <property>
+        <type>ranger-env</type>
+        <name>xasecure.audit.destination.db</name>
+      </property>
+    </depends-on>
   </property>
 
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e098207/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 3e60f05..dae3e8a 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
@@ -624,6 +624,17 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
                 rangerAuditProperty = services["configurations"][item['filename']]["properties"][item['configname']]
               putRangerAuditProperty(item['target_configname'], rangerAuditProperty)
 
+    audit_solr_flag = 'false'
+    audit_db_flag = 'false'
+    ranger_audit_source_type = 'solr'
+    if 'ranger-env' in services['configurations'] and 'xasecure.audit.destination.solr' in
services['configurations']["ranger-env"]["properties"]:
+      audit_solr_flag = services['configurations']["ranger-env"]["properties"]['xasecure.audit.destination.solr']
+    if 'ranger-env' in services['configurations'] and 'xasecure.audit.destination.db' in
services['configurations']["ranger-env"]["properties"]:
+      audit_db_flag = services['configurations']["ranger-env"]["properties"]['xasecure.audit.destination.db']
+
+    if audit_db_flag == 'true' and audit_solr_flag == 'false':
+      ranger_audit_source_type = 'db'
+    putRangerAdminProperty('ranger.audit.source.type',ranger_audit_source_type)
 
 
   def recommendYARNConfigurations(self, configurations, clusterData, services, hosts):

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e098207/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 e345e2a..965ce98 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
@@ -1531,7 +1531,8 @@ class TestHDP23StackAdvisor(TestCase):
       },
       'ranger-admin-site': {
         'properties': {
-          "ranger.audit.solr.zookeepers": "NONE"
+          "ranger.audit.solr.zookeepers": "NONE",
+          "ranger.audit.source.type": "solr"
         }
       },
       'ranger-env': {


Mime
View raw message