如何使用Augeas和Puppet从多个资源更新单个xml文件?

时间:2014-05-12 19:32:27

标签: xml puppet weblogic11g augeas

我有一个由WLST创建的Weblogic config.xml文件。它在创建时有以下xml:

     `<arguments>-Xms1024m -Xmx1024m -XX:MaxPermSize=350m -Dweblogic.TracingEnabled=true</arguments>`

我有许多木偶资源需要将以下内容添加到参数

-Doracle.net.tns_admin=/opt/tns -Ddomain.home=/projects/server -Does.client.home=/app/oracle/wls1036/oesclient -Doracle.home=/app/oracle/wls1036/oesclient -Doracle.security.jps.config=/projects/cluster/config/oeswlssmconfig/cluster/jps-config.xml -Dweblogic.security.SSL.trustedCAKeyStore=/app/oracle/wls1036/wlserver_10.3/server/lib/cacerts -Xverify:none -da -Dcustom.authz.provider=oes -javaagent:/app/wily/Agent.jar -Dcom.wily.introscope.agentProfile=/app/wily/core/config/IntroscopeAgent.profile

有没有办法使用联盟?这样,如果使用相同的启动参数定义多个资源,则不会有重复。

或者我是否需要追加或连接这两个项目?

我预计将来必须从其他资源中添加更多参数。

1 个答案:

答案 0 :(得分:0)

如果您想确保文件的完整内容,最好的选择是使用连接。为此选择PuppetlabsOnyxpoint Puppet模块。我倾向于Onyxpoint进行清洁植入using a parent and children concat fragments

使用concat片段创建定义的资源类型,并通过实例化新定义的资源来添加新片段。