Jboss7.x 如何在puppet中使用setm

Jboss7.x 如何在puppet中使用setm,jboss7.x,puppet,jboss-eap-6,puppet-enterprise,augeas,Jboss7.x,Puppet,Jboss Eap 6,Puppet Enterprise,Augeas,我想用Puppet中的setm命令更改一个属性名(modcluster.proxylist)。我的以下代码不起作用。非常感谢您的帮助 augeas { "jboss_domain_config": incl => "/opt/domain.xml", lens => "Xml.lns", context => "/files/opt/domain.xml",

我想用Puppet中的setm命令更改一个属性名(modcluster.proxylist)。我的以下代码不起作用。非常感谢您的帮助

    augeas { "jboss_domain_config":
            incl    =>      "/opt/domain.xml",
            lens    =>      "Xml.lns",
            context =>      "/files/opt/domain.xml",
            onlyif  =>      "match /files/opt/domain.xml/domain/server-groups/*/system-properties/*/#attribute/name modcluster.proxylist"
            changes =>      "setm /files/opt/domain.xml/domain/server-groups server-group[.]/system-properties/property[.]/#attribute/value kumaran",
    }
下面是我想要更改的源XML


这里面有很多问题。让我们逐一处理:

  • 您提供的
    domain.xml
    代码似乎是错误的,因为没有您的Puppet代码所建议的
    服务器组
    节点。我认为您提供的代码还有两个级别:

    <domain>
      <server-groups>
        <!-- the rest of the file -->
      <server-groups>
    <domain>
    
    augeas { "jboss_domain_config":
      incl    =>      "/tmp/domain.xml",
      lens    =>      "Xml.lns",
      changes =>      "setm domain/server-groups/server-group system-properties/property[#attribute/name='modcluster.proxylist']/#attribute/value kumaran",
     }