This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.7 by this push:
new ebc084e AMBARI-24622. Allow skipping package operations for LZO on
sysprepped hosts (#2374)
ebc084e is described below
commit ebc084e74cf10ba14ab7cae86864b988f87b50b5
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Sep 26 20:25:08 2018 +0200
AMBARI-24622. Allow skipping package operations for LZO on sysprepped hosts
(#2374)
---
.../resource_management/libraries/functions/lzo_utils.py | 11 +++++++++++
.../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml | 11 +++++++++++
2 files changed, 22 insertions(+)
diff --git
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
index 4ba7ef3..7d7046c 100644
---
a/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
+++
b/ambari-common/src/main/python/resource_management/libraries/functions/lzo_utils.py
@@ -74,6 +74,13 @@ def should_install_lzo():
return True
+def skip_package_operations():
+ """
+ Return true if LZO packages are assumed to be pre-installed
+ Needs to be separate from should_install_lzo, as that one is used during
tarball creation, too
+ """
+ return default("/ambariLevelParams/host_sys_prepped", False) and
default("/configurations/cluster-env/sysprep_skip_lzo_package_operations",
False)
+
def install_lzo_if_needed():
"""
Install lzo package if {#should_install_lzo} is true
@@ -81,6 +88,10 @@ def install_lzo_if_needed():
if not should_install_lzo():
return
+ if skip_package_operations():
+ Logger.info("Skipping LZO package installation as host is sys prepped")
+ return
+
# If user has just accepted GPL license. GPL repository can not yet be
present.
Script.repository_util.create_repo_files()
diff --git
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 4688791..dec4eb7 100644
---
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -148,6 +148,17 @@
<on-ambari-upgrade add="true"/>
</property>
<property>
+ <name>sysprep_skip_lzo_package_operations</name>
+ <display-name>Whether LZO packages are also pre-installed on sysprepped
cluster</display-name>
+ <value>false</value>
+ <description>In sysprepped environments true value indicates that LZO
packages are pre-installed and should not be managed by Ambari</description>
+ <value-attributes>
+ <overridable>true</overridable>
+ <type>boolean</type>
+ </value-attributes>
+ <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
<name>sysprep_skip_setup_jce</name>
<display-name>Whether to skip setting up the unlimited key JCE policy on
sysprepped cluster</display-name>
<value>false</value>