Sfoglia il codice sorgente

AMBARI-10322 [WinTP2] Agent Automatic Bootstrap: Ambari Web UI changes

Enabled automatic host bootstrap in WIndows. No SSH key necessary, hence only the radio butto with appropriate message needs to be visible.
Florian Barca 10 anni fa
parent
commit
fb92ad29fe

+ 1 - 1
ambari-server/src/main/windows/ambari-server.cmd

@@ -1,2 +1,2 @@
 @echo off
 @echo off
-powershell -File ambari-server.ps1 %*
+powershell -ExecutionPolicy unrestricted -File ambari-server.ps1 %*

+ 2 - 2
ambari-web/app/controllers/wizard.js

@@ -534,8 +534,8 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
 
 
   installWindowsOptionsTemplate: {
   installWindowsOptionsTemplate: {
     hostNames: "", //string
     hostNames: "", //string
-    manualInstall: true, //true, false
-    useSsh: false, //bool
+    manualInstall: false, //true, false
+    useSsh: true, //bool
     javaHome: App.defaultJavaHome, //string
     javaHome: App.defaultJavaHome, //string
     localRepo: false, //true, false
     localRepo: false, //true, false
     sshKey: "", //string
     sshKey: "", //string

+ 6 - 6
ambari-web/app/controllers/wizard/step2_controller.js

@@ -121,7 +121,7 @@ App.WizardStep2Controller = Em.Controller.extend({
    */
    */
   hostsError: null,
   hostsError: null,
 
 
-  isSSHRegistrationEnabled: function () {
+  useSSH: function () {
     return !App.get('isHadoopWindowsStack');
     return !App.get('isHadoopWindowsStack');
   }.property('App.isHadoopWindowsStack'),
   }.property('App.isHadoopWindowsStack'),
 
 
@@ -130,22 +130,22 @@ App.WizardStep2Controller = Em.Controller.extend({
    * @type {string|null}
    * @type {string|null}
    */
    */
   sshKeyError: function () {
   sshKeyError: function () {
-    if (this.get('hasSubmitted') && this.get('manualInstall') === false && Em.isEmpty(this.get('sshKey').trim())) {
+    if (this.get('hasSubmitted') && this.get('manualInstall') === false && this.get('useSSH') && Em.isEmpty(this.get('sshKey').trim())) {
       return Em.I18n.t('installer.step2.sshKey.error.required');
       return Em.I18n.t('installer.step2.sshKey.error.required');
     }
     }
     return null;
     return null;
-  }.property('sshKey', 'manualInstall', 'hasSubmitted'),
+  }.property('sshKey', 'useSSH', 'manualInstall', 'hasSubmitted'),
 
 
   /**
   /**
    * Error-message if <code>sshUser</code> is empty, null otherwise
    * Error-message if <code>sshUser</code> is empty, null otherwise
    * @type {string|null}
    * @type {string|null}
    */
    */
   sshUserError: function () {
   sshUserError: function () {
-    if (this.get('manualInstall') === false && Em.isEmpty(this.get('sshUser').trim())) {
+    if (this.get('manualInstall') === false && this.get('useSSH') && Em.isEmpty(this.get('sshUser').trim())) {
       return Em.I18n.t('installer.step2.sshUser.required');
       return Em.I18n.t('installer.step2.sshUser.required');
     }
     }
     return null;
     return null;
-  }.property('sshUser', 'hasSubmitted', 'manualInstall'),
+  }.property('sshUser', 'useSSH', 'hasSubmitted', 'manualInstall'),
 
 
   /**
   /**
    * Error-message if <code>agentUser</code> is empty, null otherwise
    * Error-message if <code>agentUser</code> is empty, null otherwise
@@ -469,7 +469,7 @@ App.WizardStep2Controller = Em.Controller.extend({
    * @method manualInstallWarningPopup
    * @method manualInstallWarningPopup
    */
    */
   manualInstallWarningPopup: function () {
   manualInstallWarningPopup: function () {
-    if (this.get('isSSHRegistrationEnabled') && !this.get('content.installOptions.useSsh')) {
+    if (!this.get('content.installOptions.useSsh')) {
       App.ModalPopup.show({
       App.ModalPopup.show({
         header: Em.I18n.t('common.warning'),
         header: Em.I18n.t('common.warning'),
         body: Em.I18n.t('installer.step2.manualInstall.info'),
         body: Em.I18n.t('installer.step2.manualInstall.info'),

+ 6 - 2
ambari-web/app/messages.js

@@ -507,14 +507,18 @@ Em.I18n.translations = {
   'installer.step2.javaHome.tooltip.title' : 'JAVA_HOME',
   'installer.step2.javaHome.tooltip.title' : 'JAVA_HOME',
   'installer.step2.javaHome.tooltip.content' : 'Path to 64-bit JAVA_HOME. /usr/jdk/jdk1.6.0_31 is the default used by Ambari. You can override this to a specific path that contains the JDK. <br/> Note: the path must be valid on <b>ALL</b> hosts in your cluster.',
   'installer.step2.javaHome.tooltip.content' : 'Path to 64-bit JAVA_HOME. /usr/jdk/jdk1.6.0_31 is the default used by Ambari. You can override this to a specific path that contains the JDK. <br/> Note: the path must be valid on <b>ALL</b> hosts in your cluster.',
   'installer.step2.javaHome.tooltip.placeholder' : '/usr/jdk/jdk1.6.0_31',
   'installer.step2.javaHome.tooltip.placeholder' : '/usr/jdk/jdk1.6.0_31',
+  'installer.step2.automaticInstall.tooltip.title':'automatic registration',
+  'installer.step2.automaticInstall.tooltip.content':'Ambari will automatically install and register the Ambari Agent on each host prior to the cluster installation.',
   'installer.step2.useSsh.provide' : 'Provide your',
   'installer.step2.useSsh.provide' : 'Provide your',
   'installer.step2.useSsh.provide_id_rsa' : ' to automatically register hosts',
   'installer.step2.useSsh.provide_id_rsa' : ' to automatically register hosts',
   'installer.step2.useSsh.tooltip.title':'SSH Private Key',
   'installer.step2.useSsh.tooltip.title':'SSH Private Key',
   'installer.step2.useSsh.tooltip.content':'The <b>SSH Private Key File</b> is used to connect to the target hosts in your cluster to install the Ambari Agent.',
   'installer.step2.useSsh.tooltip.content':'The <b>SSH Private Key File</b> is used to connect to the target hosts in your cluster to install the Ambari Agent.',
-  'installer.step2.manualInstall.perform':'Perform',
-  'installer.step2.manualInstall.perform_on_hosts':'on hosts and do not use SSH',
+  'installer.step2.install.perform':'Perform',
+  'installer.step2.install.perform_on_hosts':'on hosts',
+  'installer.step2.install.without_ssh':' and do not use SSH',
   'installer.step2.manualInstall.tooltip.title':'manual registration',
   'installer.step2.manualInstall.tooltip.title':'manual registration',
   'installer.step2.manualInstall.tooltip.content':'Manually registering the Ambari Agent on each host eliminates the need for SSH and should be performed prior to continuing cluster installation.',
   'installer.step2.manualInstall.tooltip.content':'Manually registering the Ambari Agent on each host eliminates the need for SSH and should be performed prior to continuing cluster installation.',
+  'installer.step2.manualInstall.tooltip.content_no_ssh':'Manually registering the Ambari Agent on each host should be performed prior to continuing cluster installation.',
   'installer.step2.manualInstall.popup.header':'Before You Proceed',
   'installer.step2.manualInstall.popup.header':'Before You Proceed',
   'installer.step2.manualInstall.popup.body':'You must install Ambari Agents on each host you want to manage before you proceed.',
   'installer.step2.manualInstall.popup.body':'You must install Ambari Agents on each host you want to manage before you proceed.',
   'installer.step2.warning.popup.body':'<p>The following hostnames are not valid FQDNs:</p><p> {0} </p><p>This may cause problems during installation. Do you want to continue?</p>',
   'installer.step2.warning.popup.body':'<p>The following hostnames are not valid FQDNs:</p><p> {0} </p><p>This may cause problems during installation. Do you want to continue?</p>',

+ 29 - 10
ambari-web/app/templates/wizard/step2.hbs

@@ -47,17 +47,26 @@
     <div class="ambari-agents">
     <div class="ambari-agents">
       <h5>{{t installer.step2.sshKey}}</h5>
       <h5>{{t installer.step2.sshKey}}</h5>
 
 
-      {{#if isSSHRegistrationEnabled}}
-        <label class="radio">
-          {{view view.providingSSHKeyRadioButton}}
+      <label class="radio">
+        {{view view.providingSSHKeyRadioButton}}
+        {{#if useSSH}}
           {{t installer.step2.useSsh.provide}}
           {{t installer.step2.useSsh.provide}}
           <a href="javascript:void(null)"
           <a href="javascript:void(null)"
              rel="popover"
              rel="popover"
             {{translateAttr title="installer.step2.useSsh.tooltip.title" data-content="installer.step2.useSsh.tooltip.content"}}>
             {{translateAttr title="installer.step2.useSsh.tooltip.title" data-content="installer.step2.useSsh.tooltip.content"}}>
             {{t installer.step2.useSsh.tooltip.title}}</a>
             {{t installer.step2.useSsh.tooltip.title}}</a>
           {{t installer.step2.useSsh.provide_id_rsa}}
           {{t installer.step2.useSsh.provide_id_rsa}}
-        </label>
+        {{else}}
+          {{t installer.step2.install.perform}}
+          <a href="javascript:void(null)"
+             rel="popover"
+            {{translateAttr title="installer.step2.automaticInstall.tooltip.title" data-content="installer.step2.automaticInstall.tooltip.content"}}>
+            {{t installer.step2.automaticInstall.tooltip.title}}</a>
+          {{t installer.step2.install.perform_on_hosts}}
+        {{/if}}
+      </label>
 
 
+      {{#if useSSH}}
         <div class="ssh-key-input">
         <div class="ssh-key-input">
           {{#if view.isFileApi}}
           {{#if view.isFileApi}}
             {{view App.SshKeyFileUploader disabledBinding="view.sshKeyState"}}
             {{view App.SshKeyFileUploader disabledBinding="view.sshKeyState"}}
@@ -101,12 +110,22 @@
 
 
       <label class="radio">
       <label class="radio">
         {{view view.manualRegistrationRadioButton}}
         {{view view.manualRegistrationRadioButton}}
-        {{t installer.step2.manualInstall.perform}}
-        <a href="javascript:void(null)"
-           rel="popover"
-          {{translateAttr title="installer.step2.manualInstall.tooltip.title" data-content="installer.step2.manualInstall.tooltip.content"}}>
-          {{t installer.step2.manualInstall.tooltip.title}}</a>
-        {{t installer.step2.manualInstall.perform_on_hosts}}
+        {{t installer.step2.install.perform}}
+        {{#if useSSH}}
+          <a href="javascript:void(null)"
+             rel="popover"
+            {{translateAttr title="installer.step2.manualInstall.tooltip.title" data-content="installer.step2.manualInstall.tooltip.content"}}>
+            {{t installer.step2.manualInstall.tooltip.title}}</a>
+        {{else}}
+          <a href="javascript:void(null)"
+             rel="popover"
+            {{translateAttr title="installer.step2.manualInstall.tooltip.title" data-content="installer.step2.manualInstall.tooltip.content_no_ssh"}}>
+            {{t installer.step2.manualInstall.tooltip.title}}</a>
+        {{/if}}
+        {{t installer.step2.install.perform_on_hosts}}
+        {{#if useSSH}}
+          {{t installer.step2.install.without_ssh}}
+        {{/if}}
       </label>
       </label>
 
 
     </div>
     </div>