ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject [2/2] ambari git commit: Ambari-10386. Support skipping install operations on hosts that are already sys-prepped
Date Wed, 22 Apr 2015 03:28:38 GMT
Ambari-10386. Support skipping install operations on hosts that are already sys-prepped


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

Branch: refs/heads/trunk
Commit: 048c158400ae06185b09dbafffd487f9ff5cc8fd
Parents: 1a02c9c
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Tue Apr 21 18:26:14 2015 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Tue Apr 21 20:16:09 2015 -0700

----------------------------------------------------------------------
 .../core/providers/package/apt.py               |   4 +-
 .../core/providers/package/yumrpm.py            |   4 +-
 .../core/providers/package/zypper.py            |   4 +-
 .../dynamic_variable_interpretation.py          |   7 +-
 .../libraries/script/script.py                  |   6 +
 .../ambari/server/agent/ExecutionCommand.java   |   1 +
 .../server/configuration/Configuration.java     |  12 +
 .../AmbariCustomCommandExecutionHelper.java     |   2 +
 .../internal/ClientConfigResourceProvider.java  |   2 +
 .../internal/UpgradeResourceProvider.java       |   3 -
 .../1.6.1.2.2.0/package/scripts/params.py       |   2 +
 .../0.1.0/package/scripts/params.py             |   1 +
 .../FALCON/0.5.0.2.1/package/scripts/params.py  |   3 +
 .../FLUME/1.4.0.2.0/package/scripts/params.py   |   1 +
 .../1.4.0.2.0/package/scripts/params_linux.py   |   1 +
 .../HBASE/0.96.0.2.0/package/scripts/params.py  |   3 +
 .../HDFS/2.1.0.2.0/package/scripts/params.py    |   3 +
 .../HIVE/0.12.0.2.0/package/scripts/params.py   |   3 +
 .../KAFKA/0.8.1.2.2/package/scripts/params.py   |   1 +
 .../1.10.3-10/package/scripts/params.py         |   1 +
 .../KNOX/0.5.0.2.2/package/scripts/params.py    |   2 +
 .../MAHOUT/1.0.0.2.3/package/scripts/params.py  |   1 +
 .../OOZIE/4.0.0.2.0/package/scripts/params.py   |   3 +
 .../PIG/0.12.0.2.0/package/scripts/params.py    |   4 +
 .../RANGER/0.4.0/package/scripts/params.py      |   1 +
 .../SLIDER/0.60.0.2.2/package/scripts/params.py |   2 +
 .../SPARK/1.2.0.2.2/package/scripts/params.py   |   1 +
 .../SQOOP/1.4.4.2.0/package/scripts/params.py   |   4 +
 .../STORM/0.9.1.2.1/package/scripts/params.py   |   4 +
 .../TEZ/0.4.0.2.1/package/scripts/params.py     |   4 +
 .../YARN/2.1.0.2.0/package/scripts/params.py    |   4 +
 .../2.0.6/hooks/before-ANY/scripts/params.py    |   1 +
 .../before-ANY/scripts/shared_initialization.py |  52 +-
 .../hooks/before-INSTALL/scripts/params.py      |   1 +
 .../scripts/repo_initialization.py              |   3 +
 .../scripts/shared_initialization.py            |   3 +
 .../AmbariManagementControllerImplTest.java     |   7 +-
 .../ClientConfigResourceProviderTest.java       |   2 +
 .../python/stacks/2.0.6/HDFS/test_namenode.py   |  13 +
 .../stacks/2.0.6/HIVE/test_hive_server.py       |  36 +
 .../python/stacks/2.0.6/configs/default.json    |   4 +-
 .../2.0.6/configs/default_no_install.json       | 834 +++++++++++++++++++
 .../src/test/python/stacks/utils/RMFTestCase.py |  36 +-
 43 files changed, 1041 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
index ae271f0..76db791 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
@@ -101,7 +101,7 @@ class AptProvider(PackageProvider):
         Logger.info("Removing temporal sources directory: %s" % apt_sources_list_tmp_dir)
         os.rmdir(apt_sources_list_tmp_dir)
     else:
-      Logger.info("Skipping installing existent package %s" % (name))
+      Logger.info("Skipping installation of existing package %s" % (name))
 
   @replace_underscores
   def upgrade_package(self, name, use_repos=[]):
@@ -114,7 +114,7 @@ class AptProvider(PackageProvider):
       Logger.info("Removing package %s ('%s')" % (name, string_cmd_from_args_list(cmd)))
       shell.checked_call(cmd, sudo=True, logoutput=self.get_logoutput())
     else:
-      Logger.info("Skipping removing non-existent package %s" % (name))
+      Logger.info("Skipping removal of non-existing package %s" % (name))
 
   @replace_underscores
   def _check_existence(self, name):

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
index 7980de2..bfe7fa4 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/yumrpm.py
@@ -50,7 +50,7 @@ class YumProvider(PackageProvider):
       Logger.info("Installing package %s ('%s')" % (name, string_cmd_from_args_list(cmd)))
       shell.checked_call(cmd, sudo=True, logoutput=self.get_logoutput())
     else:
-      Logger.info("Skipping installing existent package %s" % (name))
+      Logger.info("Skipping installation of existing package %s" % (name))
 
   def upgrade_package(self, name, use_repos=[]):
     return self.install_package(name, use_repos)
@@ -61,7 +61,7 @@ class YumProvider(PackageProvider):
       Logger.info("Removing package %s ('%s')" % (name, string_cmd_from_args_list(cmd)))
       shell.checked_call(cmd, sudo=True, logoutput=self.get_logoutput())
     else:
-      Logger.info("Skipping removing non-existent package %s" % (name))
+      Logger.info("Skipping removal of non-existing package %s" % (name))
 
   def _check_existence(self, name):
     if '.' in name:  # To work with names like 'zookeeper_2_2_1_0_2072.noarch'

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
index bd21ed5..367d3cc 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/package/zypper.py
@@ -71,7 +71,7 @@ class ZypperProvider(PackageProvider):
       Logger.info("Installing package %s ('%s')" % (name, string_cmd_from_args_list(cmd)))
       shell.checked_call(cmd, sudo=True, logoutput=self.get_logoutput())
     else:
-      Logger.info("Skipping installing existent package %s" % (name))
+      Logger.info("Skipping installation of existing package %s" % (name))
 
   def upgrade_package(self, name, use_repos=[]):
     return self.install_package(name, use_repos)
@@ -82,7 +82,7 @@ class ZypperProvider(PackageProvider):
       Logger.info("Removing package %s ('%s')" % (name, string_cmd_from_args_list(cmd)))
       shell.checked_call(cmd, sudo=True, logoutput=self.get_logoutput())
     else:
-      Logger.info("Skipping removing non-existent package %s" % (name))
+      Logger.info("Skipping removal of non-existing package %s" % (name))
 
   def _check_existence(self, name):
     code, out = shell.call(CHECK_CMD % name)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-common/src/main/python/resource_management/libraries/functions/dynamic_variable_interpretation.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/dynamic_variable_interpretation.py b/ambari-common/src/main/python/resource_management/libraries/functions/dynamic_variable_interpretation.py
index 1e70219..31f0c4a 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/dynamic_variable_interpretation.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/dynamic_variable_interpretation.py
@@ -137,13 +137,14 @@ def _copy_files(source_and_dest_pairs, component_user, file_owner, group_owner,
   return return_value
 
 
-def copy_tarballs_to_hdfs(tarball_prefix, hdp_select_component_name, component_user, file_owner, group_owner):
+def copy_tarballs_to_hdfs(tarball_prefix, hdp_select_component_name, component_user, file_owner, group_owner, ignore_sysprep=False):
   """
   :param tarball_prefix: Prefix of the tarball must be one of tez, hive, mr, pig
   :param hdp_select_component_name: Component name to get the status to determine the version
   :param component_user: User that will execute the Hadoop commands, usually smokeuser
   :param file_owner: Owner of the files copied to HDFS (typically hdfs user)
   :param group_owner: Group owner of the files copied to HDFS (typically hadoop group)
+  :param ignore_sysprep: Ignore sysprep directives
   :return: Returns 0 on success, 1 if no files were copied, and in some cases may raise an exception.
 
   In order to call this function, params.py must have all of the following,
@@ -152,6 +153,10 @@ def copy_tarballs_to_hdfs(tarball_prefix, hdp_select_component_name, component_u
   """
   import params
 
+  if not ignore_sysprep and hasattr(params, "host_sys_prepped") and params.host_sys_prepped:
+    Logger.info("Host is sys-prepped. Tarball %s will not be copied for %s." % (tarball_prefix, hdp_select_component_name))
+    return 0
+
   if not hasattr(params, "hdp_stack_version") or params.hdp_stack_version is None:
     Logger.warning("Could not find hdp_stack_version")
     return 1

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-common/src/main/python/resource_management/libraries/script/script.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index 34dd16f..6ef4bb5 100644
--- a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -274,6 +274,12 @@ class Script(object):
     from this list
     """
     config = self.get_config()
+    if 'host_sys_prepped' in config['hostLevelParams']:
+      # do not install anything on sys-prepped host
+      if config['hostLevelParams']['host_sys_prepped'] == True:
+        Logger.info("Node has all packages pre-installed. Skipping.")
+        return
+      pass
     try:
       package_list_str = config['hostLevelParams']['package_list']
       if isinstance(package_list_str, basestring) and len(package_list_str) > 0:

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
index 7f588fe..6c254e8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/ExecutionCommand.java
@@ -306,6 +306,7 @@ public class ExecutionCommand extends AgentCommand {
     String GROUP_LIST = "group_list";
     String VERSION = "version";
     String REFRESH_TOPOLOGY = "refresh_topology";
+    String HOST_SYS_PREPPED = "host_sys_prepped";
     String COMMAND_RETRY_MAX_ATTEMPT_COUNT = "command_retry_max_attempt_count";
     String COMMAND_RETRY_ENABLED = "command_retry_enabled";
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index cd2bafd..bbeca38 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -294,6 +294,14 @@ public class Configuration {
   private static final String LDAP_BIND_ANONYMOUSLY_DEFAULT = "true";
 
   /**
+   * Indicator for sys prepped host
+   * It is possible the some nodes are sys prepped and some are not. This can be enabled later
+   * by agent over-writing global indicator from ambari-server
+   */
+  public static final String SYS_PREPPED_HOSTS_KEY = "packages.pre.installed";
+  public static final String SYS_PREPPED_HOSTS_DEFAULT = "false";
+
+  /**
    * !!! TODO: For embedded server only - should be removed later
    */
   private static final String LDAP_PRIMARY_URL_DEFAULT = "localhost:33389";
@@ -738,6 +746,10 @@ public class Configuration {
     return new File(fileName);
   }
 
+  public String areHostsSysPrepped(){
+    return properties.getProperty(SYS_PREPPED_HOSTS_KEY, SYS_PREPPED_HOSTS_DEFAULT);
+  }
+
   public String getStackAdvisorScript() {
     return properties.getProperty(STACK_ADVISOR_SCRIPT, STACK_ADVISOR_SCRIPT_DEFAULT);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index f585e28..d54a14d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -35,6 +35,7 @@ import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCAT
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_NAME;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.MYSQL_JDBC_URL;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.ORACLE_JDBC_URL;
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.REPO_INFO;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT_TYPE;
@@ -1096,6 +1097,7 @@ public class AmbariCustomCommandExecutionHelper {
     hostLevelParams.put(ORACLE_JDBC_URL, managementController.getOjdbcUrl());
     hostLevelParams.put(DB_DRIVER_FILENAME, configs.getMySQLJarName());
     hostLevelParams.putAll(managementController.getRcaParameters());
+    hostLevelParams.put(HOST_SYS_PREPPED, configs.areHostsSysPrepped());
     ClusterVersionEntity clusterVersionEntity = clusterVersionDAO.findByClusterAndStateCurrent(cluster.getClusterName());
     if (clusterVersionEntity == null) {
       List<ClusterVersionEntity> clusterVersionEntityList = clusterVersionDAO

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index 59cbc8e..2c43e1a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -87,6 +87,7 @@ import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SERVICE_R
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_NAME;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_VERSION;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.USER_LIST;
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
 
 /**
  * Resource provider for client config resources.
@@ -286,6 +287,7 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
       hostLevelParams.put(DB_NAME, managementController.getServerDB());
       hostLevelParams.put(MYSQL_JDBC_URL, managementController.getMysqljdbcUrl());
       hostLevelParams.put(ORACLE_JDBC_URL, managementController.getOjdbcUrl());
+      hostLevelParams.put(HOST_SYS_PREPPED, configs.areHostsSysPrepped());
       hostLevelParams.putAll(managementController.getRcaParameters());
       hostLevelParams.putAll(managementController.getRcaParameters());
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
index 483e169..172f291 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java
@@ -645,9 +645,6 @@ public class UpgradeResourceProvider extends AbstractControllerResourceProvider
     actionContext.setIgnoreMaintenance(true);
     actionContext.setTimeout(Short.valueOf(s_configuration.getDefaultAgentTaskTimeout(false)));
 
-    Map<String, String> hostLevelParams = new HashMap<String, String>();
-    hostLevelParams.put(JDK_LOCATION, getManagementController().getJdkResourceUrl());
-
     ExecuteCommandJson jsons = s_commandExecutionHelper.get().getCommandJson(
         actionContext, cluster);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
index 3abdc20..340f247 100644
--- a/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/ACCUMULO/1.6.1.2.2.0/package/scripts/params.py
@@ -117,6 +117,8 @@ if security_enabled:
 else:
   kinit_cmd = ""
 
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+
 #for create_hdfs_directory
 hostname = status_params.hostname
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index 3342d0d..7e516b8 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -84,6 +84,7 @@ java64_home = config['hostLevelParams']['java_home']
 java_version = int(config['hostLevelParams']['java_version'])
 
 metrics_collector_heapsize = default('/configurations/ams-env/metrics_collector_heapsize', "512m")
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 hbase_log_dir = config['configurations']['ams-hbase-env']['hbase_log_dir']
 master_heapsize = config['configurations']['ams-hbase-env']['hbase_master_heapsize']

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params.py
index 11a37a2..f2d01fc 100644
--- a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/package/scripts/params.py
@@ -18,8 +18,11 @@ limitations under the License.
 """
 from ambari_commons import OSCheck
 from status_params import *
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
index 889aa39..2bc2ff1 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params.py
@@ -30,6 +30,7 @@ else:
 config = Script.get_config()
 
 stack_name = default("/hostLevelParams/stack_name", None)
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 # New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
 version = default("/commandParams/version", None)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params_linux.py
index 51ecde0..b5bf203 100644
--- a/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/scripts/params_linux.py
@@ -26,6 +26,7 @@ from ambari_commons import OSCheck
 config = Script.get_config()
 
 flume_conf_dir = '/etc/flume/conf'
+
 flume_user = 'flume'
 flume_group = 'flume'
 if 'flume-env' in config['configurations'] and 'flume_user' in config['configurations']['flume-env']:

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py
index a10c1d4..36dd07f 100644
--- a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params.py
@@ -18,8 +18,11 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
index 37448ba..23f319e 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/params.py
@@ -17,8 +17,11 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
index a10c1d4..36f7983 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
@@ -18,8 +18,11 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
index 419639e..74c189e 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
@@ -30,6 +30,7 @@ config = Script.get_config()
 stack_name = default("/hostLevelParams/stack_name", None)
 
 version = default("/commandParams/version", None)
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
 hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
index fa5dd18..beb0479 100644
--- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
@@ -40,6 +40,7 @@ kadm5_acl_path = kadm5_acl_dir + '/' + kadm5_acl_file
 
 config = Script.get_config()
 tmp_dir = Script.get_tmp_dir()
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 configurations = None
 keytab_details = None

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
index ad96b53..a04842e 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/package/scripts/params.py
@@ -30,6 +30,8 @@ if OSCheck.is_windows_family():
 else:
   from params_linux import *
 
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+
 config = Script.get_config()
 tmp_dir = Script.get_tmp_dir()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
index b1670cd..b37a3a8 100644
--- a/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/MAHOUT/1.0.0.2.3/package/scripts/params.py
@@ -27,6 +27,7 @@ config = Script.get_config()
 tmp_dir = Script.get_tmp_dir()
 
 stack_name = default("/hostLevelParams/stack_name", None)
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
 hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
index a10c1d4..36dd07f 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/params.py
@@ -18,8 +18,11 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py
index 9e3148e..36541e7 100644
--- a/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/PIG/0.12.0.2.0/package/scripts/params.py
@@ -19,8 +19,12 @@ Ambari Agent
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
index 78d6eeb..e2b8ba8 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/params.py
@@ -27,6 +27,7 @@ tmp_dir = Script.get_tmp_dir()
 
 stack_name = default("/hostLevelParams/stack_name", None)
 version = default("/commandParams/version", None)
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
 hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
index 1ecbf30..aa60087 100644
--- a/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SLIDER/0.60.0.2.2/package/scripts/params.py
@@ -28,6 +28,8 @@ if OSCheck.is_windows_family():
 else:
   from params_linux import *
 
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+
 # server configurations
 config = Script.get_config()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
index c7bda3c..c521b65 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
@@ -30,6 +30,7 @@ tmp_dir = Script.get_tmp_dir()
 stack_name = default("/hostLevelParams/stack_name", None)
 stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
 hdp_stack_version = format_hdp_stack_version(stack_version_unformatted)
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 # New Cluster Stack Version that is defined during the RESTART of a Rolling Upgrade
 version = default("/commandParams/version", None)

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py
index f4931a5..beed137 100644
--- a/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py
@@ -18,8 +18,12 @@ limitations under the License.
 """
 
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params.py
index a10c1d4..1e591f4 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/scripts/params.py
@@ -18,8 +18,12 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params.py b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params.py
index a10c1d4..1e591f4 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params.py
@@ -18,8 +18,12 @@ limitations under the License.
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py
index 3071b74..5695e83 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params.py
@@ -20,8 +20,12 @@ Ambari Agent
 
 """
 from ambari_commons import OSCheck
+from resource_management.libraries.functions.default import default
 
 if OSCheck.is_windows_family():
   from params_windows import *
 else:
   from params_linux import *
+
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py
index 6ccc1f8..2262a20 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/params.py
@@ -180,5 +180,6 @@ user_to_gid_dict = collections.defaultdict(lambda:user_group)
 
 user_list = json.loads(config['hostLevelParams']['user_list'])
 group_list = json.loads(config['hostLevelParams']['group_list'])
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 tez_am_view_acls = config['configurations']['tez-site']["tez.am.view-acls"]

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
index 10ed36e..d4242f8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
@@ -62,20 +62,25 @@ def setup_users():
   Creates users before cluster installation
   """
   import params
-  
-  for group in params.group_list:
-    Group(group,
-        ignore_failures = params.ignore_groupsusers_create
-    )
-    
-  for user in params.user_list:
-    User(user,
-        gid = params.user_to_gid_dict[user],
-        groups = params.user_to_groups_dict[user],
-        ignore_failures = params.ignore_groupsusers_create       
-    )
-           
-  set_uid(params.smoke_user, params.smoke_user_dirs)
+
+  if not params.host_sys_prepped:
+    for group in params.group_list:
+      Group(group,
+          ignore_failures = params.ignore_groupsusers_create
+      )
+
+    for user in params.user_list:
+      User(user,
+          gid = params.user_to_gid_dict[user],
+          groups = params.user_to_groups_dict[user],
+          ignore_failures = params.ignore_groupsusers_create
+      )
+
+    set_uid(params.smoke_user, params.smoke_user_dirs)
+  else:
+    print 'Skipping creation of User and Group as host is sys prepped'
+    pass
+
 
   if params.has_hbase_masters:
     Directory (params.hbase_tmp_dir,
@@ -84,12 +89,19 @@ def setup_users():
                recursive = True,
                cd_access="a",
     )
-    set_uid(params.hbase_user, params.hbase_user_dirs)
-
-  if params.has_namenode:
-    create_dfs_cluster_admins()
-  if params.has_tez and params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.3') >= 0:
-      create_tez_am_view_acls()
+    if not params.host_sys_prepped:
+      set_uid(params.hbase_user, params.hbase_user_dirs)
+    else:
+      print 'Skipping setting uid for hbase user as host is sys prepped'
+      pass
+
+  if not params.host_sys_prepped:
+    if params.has_namenode:
+      create_dfs_cluster_admins()
+    if params.has_tez and params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.3') >= 0:
+        create_tez_am_view_acls()
+  else:
+    print 'Skipping setting dfs cluster admin and tez view acls as host is sys prepped'
 
 def create_dfs_cluster_admins():
   """

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py
index d951558..c8ac180 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/params.py
@@ -97,6 +97,7 @@ jce_policy_zip = default("/hostLevelParams/jce_name", None) # None when jdk is a
 jce_location = config['hostLevelParams']['jdk_location']
 jdk_location = config['hostLevelParams']['jdk_location']
 ignore_groupsusers_create = default("/configurations/cluster-env/ignore_groupsusers_create", False)
+host_sys_prepped = default("/hostLevelParams/host_sys_prepped", False)
 
 smoke_user_dirs = format("/tmp/hadoop-{smoke_user},/tmp/hsperfdata_{smoke_user},/home/{smoke_user},/tmp/{smoke_user},/tmp/sqoop-{smoke_user}")
 if has_hbase_masters:

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py
index f040bcc..32efb5c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/repo_initialization.py
@@ -52,6 +52,9 @@ def _alter_repo(action, repo_string, repo_template):
 
 def install_repos():
   import params
+  if params.host_sys_prepped:
+    return
+
   template = "repo_suse_rhel.j2" if OSCheck.is_suse_family() or OSCheck.is_redhat_family() else "repo_ubuntu.j2"
   _alter_repo("create", params.repo_info, template)
   if params.service_repo_info:

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py
index 28aa427..b58959a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-INSTALL/scripts/shared_initialization.py
@@ -76,6 +76,9 @@ def setup_java():
 
 def install_packages():
   import params
+  if params.host_sys_prepped:
+    return
+
   packages = ['unzip', 'curl']
   if params.hdp_stack_version != "" and compare_versions(params.hdp_stack_version, '2.2') >= 0:
     packages.append('hdp-select')

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
index b062001..5d84586 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java
@@ -76,6 +76,7 @@ import java.util.Map;
 import java.util.Set;
 
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_DRIVER_FILENAME;
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_VERSION;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_NAME;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_VERSION;
@@ -1809,6 +1810,7 @@ public class AmbariManagementControllerImplTest {
     expect(configuration.getOjdbcJarName()).andReturn(OJDBC_JAR_NAME);
     expect(configuration.getServerDBName()).andReturn(SERVER_DB_NAME);
     expect(configuration.getJavaVersion()).andReturn(8);
+    expect(configuration.areHostsSysPrepped()).andReturn("true");
     expect(clusterVersionDAO.findByClusterAndStateCurrent(clusterName)).andReturn(clusterVersionEntity).anyTimes();
     expect(clusterVersionEntity.getRepositoryVersion()).andReturn(repositoryVersionEntity).anyTimes();
     expect(repositoryVersionEntity.getVersion()).andReturn("1234").anyTimes();
@@ -1846,11 +1848,12 @@ public class AmbariManagementControllerImplTest {
 
     Map<String, String> defaultHostParams = helper.createDefaultHostParams(cluster);
 
-    assertEquals(defaultHostParams.size(), 12);
+    assertEquals(defaultHostParams.size(), 13);
     assertEquals(defaultHostParams.get(DB_DRIVER_FILENAME), MYSQL_JAR);
     assertEquals(defaultHostParams.get(STACK_NAME), SOME_STACK_NAME);
     assertEquals(defaultHostParams.get(STACK_VERSION), SOME_STACK_VERSION);
-    assertEquals(defaultHostParams.get(JAVA_VERSION), "8");
+    assertEquals("true", defaultHostParams.get(HOST_SYS_PREPPED));
+    assertEquals("8", defaultHostParams.get(JAVA_VERSION));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
index ceedc5e..e138196 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
@@ -240,6 +240,7 @@ public class ClientConfigResourceProviderTest {
     expect(configMap.get(Configuration.AMBARI_PYTHON_WRAP_KEY)).andReturn(Configuration.AMBARI_PYTHON_WRAP_DEFAULT);
     expect(configuration.getConfigsMap()).andReturn(returnConfigMap);
     expect(configuration.getJavaVersion()).andReturn(8);
+    expect(configuration.areHostsSysPrepped()).andReturn("false");
     expect(configuration.getExternalScriptTimeout()).andReturn(Integer.parseInt(Configuration.EXTERNAL_SCRIPT_TIMEOUT_DEFAULT));
     Map<String,String> props = new HashMap<String, String>();
     props.put(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY, "pass");
@@ -442,6 +443,7 @@ public class ClientConfigResourceProviderTest {
     expect(configuration.getConfigsMap()).andReturn(returnConfigMap);
     expect(configuration.getCommonServicesPath()).andReturn(commonServicesPath);
     expect(configuration.getJavaVersion()).andReturn(8);
+    expect(configuration.areHostsSysPrepped()).andReturn("false");
     expect(configuration.getExternalScriptTimeout()).andReturn(Integer.parseInt(Configuration.EXTERNAL_SCRIPT_TIMEOUT_DEFAULT));
     Map<String,String> props = new HashMap<String, String>();
     props.put(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY, "pass");

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index 2690ab0..228d820 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -135,6 +135,19 @@ class TestNamenode(RMFTestCase):
     self.assertNoMoreResources()
     pass
 
+  def test_install_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/namenode.py",
+                       classname = "NameNode",
+                       command = "install",
+                       config_file = "default_no_install.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES,
+                       try_install=True
+    )
+    self.assert_configure_default()
+    self.assertNoMoreResources()
+    pass
+
   def test_start_default(self):
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/namenode.py",
                        classname = "NameNode",

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index c52af05..ecba234 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -77,6 +77,42 @@ class TestHiveServer(RMFTestCase):
     self.assertTrue(socket_mock.called)
     self.assertTrue(s.close.called)
 
+  @patch.object(dynamic_variable_interpretation, "_get_tar_source_and_dest_folder")
+  @patch("socket.socket")
+  def test_start_default_no_copy(self, socket_mock, get_tar_mock):
+    s = socket_mock.return_value
+
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/hive_server.py",
+                       classname = "HiveServer",
+                       command = "start",
+                       config_file="default_no_install.json",
+                       hdp_stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+
+    get_tar_mock.return_value = ("a", "b")
+    self.assert_configure_default()
+
+    self.assertResourceCalled('Execute', 'hive --config /etc/hive/conf.server --service metatool -updateLocation hdfs://c6401.ambari.apache.org:8020 OK.',
+                              environment = {'PATH': '/bin:/usr/lib/hive/bin:/usr/bin'},
+                              user = 'hive',
+                              )
+    self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.log /var/run/hive/hive-server.pid /etc/hive/conf.server /var/log/hive',
+                              not_if = 'ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p `cat /var/run/hive/hive-server.pid` >/dev/null 2>&1',
+                              environment = {'HADOOP_HOME' : '/usr', 'JAVA_HOME':'/usr/jdk64/jdk1.7.0_45'},
+                              path = ["/bin:/usr/lib/hive/bin:/usr/bin"],
+                              user = 'hive'
+    )
+
+    self.assertResourceCalled('Execute', '/usr/jdk64/jdk1.7.0_45/bin/java -cp /usr/lib/ambari-agent/DBConnectionVerification.jar:/usr/lib/hive/lib//mysql-connector-java.jar org.apache.ambari.server.DBConnectionVerification \'jdbc:mysql://c6402.ambari.apache.org/hive?createDatabaseIfNotExist=true\' hive \'!`"\'"\'"\' 1\' com.mysql.jdbc.Driver',
+                              path=['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'], tries=5, try_sleep=10
+    )
+
+    self.assertNoMoreResources()
+    self.assertTrue(socket_mock.called)
+    self.assertTrue(s.close.called)
+    self.assertFalse(get_tar_mock.called)
+
   @patch("socket.socket")
   @patch.object(dynamic_variable_interpretation, "copy_tarballs_to_hdfs", new=MagicMock())
   def test_stop_default(self, socket_mock):

http://git-wip-us.apache.org/repos/asf/ambari/blob/048c1584/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
index fcaeed4..8ed0af1 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/default.json
@@ -476,7 +476,9 @@
         "ignore_groupsusers_create": "false",
         "smokeuser": "ambari-qa",
         "kerberos_domain": "EXAMPLE.COM",
-        "user_group": "hadoop"
+        "user_group": "hadoop",
+        "mapreduce_tar_destination_folder" : "hdfs:///hdp/apps/{{ hdp_stack_version }}/mapreduce/",
+        "mapreduce_tar_source" : "/usr/hdp/current/hadoop-client/mapreduce.tar.gz"
       },
 
       "hbase-env": {


Mime
View raw message