ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukáš Drbal <lukas.dr...@gmail.com>
Subject Ambari 2.4 - custom service and condition package instalation
Date Mon, 09 Jan 2017 16:17:32 GMT
Hi,

i have custom service which provides more components [1].
All components are installed from deb packages and i don't wanna install
all packages on all nodes (just component specific) so i try to use
condition [2] but it ends with error:
"resource_management.core.exceptions.Fail: Condition with name
'should_install_confluent_supervisor', when installing package supervisor.
Please check package_conditions.py."

I check source code and it look's [3] like there is hardcoded package
"resource_management.libraries.functions".

In 2.2 i was able to use param exclude_packages in install method. How i
can achieve same functionality in 2.4? Did i miss something?

Thanks for help.

[1]
I have list of all packages in metainfo.xml
For example:
<osSpecifics>
  <osSpecific>
    <osFamily>ubuntu14</osFamily>
    <packages>
      <package>
        <name>supervisor</name>
        <condition>should_install_supervisor</condition>
      </package>
      <package>
        <name>apache</name>
        <condition>should_install_apache</condition>
      </package>
    </packages>
  </<osSpecific>
</osSpecifics>

def should_install_supervisor():
    config = Script.get_config()
    # _has_applicable_local_component is copied
from ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
    return _has_applicable_local_component(config, ["MY_SERVICE"])

[3]
https://github.com/apache/ambari/blob/release-2.4.2/ambari-common/src/main/python/resource_management/libraries/script/script.py#L592

-- 
Save The World - http://www.worldcommunitygrid.org/
http://www.worldcommunitygrid.org/stat/viewMemberInfo.do?userName=LesTR

LesTR

Mime
View raw message