incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1496186 - in /incubator/ambari/branches/branch-1.2.5: ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/ ambari-web/app/controllers/main/admin/security/add/ ambari-web/app/data/ ambari-web/app/views/main/admin/security/add/ amba...
Date Mon, 24 Jun 2013 20:00:15 GMT
Author: yusaku
Date: Mon Jun 24 20:00:14 2013
New Revision: 1496186

URL: http://svn.apache.org/r1496186
Log:
AMBARI-2478. Security Wizard: show principal name rather than primary name. (jaimin via yusaku)

Modified:
    incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
    incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step2.js
    incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step3.js
    incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_configs.js
    incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_mapping.js
    incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_properties.js
    incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/main/admin/security/add/step2.js
    incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/wizard/controls_view.js

Modified: incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
(original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-agent/src/main/puppet/modules/hdp-zookeeper/manifests/params.pp
Mon Jun 24 20:00:14 2013
@@ -36,12 +36,8 @@ class hdp-zookeeper::params() inherits h
   $clientPort = hdp_default("clientPort","2181")
 
   $zk_primary_name = hdp_default("zookeeper_primary_name", "zookeeper")
-
-  if ($use_hostname_in_principal) {
-    $zk_principal = "${zk_primary_name}/${hostname}@${kerberos_domain}"
-  } else {
-    $zk_principal = "${zk_primary_name}@${kerberos_domain}"
-  }
+  $zk_principal_name = hdp_default("zookeeper_principal_name", "zookeeper/_HOST@EXAMPLE.COM")
+  $zk_principal = regsubst($zk_principal_name, '_HOST', $hostname)
 
   $zk_keytab_path = hdp_default("zookeeper_keytab_path", "${keytab_path}/zk.service.keytab")
   $zk_server_jaas_file = hdp_default("zk_server_jaas_conf_file", "${conf_dir}/zookeeper_jaas.conf")

Modified: incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step2.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step2.js?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step2.js
(original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step2.js
Mon Jun 24 20:00:14 2013
@@ -39,6 +39,7 @@ App.MainAdminSecurityAddStep2Controller 
   loadStep: function () {
     console.log("TRACE: Loading addSecurity step2: Configure Services");
     this.clearStep();
+    this.addMasterHostToGlobals(this.get('content.services'));
     this.renderServiceConfigs(this.get('content.services'));
     var storedServices = this.get('content.serviceConfigProperties');
     if (storedServices) {
@@ -99,8 +100,6 @@ App.MainAdminSecurityAddStep2Controller 
   loadComponentConfigs: function (_componentConfig, componentConfig) {
     _componentConfig.configs.forEach(function (_serviceConfigProperty) {
       var serviceConfigProperty = App.ServiceConfigProperty.create(_serviceConfigProperty);
-      //serviceConfigProperty.serviceConfig = componentConfig;
-      //serviceConfigProperty.initialValue();
       componentConfig.configs.pushObject(serviceConfigProperty);
       serviceConfigProperty.set('isEditable', serviceConfigProperty.get('isReconfigurable'));
       serviceConfigProperty.validate();
@@ -108,6 +107,49 @@ App.MainAdminSecurityAddStep2Controller 
   },
 
 
+  addMasterHostToGlobals: function (serviceConfigs) {
+    var oozieService = serviceConfigs.findProperty('serviceName', 'OOZIE');
+    var hiveService = serviceConfigs.findProperty('serviceName', 'HIVE');
+    var webHcatService = App.Service.find().mapProperty('serviceName').contains('WEBHCAT');
+    var nagiosService = serviceConfigs.findProperty('serviceName', 'NAGIOS');
+    var generalService = serviceConfigs.findProperty('serviceName', 'GENERAL');
+    if (oozieService) {
+      var oozieServerHost = oozieService.configs.findProperty('name', 'oozie_servername');
+      var oozieServerPrincipal = oozieService.configs.findProperty('name', 'oozie_principal_name');
+      var oozieSpnegoPrincipal =  generalService.configs.findProperty('name', 'oozie_http_principal_name');
+      if (oozieServerHost && oozieServerPrincipal && oozieSpnegoPrincipal)
{
+        oozieServerHost.defaultValue = App.Service.find('OOZIE').get('hostComponents').findProperty('componentName',
'OOZIE_SERVER').get('host.hostName');
+        oozieServerPrincipal.defaultValue = 'oozie/' + oozieServerHost.defaultValue;
+        oozieSpnegoPrincipal.defaultValue = 'HTTP/' + oozieServerHost.defaultValue;
+        oozieSpnegoPrincipal.isVisible = true;
+      }
+    }
+    if (hiveService) {
+      var hiveServerHost = hiveService.configs.findProperty('name', 'hive_metastore');
+      if (hiveServerHost) {
+        hiveServerHost.defaultValue = App.Service.find('HIVE').get('hostComponents').findProperty('componentName',
'HIVE_SERVER').get('host.hostName');
+      }
+    }
+
+    if(webHcatService) {
+      var webHcatHost =  App.Service.find('WEBHCAT').get('hostComponents').findProperty('componentName',
'WEBHCAT_SERVER').get('host.hostName');
+      var webHcatSpnegoPrincipal =  generalService.configs.findProperty('name', 'webHCat_http_principal_name');
+      if(webHcatHost && webHcatSpnegoPrincipal) {
+        webHcatSpnegoPrincipal.defaultValue = 'HTTP/' + webHcatHost;
+        webHcatSpnegoPrincipal.isVisible = true;
+      }
+    }
+
+    if(nagiosService) {
+      var nagiosServerHost = nagiosService.configs.findProperty('name', 'nagios_server');
+      var nagiosServerPrincipal = nagiosService.configs.findProperty('name', 'nagios_principal_name');
+      if (nagiosServerHost && nagiosServerPrincipal) {
+        nagiosServerHost.defaultValue = App.Service.find('NAGIOS').get('hostComponents').findProperty('componentName',
'NAGIOS_SERVER').get('host.hostName');
+        nagiosServerPrincipal.defaultValue = 'nagios/' + nagiosServerHost.defaultValue;
+      }
+    }
+  },
+
   /**
    *  submit and move to step3
    */

Modified: incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step3.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step3.js?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step3.js
(original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-web/app/controllers/main/admin/security/add/step3.js
Mon Jun 24 20:00:14 2013
@@ -220,34 +220,6 @@ App.MainAdminSecurityAddStep3Controller 
     return uiConfig;
   },
 
-  appendInstanceName: function (name, property) {
-    var newValue;
-    if (this.get('globalProperties').someProperty('name', name)) {
-      var globalProperty = this.get('globalProperties').findProperty('name', name);
-      newValue = globalProperty.value;
-      var isInstanceName = this.get('globalProperties').findProperty('name', 'instance_name').value;
-      if (isInstanceName === true || isInstanceName === 'true') {
-        if (/primary_name?$/.test(globalProperty.name) && property !== 'hadoop.security.auth_to_local'
&& property !== 'oozie.authentication.kerberos.name.rules') {
-          if (this.get('isOozieSelected') && (property === 'oozie.service.HadoopAccessorService.kerberos.principal'
|| property === 'oozie.authentication.kerberos.principal')) {
-            var oozieServerName = App.Service.find('OOZIE').get('hostComponents').findProperty('componentName',
'OOZIE_SERVER').get('host.hostName');
-            newValue = newValue + '/' + oozieServerName;
-          } else if (this.isWebHcatSelected() && (property === 'templeton.kerberos.principal'))
{
-            var webHcatName = App.Service.find('WEBHCAT').get('hostComponents').findProperty('componentName',
'WEBHCAT_SERVER').get('host.hostName');
-            newValue = newValue + '/' + webHcatName;
-          } else {
-            if (!/_HOST?$/.test(newValue)) {
-              newValue = newValue + '/_HOST';
-            }
-          }
-        }
-      }
-    } else {
-      console.log("The template name does not exist in secure_properties file");
-      newValue = null;
-    }
-    return newValue;
-  },
-
   /**
    * Set all site property that are derived from other puppet-variable
    */
@@ -261,12 +233,11 @@ App.MainAdminSecurityAddStep3Controller 
     express.forEach(function (_express) {
       //console.log("The value of template is: " + _express);
       var index = parseInt(_express.match(/\[([\d]*)(?=\])/)[1]);
-      if (this.get('globalProperties').someProperty('name', templateName[index])) {
-        //console.log("The name of the variable is: " + this.get('content.serviceConfigProperties').findProperty('name',
templateName[index]).name);
-        var globValue = this.appendInstanceName(templateName[index], name);
+      var globValue = this.get('globalProperties').findProperty('name', templateName[index]);
+      if (globValue) {
         console.log('The template value of templateName ' + '[' + index + ']' + ': ' + templateName[index]
+ ' is: ' + globValue);
         if (value !== null) {   // if the property depends on more than one template name
like <templateName[0]>/<templateName[1]> then don't proceed to the next if the
prior is null or not found in the global configs
-          value = value.replace(_express, globValue);
+          value = value.replace(_express, globValue.value);
         }
       } else {
         /*
@@ -292,16 +263,12 @@ App.MainAdminSecurityAddStep3Controller 
     if (fkValue) {
       fkValue.forEach(function (_fkValue) {
         var index = parseInt(_fkValue.match(/\[([\d]*)(?=\])/)[1]);
-        var globalValue
+        var globalValue;
         if (uiConfig.someProperty('name', config.foreignKey[index])) {
           globalValue = uiConfig.findProperty('name', config.foreignKey[index]).value;
           config._name = config.name.replace(_fkValue, globalValue);
-        } else if (this.get('content.serviceConfigProperties').someProperty('name', config.foreignKey[index]))
{
-          if (this.get('content.serviceConfigProperties').findProperty('name', config.foreignKey[index]).value
=== '') {
-            globalValue = this.get('content.serviceConfigProperties').findProperty('name',
config.foreignKey[index]).defaultValue;
-          } else {
-            globalValue = this.get('content.serviceConfigProperties').findProperty('name',
config.foreignKey[index]).value;
-          }
+        } else if (this.get('globalProperties').someProperty('name', config.foreignKey[index]))
{
+            globalValue = this.get('globalProperties').findProperty('name', config.foreignKey[index]).value;
           config._name = config.name.replace(_fkValue, globalValue);
         }
       }, this);
@@ -312,9 +279,9 @@ App.MainAdminSecurityAddStep3Controller 
     if (templateValue) {
       templateValue.forEach(function (_value) {
         var index = parseInt(_value.match(/\[([\d]*)(?=\])/)[1]);
-        if (this.get('globalProperties').someProperty('name', config.templateName[index]))
{
-          var globValue = this.appendInstanceName(config.templateName[index]);
-          config.value = config.value.replace(_value, globValue);
+        var globValue = this.get('globalProperties').findProperty('name', config.templateName[index]);
+        if (globValue) {
+          config.value = config.value.replace(_value, globValue.value);
         } else {
           config.value = null;
         }
@@ -335,6 +302,7 @@ App.MainAdminSecurityAddStep3Controller 
     this.loadStaticGlobal(); //Hack for properties which are declared in config_properties.js
and not able to retrieve values declared in secure_properties.js
     this.loadUsersToGlobal();
     this.loadHostNamesToGlobal();
+    this.loadPrimaryNamesToGlobals();
   },
 
   loadUsersToGlobal: function () {
@@ -382,6 +350,25 @@ App.MainAdminSecurityAddStep3Controller 
     }, this);
   },
 
+  loadPrimaryNamesToGlobals: function () {
+    var principalProperties = this.getPrincipalNames();
+    principalProperties.forEach(function (_principalProperty) {
+      var name = _principalProperty.name.replace('principal', 'primary');
+      var value =  _principalProperty.value.split('/')[0];
+      this.get('globalProperties').pushObject({name:name,value:value});
+    }, this);
+  },
+
+  getPrincipalNames: function () {
+    var principalNames = [];
+    this.get('globalProperties').forEach(function (_globalProperty) {
+      if (/principal_name?$/.test(_globalProperty.name)) {
+        principalNames.pushObject(_globalProperty);
+      }
+    }, this);
+    return principalNames;
+  },
+
   loadUsersFromServer: function () {
     if (App.testMode) {
       var serviceUsers = this.get('serviceUsers');
@@ -394,6 +381,7 @@ App.MainAdminSecurityAddStep3Controller 
     }
   },
 
+
   loadClusterConfigs: function () {
     var self = this;
     var url = App.apiPrefix + '/clusters/' + App.router.getClusterName();
@@ -519,9 +507,14 @@ App.MainAdminSecurityAddStep3Controller 
   },
 
   addSecureConfigs: function () {
-    this.get('serviceConfigTags').forEach(function (_serviceConfigTags, index) {
+    this.get('serviceConfigTags').forEach(function (_serviceConfigTags) {
       _serviceConfigTags.newTagName = 'version' + (new Date).getTime();
       if (_serviceConfigTags.siteName === 'global') {
+        var nagiosPrincipalName = this.get('globalProperties').findProperty('name','nagios_principal_name');
+        var zkPrincipalName = this.get('globalProperties').findProperty('name','zookeeper_principal_name');
+        var realmName = this.get('globalProperties').findProperty('name','kerberos_domain');
+        nagiosPrincipalName.value = nagiosPrincipalName.value + '@' + realmName.value;
+        zkPrincipalName.value = zkPrincipalName.value + '@' + realmName.value;
         this.get('globalProperties').forEach(function (_globalProperty) {
           _serviceConfigTags.configs[_globalProperty.name] = _globalProperty.value;
         }, this);

Modified: incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_configs.js?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_configs.js (original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_configs.js Mon Jun 24
20:00:14 2013
@@ -96,6 +96,14 @@ module.exports = [
     ],
     sites: ['oozie-site'],
     configs: configProperties.filterProperty('serviceName', 'OOZIE')
+  },
+  {
+    serviceName: 'NAGIOS',
+    displayName: 'Nagios',
+    configCategories: [
+      App.ServiceConfigCategory.create({ name: 'Nagios Server', displayName:  'Nagios Server'})
+    ],
+    configs: configProperties.filterProperty('serviceName', 'NAGIOS')
   }
 
 ];

Modified: incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_mapping.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_mapping.js?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_mapping.js (original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_mapping.js Mon Jun 24
20:00:14 2013
@@ -41,7 +41,7 @@ module.exports = [
   },
   {
     "name": "dfs.namenode.kerberos.principal",
-    "templateName": ["namenode_primary_name", "kerberos_domain"],
+    "templateName": ["namenode_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hdfs-site.xml"
@@ -55,7 +55,7 @@ module.exports = [
   },
   {
     "name": "dfs.secondary.namenode.kerberos.principal",
-    "templateName": ["namenode_primary_name", "kerberos_domain"],
+    "templateName": ["namenode_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hdfs-site.xml"
@@ -69,7 +69,7 @@ module.exports = [
   },
   {
     "name": "dfs.web.authentication.kerberos.principal",
-    "templateName": ["hadoop_http_primary_name", "kerberos_domain"],
+    "templateName": ["hadoop_http_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hdfs-site.xml"
@@ -83,7 +83,7 @@ module.exports = [
   },
   {
     "name": "dfs.datanode.kerberos.principal",
-    "templateName": ["datanode_primary_name", "kerberos_domain"],
+    "templateName": ["datanode_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hdfs-site.xml"
@@ -125,7 +125,7 @@ module.exports = [
   },
   {
     "name": "mapreduce.jobtracker.kerberos.principal",
-    "templateName": ["jobtracker_primary_name", "kerberos_domain"],
+    "templateName": ["jobtracker_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "mapred-site.xml"
@@ -139,7 +139,7 @@ module.exports = [
   },
   {
     "name": "mapreduce.tasktracker.kerberos.principal",
-    "templateName": ["tasktracker_primary_name", "kerberos_domain"],
+    "templateName": ["tasktracker_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "mapred-site.xml"
@@ -153,7 +153,7 @@ module.exports = [
   },
   {
     "name": "hbase.master.kerberos.principal",
-    "templateName": ["hbase_primary_name", "kerberos_domain"],
+    "templateName": ["hbase_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hbase-site.xml"
@@ -167,7 +167,7 @@ module.exports = [
   },
   {
     "name": "hbase.regionserver.kerberos.principal",
-    "templateName": ["hbase_primary_name", "kerberos_domain"],
+    "templateName": ["hbase_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hbase-site.xml"
@@ -195,7 +195,7 @@ module.exports = [
   },
   {
     "name": "hive.metastore.kerberos.principal",
-    "templateName": ["hive_metastore_primary_name", "kerberos_domain"],
+    "templateName": ["hive_metastore_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hive-site.xml"
@@ -209,7 +209,7 @@ module.exports = [
   },
   {
     "name": "hive.server2.authentication.kerberos.principal",
-    "templateName": ["hive_metastore_primary_name", "kerberos_domain"],
+    "templateName": ["hive_metastore_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "hive-site.xml"
@@ -251,7 +251,7 @@ module.exports = [
   },
   {
     "name": "oozie.service.HadoopAccessorService.kerberos.principal",
-    "templateName": ["oozie_primary_name", "kerberos_domain"],
+    "templateName": ["oozie_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "oozie-site.xml"
@@ -265,7 +265,7 @@ module.exports = [
   },
   {
     "name": "oozie.authentication.kerberos.principal",
-    "templateName": ["hadoop_http_primary_name", "kerberos_domain"],
+    "templateName": ["oozie_http_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "oozie-site.xml"
@@ -286,7 +286,7 @@ module.exports = [
   },
   {
     "name": "templeton.kerberos.principal",
-    "templateName": ["hadoop_http_primary_name", "kerberos_domain"],
+    "templateName": ["webHCat_http_principal_name", "kerberos_domain"],
     "foreignKey": null,
     "value": "<templateName[0]>@<templateName[1]>",
     "filename": "webhcat-site.xml"

Modified: incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_properties.js?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_properties.js (original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-web/app/data/secure_properties.js Mon Jun
24 20:00:14 2013
@@ -32,19 +32,6 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "kinit_path_local",
-      "displayName": "Path to kinit",
-      "value": "",
-      "defaultValue": "/usr/bin/kinit",
-      "description": "Path to installed kinit command",
-      "displayType": "principal",
-      "isVisible": false,
-      "isOverridable": false,
-      "serviceName": "GENERAL",
-      "category": "KERBEROS"
-    },
-    {
-      "id": "puppet var",
       "name": "kerberos_install_type",
       "displayName": "Type of security",
       "value": "",
@@ -83,26 +70,25 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "instance_name",
-      "displayName": "Use Instance name",
+      "name": "kinit_path_local",
+      "displayName": "kinit path",
       "value": "",
-      "defaultValue": true,
-      "description": "Whether to use instance name for creating principals across cluster",
-      "displayType": "checkbox",
-      "isVisible": false,
+      "defaultValue": "/usr/bin/kinit",
+      "description": "Path to installed kinit command",
+      "displayType": "advanced",
+      "isVisible": true,
       "isOverridable": false,
       "serviceName": "GENERAL",
       "category": "KERBEROS"
     },
     {
       "id": "puppet var",
-      "name": "hadoop_http_primary_name",
-      "displayName": "HTTP Primary name",
+      "name": "hadoop_http_principal_name",
+      "displayName": "DFS Web Principal name",
       "value": "",
-      "defaultValue": "HTTP",
-      "isReconfigurable": false,
-      "description": "Primary name for spnego access for NameNode, SNameNode, Oozie and WebHCat",
-      "displayType": "principal",
+      "defaultValue": "HTTP/_HOST",
+      "description": "Principal name for spnego access for NameNode and SNameNode. _HOST
will get automatically replaced with actual hostname at instance of NameNode and SNameNode",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "GENERAL",
@@ -110,11 +96,37 @@ module.exports =
     },
     {
       "id": "puppet var",
+      "name": "oozie_http_principal_name",
+      "displayName": "Oozie Web Principal name",
+      "value": "",
+      "defaultValue": "HTTP/_HOST",
+      "description": "Principal name for spnego access for Oozie",
+      "displayType": "advanced",
+      "isVisible": false,
+      "isOverridable": false,
+      "serviceName": "GENERAL",
+      "category": "KERBEROS"
+    },
+    {
+      "id": "puppet var",
+      "name": "webHCat_http_principal_name",
+      "displayName": "WebHCat Principal name",
+      "value": "",
+      "defaultValue": "HTTP/_HOST",
+      "description": "Principal name for spnego access for WebHCat",
+      "displayType": "advanced",
+      "isVisible": false,
+      "isOverridable": false,
+      "serviceName": "GENERAL",
+      "category": "KERBEROS"
+    },
+    {
+      "id": "puppet var",
       "name": "hadoop_http_keytab",
-      "displayName": "Path to HTTP keytab file",
+      "displayName": "Path to spnego keytab file",
       "value": "",
       "defaultValue": "/etc/security/keytabs/spnego.service.keytab",
-      "description": "Path to HTTP keytab file for NameNode, SNameNode, Oozie and WebHCat",
+      "description": "Path to spnego keytab file for NameNode, SNameNode, Oozie and WebHCat",
       "displayType": "directory",
       "isVisible": true,
       "isOverridable": false,
@@ -138,12 +150,12 @@ module.exports =
     //HDFS
     {
       "id": "puppet var",
-      "name": "namenode_primary_name",
-      "displayName": "Primary name",
+      "name": "namenode_principal_name",
+      "displayName": "Principal name",
       "value": "",
-      "defaultValue": "nn",
-      "description": "Primary name for NameNode and SNameNode",
-      "displayType": "principal",
+      "defaultValue": "nn/_HOST",
+      "description": "Principal name for NameNode and SNameNode. _HOST will get automatically
replaced with actual hostname at instance of NameNode and SNameNode",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "HDFS",
@@ -190,12 +202,12 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "datanode_primary_name",
-      "displayName": "Primary name",
+      "name": "datanode_principal_name",
+      "displayName": "Principal name",
       "value": "",
-      "defaultValue": "dn",
-      "description": "Primary name for DataNode",
-      "displayType": "principal",
+      "defaultValue": "dn/_HOST",
+      "description": "Principal name for DataNode. _HOST will get automatically replaced
with actual hostname at every instance of DataNode",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "HDFS",
@@ -217,12 +229,12 @@ module.exports =
     //MAPREDUCE
     {
       "id": "puppet var",
-      "name": "jobtracker_primary_name",
-      "displayName": "Primary name",
+      "name": "jobtracker_principal_name",
+      "displayName": "Principal name",
       "value": "",
-      "defaultValue": "jt",
-      "description": "Primary name for JobTracker",
-      "displayType": "principal",
+      "defaultValue": "jt/_HOST",
+      "description": "Principal name for JobTracker. _HOST will get automatically replaced
with actual hostname at an instance of JobTracker",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "MAPREDUCE",
@@ -243,12 +255,12 @@ module.exports =
     },
     {
       "id": "puppet var",
-      "name": "tasktracker_primary_name",
-      "displayName": "Primary name",
+      "name": "tasktracker_principal_name",
+      "displayName": "Principal name",
       "value": "",
-      "defaultValue": "tt",
-      "description": "Primary name for TaskTracker",
-      "displayType": "principal",
+      "defaultValue": "tt/_HOST",
+      "description": "Principal name for TaskTracker. _HOST will get automatically replaced
with actual hostname at every instance of TaskTracker",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "MAPREDUCE",
@@ -271,12 +283,12 @@ module.exports =
     //HBASE
     {
       "id": "puppet var",
-      "name": "hbase_primary_name",
-      "displayName": "Primary name",
+      "name": "hbase_principal_name",
+      "displayName": "Principal name",
       "value": "",
-      "defaultValue": "hbase",
-      "description": "Primary name for HBase master and RegionServer",
-      "displayType": "principal",
+      "defaultValue": "hbase/_HOST",
+      "description": "Principal name for HBase master and RegionServer. _HOST will get automatically
replaced with actual hostname at every instance of HBase master and RegionServer",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "HBASE",
@@ -299,12 +311,25 @@ module.exports =
     //HIVE
     {
       "id": "puppet var",
-      "name": "hive_metastore_primary_name",
-      "displayName": "Primary name",
+      "name": "hive_metastore",
+      "displayName": "Hive Metastore host",
       "value": "",
-      "defaultValue": "hive",
-      "description": "Primary name for Hive Metastore",
-      "displayType": "principal",
+      "defaultValue": "localhost",
+      "description": "The host that has been assigned to run Hive Metastore",
+      "displayType": "masterHost",
+      "isVisible": true,
+      "isOverridable": false,
+      "serviceName": "HIVE",
+      "category": "Hive Metastore"
+    },
+    {
+      "id": "puppet var",
+      "name": "hive_metastore_principal_name",
+      "displayName": "Principal name",
+      "value": "",
+      "defaultValue": "hive/_HOST",
+      "description": "Principal name for Hive Metastore. _HOST will get automatically replaced
with actual hostname at an instance of Hive Metastore",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "HIVE",
@@ -328,12 +353,25 @@ module.exports =
     //OOZIE
     {
       "id": "puppet var",
-      "name": "oozie_primary_name",
-      "displayName": "Primary name",
+      "name": "oozie_servername",
+      "displayName": "Oozie Server host",
       "value": "",
-      "defaultValue": "oozie",
-      "description": "Primary name for Oozie server",
-      "displayType": "principal",
+      "defaultValue": "localhost",
+      "description": "Oozie server host name",
+      "displayType": "masterHost",
+      "isVisible": true,
+      "isOverridable": false,
+      "serviceName": "OOZIE",
+      "category": "Oozie Server"
+    },
+    {
+      "id": "puppet var",
+      "name": "oozie_principal_name",
+      "displayName": "Principal name",
+      "value": "",
+      "defaultValue": "oozie/_HOST",
+      "description": "Principal name for Oozie server",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "OOZIE",
@@ -353,74 +391,72 @@ module.exports =
       "category": "Oozie Server"
     },
 
-    //NAGIOS
+    //ZooKeeper
     {
       "id": "puppet var",
-      "name": "nagios_server_name",
-      "displayName": "Nagios server host",
+      "name": "zookeeper_principal_name",
+      "displayName": "Principal name",
       "value": "",
-      "defaultValue": "",
-      "description": "Nagios server host",
-      "displayType": "masterHosts",
+      "defaultValue": "zookeeper/_HOST",
+      "description": "Principal name for ZooKeeper. _HOST will get automatically replaced
with actual hostname at every instance of zookeeper server",
+      "displayType": "advanced",
       "isVisible": true,
       "isOverridable": false,
-      "serviceName": "NAGIOS",
-      "category": "General"
+      "serviceName": "ZOOKEEPER",
+      "category": "ZooKeeper Server"
     },
     {
       "id": "puppet var",
-      "name": "nagios_primary_name",
-      "displayName": "Primary name",
+      "name": "zookeeper_keytab_path",
+      "displayName": "Path to keytab file",
       "value": "",
-      "defaultValue": "nagios",
-      "description": "Primary name for Nagios server",
-      "displayType": "principal",
+      "defaultValue": "/etc/security/keytabs/zk.service.keytab",
+      "description": "Path to ZooKeeper keytab file",
+      "displayType": "directory",
       "isVisible": true,
       "isOverridable": false,
-      "serviceName": "NAGIOS",
-      "category": "General"
+      "serviceName": "ZOOKEEPER",
+      "category": "ZooKeeper Server"
     },
+    //NAGIOS
     {
       "id": "puppet var",
-      "name": "nagios_keytab",
-      "displayName": " Path to keytab file",
+      "name": "nagios_server",
+      "displayName": "Nagios Server host",
       "value": "",
-      "defaultValue": "/etc/security/keytabs",
-      "description": "Path to the directory that contains nagios keytab",
-      "displayType": "directory",
+      "defaultValue": "localhost",
+      "description": "Nagios server host",
+      "displayType": "masterHost",
       "isVisible": true,
       "isOverridable": false,
       "serviceName": "NAGIOS",
-      "category": "General"
+      "category": "Nagios Server"
     },
-
-    //ZooKeeper
     {
       "id": "puppet var",
-      "name": "zookeeper_primary_name",
-      "displayName": "Primary name",
+      "name": "nagios_principal_name",
+      "displayName": "Principal name",
       "value": "",
-      "defaultValue": "zookeeper",
-      "description": "Primary name for ZooKeeper",
-      "displayType": "principal",
+      "defaultValue": "nagios",
+      "description": "Primary name for Nagios server",
+      "displayType": "advanced",
       "isVisible": true,
-      "isReconfigurable": false,
       "isOverridable": false,
-      "serviceName": "ZOOKEEPER",
-      "category": "ZooKeeper Server"
+      "serviceName": "NAGIOS",
+      "category": "Nagios Server"
     },
     {
       "id": "puppet var",
-      "name": "zookeeper_keytab_path",
-      "displayName": "Path to keytab file",
+      "name": "nagios_keytab_path",
+      "displayName": " Path to keytab file",
       "value": "",
-      "defaultValue": "/etc/security/keytabs/zk.service.keytab",
-      "description": "Path to ZooKeeper keytab file",
+      "defaultValue": "/etc/security/keytabs/nagios.service.keytab",
+      "description": "Path to the Nagios server keytab file",
       "displayType": "directory",
       "isVisible": true,
       "isOverridable": false,
-      "serviceName": "ZOOKEEPER",
-      "category": "ZooKeeper Server"
+      "serviceName": "NAGIOS",
+      "category": "Nagios Server"
     }
 
   ]

Modified: incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/main/admin/security/add/step2.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/main/admin/security/add/step2.js?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/main/admin/security/add/step2.js
(original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/main/admin/security/add/step2.js
Mon Jun 24 20:00:14 2013
@@ -20,6 +20,31 @@ var App = require('app');
 
 App.MainAdminSecurityAddStep2View = Em.View.extend({
 
-  templateName: require('templates/main/admin/security/add/step2')
+  templateName: require('templates/main/admin/security/add/step2'),
+
+  configProperties: function () {
+    var configProperties = [];
+    var stepConfigs = this.get('controller.stepConfigs');
+    if (stepConfigs) {
+      this.get('controller.stepConfigs').mapProperty('configs').forEach(function (_stepProperties)
{
+        _stepProperties.forEach(function (_stepConfigProperty) {
+          configProperties.pushObject(_stepConfigProperty);
+        }, this);
+      }, this);
+    }
+    return configProperties;
+  }.property('controller.stepConfigs.@each.configs'),
+
+  realmName: function () {
+    return this.get('configProperties').findProperty('name', 'kerberos_domain');
+  }.property('configProperties'),
+
+  onRealmNameChange: function () {
+    this.get('configProperties').forEach(function (_globalProperty) {
+      if (/principal_name?$/.test(_globalProperty.get('name'))) {
+        _globalProperty.set('unit', '@' + this.get('realmName.value'));
+      }
+    }, this);
+  }.observes('realmName.value')
 
 });

Modified: incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/wizard/controls_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/wizard/controls_view.js?rev=1496186&r1=1496185&r2=1496186&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/wizard/controls_view.js (original)
+++ incubator/ambari/branches/branch-1.2.5/ambari-web/app/views/wizard/controls_view.js Mon
Jun 24 20:00:14 2013
@@ -69,9 +69,7 @@ App.ServiceConfigTextField = Ember.TextF
 
   textFieldClassName: function () {
     // sets the width of the field depending on display type
-    if (['directory', 'url', 'email', 'user', 'host'].contains(this.get('serviceConfig.displayType')))
{
-      return ['span6'];
-    } else if (this.get('serviceConfig.displayType') === 'advanced') {
+    if (['directory', 'url', 'email', 'user', 'host','advanced'].contains(this.get('serviceConfig.displayType')))
{
       return ['span6'];
     } else {
       return ['input-small'];



Mime
View raw message