ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [38/50] [abbrv] ambari git commit: AMBARI-22635. Ambari should create a dummy core-site.xml for Ranger plugins when namenode is not installed. (Vishal Suvagia via swagle)
Date Fri, 05 Jan 2018 23:04:34 GMT
AMBARI-22635. Ambari should create a dummy core-site.xml for Ranger plugins when namenode is
not installed. (Vishal Suvagia via swagle)


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

Branch: refs/heads/branch-feature-AMBARI-20859
Commit: e99867a0b4efb2955b82b9116dd3720a3ea8507a
Parents: da6a201
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Wed Dec 13 13:41:33 2017 -0800
Committer: Robert Levas <rlevas@hortonworks.com>
Committed: Fri Jan 5 17:54:16 2018 -0500

----------------------------------------------------------------------
 .../libraries/functions/setup_ranger_plugin_xml.py  | 14 +++++++-------
 .../package/scripts/setup_ranger_kafka.py           | 14 +++++++++++---
 .../0.8.1/package/scripts/setup_ranger_kafka.py     | 15 ++++++++++++---
 .../0.5.0.2.2/package/scripts/setup_ranger_knox.py  | 16 ++++++++++++----
 .../0.5.0.3.0/package/scripts/setup_ranger_knox.py  | 16 ++++++++++++----
 .../0.9.1/package/scripts/setup_ranger_storm.py     | 15 ++++++++++++---
 .../1.0.1.3.0/package/scripts/setup_ranger_storm.py | 15 ++++++++++++---
 7 files changed, 78 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e99867a0/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
index 485c1a6..78692cb 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
@@ -240,14 +240,14 @@ def setup_ranger_plugin_keystore(service_name, audit_db_is_enabled,
stack_versio
     mode = 0640
   )
 
-def setup_core_site_for_required_plugins(component_user, component_group, create_core_site_path,
config):
+def setup_core_site_for_required_plugins(component_user, component_group, create_core_site_path,
configurations = {}, configuration_attributes = {}):
   XmlConfig('core-site.xml',
-    conf_dir=create_core_site_path,
-    configurations=config['configurations']['core-site'],
-    configuration_attributes=config['configuration_attributes']['core-site'],
-    owner=component_user,
-    group=component_group,
-    mode=0644
+    conf_dir = create_core_site_path,
+    configurations = configurations,
+    configuration_attributes = configuration_attributes,
+    owner = component_user,
+    group = component_group,
+    mode = 0644
   )
 
 def get_audit_configs(config):

http://git-wip-us.apache.org/repos/asf/ambari/blob/e99867a0/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/package/scripts/setup_ranger_kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/package/scripts/setup_ranger_kafka.py
b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/package/scripts/setup_ranger_kafka.py
index e9719aa..3a0b991 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/package/scripts/setup_ranger_kafka.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.10.0.3.0/package/scripts/setup_ranger_kafka.py
@@ -81,9 +81,17 @@ def setup_ranger_kafka():
         group = params.user_group,
         mode = 0755
       )
-    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_kafka and
params.has_namenode and params.security_enabled:
-      Logger.info("Stack supports core-site.xml creation for Ranger plugin, creating create
core-site.xml from namenode configuraitions")
-      setup_core_site_for_required_plugins(component_user=params.kafka_user,component_group=params.user_group,create_core_site_path
= params.conf_dir, config = params.config)
+    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_kafka and
params.security_enabled:
+      if params.has_namenode:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is installed, creating create core-site.xml from namenode configurations")
+        setup_core_site_for_required_plugins(component_user = params.kafka_user, component_group
= params.user_group,
+                                             create_core_site_path = params.conf_dir, configurations
= params.config['configurations']['core-site'],
+                                             configuration_attributes = params.config['configuration_attributes']['core-site'])
+      else:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is not installed, creating create core-site.xml from default configurations")
+        setup_core_site_for_required_plugins(component_user = params.kafka_user, component_group
= params.user_group,
+                                             create_core_site_path = params.conf_dir, configurations
= { 'hadoop.security.authentication' : 'kerberos' if params.security_enabled else 'simple'
},
+                                             configuration_attributes = {})
     else:
       Logger.info("Stack does not support core-site.xml creation for Ranger plugin, skipping
core-site.xml configurations")
   else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/e99867a0/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
index 9aa09df..e2cfbcf 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/setup_ranger_kafka.py
@@ -81,9 +81,18 @@ def setup_ranger_kafka():
         group = params.user_group,
         mode = 0755
       )
-    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_kafka and
params.has_namenode and params.kerberos_security_enabled:
-      Logger.info("Stack supports core-site.xml creation for Ranger plugin, creating create
core-site.xml from namenode configuraitions")
-      setup_core_site_for_required_plugins(component_user=params.kafka_user,component_group=params.user_group,create_core_site_path
= params.conf_dir, config = params.config)
+    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_kafka and
params.kerberos_security_enabled:
+      if params.has_namenode:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is installed, creating create core-site.xml from namenode configurations")
+        setup_core_site_for_required_plugins(component_user = params.kafka_user, component_group
= params.user_group,
+                                             create_core_site_path = params.conf_dir, configurations
= params.config['configurations']['core-site'],
+                                             configuration_attributes = params.config['configuration_attributes']['core-site'])
+      else:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is not installed, creating create core-site.xml from default configurations")
+        setup_core_site_for_required_plugins(component_user = params.kafka_user, component_group
= params.user_group,
+                                             create_core_site_path = params.conf_dir, configurations
= { 'hadoop.security.authentication' : 'kerberos' if params.security_enabled else 'simple'
},
+                                             configuration_attributes = {})
+
     else:
       Logger.info("Stack does not support core-site.xml creation for Ranger plugin, skipping
core-site.xml configurations")
   else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/e99867a0/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
index c486ef7..67fec40 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/setup_ranger_knox.py
@@ -108,12 +108,20 @@ def setup_ranger_knox(upgrade_type=None):
                         plugin_security_properties=params.config['configurations']['ranger-knox-security'],
plugin_security_attributes=params.config['configuration_attributes']['ranger-knox-security'],
                         plugin_policymgr_ssl_properties=params.config['configurations']['ranger-knox-policymgr-ssl'],
plugin_policymgr_ssl_attributes=params.config['configuration_attributes']['ranger-knox-policymgr-ssl'],
                         component_list=['knox-server'], audit_db_is_enabled=params.xa_audit_db_is_enabled,
-                        credential_file=params.credential_file, xa_audit_db_password=params.xa_audit_db_password,

+                        credential_file=params.credential_file, xa_audit_db_password=params.xa_audit_db_password,
                         ssl_truststore_password=params.ssl_truststore_password, ssl_keystore_password=params.ssl_keystore_password,
                         stack_version_override = stack_version, skip_if_rangeradmin_down=
not params.retryAble)
-    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_knox and
params.has_namenode and params.security_enabled:
-      Logger.info("Stack supports core-site.xml creation for Ranger plugin, creating core-site.xml
from namenode configuraitions")
-      setup_core_site_for_required_plugins(component_user=params.knox_user, component_group=params.knox_group,create_core_site_path
= params.knox_conf_dir, config = params.config)
+    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_knox and
params.security_enabled:
+      if params.has_namenode:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is installed, creating create core-site.xml from namenode configurations")
+        setup_core_site_for_required_plugins(component_user = params.knox_user, component_group
= params.knox_group,
+                                             create_core_site_path = params.knox_conf_dir,
configurations = params.config['configurations']['core-site'],
+                                             configuration_attributes = params.config['configuration_attributes']['core-site'])
+      else:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is not installed, creating create core-site.xml from default configurations")
+        setup_core_site_for_required_plugins(component_user = params.knox_user, component_group
= params.knox_group,
+                                             create_core_site_path = params.knox_conf_dir,
configurations = { 'hadoop.security.authentication' : 'kerberos' if params.security_enabled
else 'simple' },
+                                             configuration_attributes = {})
     else:
       Logger.info("Stack does not support core-site.xml creation for Ranger plugin, skipping
core-site.xml configurations")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e99867a0/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/scripts/setup_ranger_knox.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/scripts/setup_ranger_knox.py
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/scripts/setup_ranger_knox.py
index c486ef7..67fec40 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/scripts/setup_ranger_knox.py
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.3.0/package/scripts/setup_ranger_knox.py
@@ -108,12 +108,20 @@ def setup_ranger_knox(upgrade_type=None):
                         plugin_security_properties=params.config['configurations']['ranger-knox-security'],
plugin_security_attributes=params.config['configuration_attributes']['ranger-knox-security'],
                         plugin_policymgr_ssl_properties=params.config['configurations']['ranger-knox-policymgr-ssl'],
plugin_policymgr_ssl_attributes=params.config['configuration_attributes']['ranger-knox-policymgr-ssl'],
                         component_list=['knox-server'], audit_db_is_enabled=params.xa_audit_db_is_enabled,
-                        credential_file=params.credential_file, xa_audit_db_password=params.xa_audit_db_password,

+                        credential_file=params.credential_file, xa_audit_db_password=params.xa_audit_db_password,
                         ssl_truststore_password=params.ssl_truststore_password, ssl_keystore_password=params.ssl_keystore_password,
                         stack_version_override = stack_version, skip_if_rangeradmin_down=
not params.retryAble)
-    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_knox and
params.has_namenode and params.security_enabled:
-      Logger.info("Stack supports core-site.xml creation for Ranger plugin, creating core-site.xml
from namenode configuraitions")
-      setup_core_site_for_required_plugins(component_user=params.knox_user, component_group=params.knox_group,create_core_site_path
= params.knox_conf_dir, config = params.config)
+    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_knox and
params.security_enabled:
+      if params.has_namenode:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is installed, creating create core-site.xml from namenode configurations")
+        setup_core_site_for_required_plugins(component_user = params.knox_user, component_group
= params.knox_group,
+                                             create_core_site_path = params.knox_conf_dir,
configurations = params.config['configurations']['core-site'],
+                                             configuration_attributes = params.config['configuration_attributes']['core-site'])
+      else:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is not installed, creating create core-site.xml from default configurations")
+        setup_core_site_for_required_plugins(component_user = params.knox_user, component_group
= params.knox_group,
+                                             create_core_site_path = params.knox_conf_dir,
configurations = { 'hadoop.security.authentication' : 'kerberos' if params.security_enabled
else 'simple' },
+                                             configuration_attributes = {})
     else:
       Logger.info("Stack does not support core-site.xml creation for Ranger plugin, skipping
core-site.xml configurations")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e99867a0/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/setup_ranger_storm.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/setup_ranger_storm.py
b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/setup_ranger_storm.py
index c04496e..57bfc90 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/setup_ranger_storm.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1/package/scripts/setup_ranger_storm.py
@@ -111,9 +111,18 @@ def setup_ranger_storm(upgrade_type=None):
             cd_access = 'a'
             )
 
-    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_storm and
params.has_namenode and params.security_enabled:
-      Logger.info("Stack supports core-site.xml creation for Ranger plugin, creating create
core-site.xml from namenode configuraitions")
-      setup_core_site_for_required_plugins(component_user=params.storm_user,component_group=params.user_group,create_core_site_path
= site_files_create_path, config = params.config)
+    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_storm and
params.security_enabled:
+      if params.has_namenode:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is installed, creating create core-site.xml from namenode configurations")
+        setup_core_site_for_required_plugins(component_user = params.storm_user, component_group
= params.user_group,
+                                             create_core_site_path = site_files_create_path,
configurations = params.config['configurations']['core-site'],
+                                             configuration_attributes = params.config['configuration_attributes']['core-site'])
+      else:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is not installed, creating create core-site.xml from default configurations")
+        setup_core_site_for_required_plugins(component_user = params.storm_user, component_group
= params.user_group,
+                                             create_core_site_path = site_files_create_path,
configurations = { 'hadoop.security.authentication' : 'kerberos' if params.security_enabled
else 'simple' },
+                                             configuration_attributes = {})
+
       if len(params.namenode_hosts) > 1:
         Logger.info('Ranger Storm plugin is enabled along with security and NameNode is HA
, creating hdfs-site.xml')
         XmlConfig("hdfs-site.xml",

http://git-wip-us.apache.org/repos/asf/ambari/blob/e99867a0/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/setup_ranger_storm.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/setup_ranger_storm.py
b/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/setup_ranger_storm.py
index c04496e..57bfc90 100644
--- a/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/setup_ranger_storm.py
+++ b/ambari-server/src/main/resources/common-services/STORM/1.0.1.3.0/package/scripts/setup_ranger_storm.py
@@ -111,9 +111,18 @@ def setup_ranger_storm(upgrade_type=None):
             cd_access = 'a'
             )
 
-    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_storm and
params.has_namenode and params.security_enabled:
-      Logger.info("Stack supports core-site.xml creation for Ranger plugin, creating create
core-site.xml from namenode configuraitions")
-      setup_core_site_for_required_plugins(component_user=params.storm_user,component_group=params.user_group,create_core_site_path
= site_files_create_path, config = params.config)
+    if params.stack_supports_core_site_for_ranger_plugin and params.enable_ranger_storm and
params.security_enabled:
+      if params.has_namenode:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is installed, creating create core-site.xml from namenode configurations")
+        setup_core_site_for_required_plugins(component_user = params.storm_user, component_group
= params.user_group,
+                                             create_core_site_path = site_files_create_path,
configurations = params.config['configurations']['core-site'],
+                                             configuration_attributes = params.config['configuration_attributes']['core-site'])
+      else:
+        Logger.info("Stack supports core-site.xml creation for Ranger plugin and Namenode
is not installed, creating create core-site.xml from default configurations")
+        setup_core_site_for_required_plugins(component_user = params.storm_user, component_group
= params.user_group,
+                                             create_core_site_path = site_files_create_path,
configurations = { 'hadoop.security.authentication' : 'kerberos' if params.security_enabled
else 'simple' },
+                                             configuration_attributes = {})
+
       if len(params.namenode_hosts) > 1:
         Logger.info('Ranger Storm plugin is enabled along with security and NameNode is HA
, creating hdfs-site.xml')
         XmlConfig("hdfs-site.xml",


Mime
View raw message