You should be able to annotate your property like so:

  <property>
    <name>hadoop.security.key.provider.path</name>
    <value></value>
    <value-attributes>
      <empty-value-valid>true</empty-value-valid>
    </value-attributes>
    …
</property>

Thanks,
Nate

From: Xiaoke Zhang <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Friday, June 3, 2016 at 7:28 PM
To: "[email protected]" <[email protected]>
Subject: optional (blankable) configuration in custom ambari stacks

Hi,
I am trying to create a custom stack for Ambari,  I am using version 2.2.1.1 on 
centos.

ambari-agent-2.2.1.1-70
ambari-server-2.2.1.1-70
One problem I ran into is creating an optionally empty parameter for my service.
srv_ssl_cert and srv_ssl_key. Both are optional. If you don't have it, the 
service would then run it on http instead of https.

I tried to put this in my configuration.
-- metainfo.xml
<configuration-dependencies>
       <config-type>my-config</config-type>
 </configuration-dependencies>
--- my-config

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
  <property require-input="false" >
    <name>srv_ssl_cert</name>
    <value></value>
    <description>
      Path on disk for SSL certificate in PEM format.
    </description>
  </property>
  <property require-input="false" >
    <name>srv_ssl_key</name>
    <value></value>
    <description>
      Path on disk for SSL key in PEM format.
    </description>
  </property>
</configuration>

Unfortunately, it doesn't work.  Even though some of the ambari workshop 
examples uses require-input="false". 
https://github.com/randerzander/r-service/blob/master/configuration/r-config.xml
I tried without the empty <value></value> , ambari just don't show any thing at 
all.

I realize I can make it a special value like "none" or "n/a" or ship a with a 
default self signed certificate.  Just wondering if ambari has the capability 
to support optional and "blank able" parameters.

Thanks for any advice.


Reply via email to