0

I can insert/edit any attributes or any text in XML file.

Is it possible to insert/edit any attributes or any text in XML File.

For eg: I would like to change the value of a property, If it is named as "modcluster.proxylist".

<server-group name="ServiceGroupOne" profile="full-ha">
    <system-properties>
        <property name="jboss.default.multicast.address" value="232.0.2.20" boot-time="true"/>
        <property name="modcluster.proxylist" value="192.168.79.77:7777" boot-time="true"/>
        <property name="modcluster.lbgroup" value="SearchGroupOne" boot-time="true"/>
    </system-properties>
</server-group>
<server-group name="ServiceGroupTwo" profile="full-ha">
    <system-properties>
        <property name="jboss.default.multicast.address" value="232.0.2.20" boot-time="true"/>
        <property name="modcluster.lbgroup" value="SearchGroupTwo" boot-time="true"/>
        <property name="modcluster.proxylist" value="192.168.79.77:7777" boot-time="true"/>
    </system-properties>
</server-group>
<server-group name="ServiceGroupThree" profile="full-ha">
    <system-properties>
        <property name="modcluster.lbgroup" value="CommonSearchGroup" boot-time="true"/>
        <property name="modcluster.proxylist" value="192.168.79.77:7777" boot-time="true"/>
        <property name="jboss.default.multicast.address" value="232.0.2.20" boot-time="true"/>
    </system-properties>
</server-group>
ArunRaj
  • 1,780
  • 2
  • 26
  • 48

1 Answers1

1

The augeas puppet type has an onlyif attribute which lets you decide whether it will be ran or not. That's pretty much the only conditional option there is for now.

If your need gets quite complex, I'd recommend you write a Ruby augeasprovider instead.

raphink
  • 3,625
  • 1
  • 28
  • 39
  • @Raphink: Thanks for the quick notes on it. Can you please provide any examples of its usage to understand it ? – ArunRaj Nov 11 '15 at 11:56
  • 1
    https://docs.puppetlabs.com/guides/augeas.html explains how to use this. However, as replied in your [latest question](http://stackoverflow.com/questions/33664488/how-to-use-setm-in-puppet/33666228#33666228), there is no need for that in your case. – raphink Nov 12 '15 at 07:28