augeas

how to update existing or create new XML node with Augeas

你离开我真会死。 提交于 2020-08-09 01:38:31
问题 For the following XML: <properties> <entry key="foo">bar</entry> </properties> I can update exiting entry with attribute "foo" with the following augeas command: set /files/test.xml/properties/entry[#attribute/key='foo']/#text bar2 Is there augeas command(s) to create a new node (with key attribute) if there is no existing entry with the input attribute, and update existing if entry already exists with the input attribute? I tried the following: set /files/test.xml/properties/entry[#attribute

how to update existing or create new XML node with Augeas

这一生的挚爱 提交于 2020-08-09 01:37:40
问题 For the following XML: <properties> <entry key="foo">bar</entry> </properties> I can update exiting entry with attribute "foo" with the following augeas command: set /files/test.xml/properties/entry[#attribute/key='foo']/#text bar2 Is there augeas command(s) to create a new node (with key attribute) if there is no existing entry with the input attribute, and update existing if entry already exists with the input attribute? I tried the following: set /files/test.xml/properties/entry[#attribute

how to update existing or create new XML node with Augeas

三世轮回 提交于 2020-08-09 01:37:19
问题 For the following XML: <properties> <entry key="foo">bar</entry> </properties> I can update exiting entry with attribute "foo" with the following augeas command: set /files/test.xml/properties/entry[#attribute/key='foo']/#text bar2 Is there augeas command(s) to create a new node (with key attribute) if there is no existing entry with the input attribute, and update existing if entry already exists with the input attribute? I tried the following: set /files/test.xml/properties/entry[#attribute

Why does Augeas Puppet resource type need 3 arguments for defnode?

混江龙づ霸主 提交于 2020-01-14 04:55:48
问题 I'm trying to add or update a user in an xml config file using augeas resource type in Puppet, here the manifest: augeas { "nexus_user_newadmin": lens => "Xml.lns", incl => "security.xml", root => "/usr/local/nexus/conf", changes => [ "defnode user /files/security.xml/security/users/user[id/#text='newadmin']", "set $user/id/#text 'newadmin'", "set $user/firstName/#text 'first name'", "set $user/lastName/#text 'last name'", "set $user/password/#text 'passhere'", "set $user/status/#text 'active

augeas in puppet does not change file

眉间皱痕 提交于 2019-12-25 07:16:50
问题 I want to manage the contents of the carbon.conf file using Augeas from Puppet. I have used Augeas before in Puppet for managing an xml file and that worked great. However this time when the puppet catalog is applied, nothing happens to the carbon.conf file. There is also no error in the log. Here's my code in the puppet manifest file: augeas { 'cache config': notify => Service[carbon-cache], incl => '/opt/graphite/conf/carbon.conf', context => '/cache', lens => 'Carbon.lns', changes => [

How to create separated XML nodes with “set” in Puppet using Augeas?

点点圈 提交于 2019-12-21 23:51:56
问题 I am using the Augeas tool for Puppet 3.2 and I am trying to create an XML file. I want to be able to add multiple fields with the same name into my XML doc. For instance, I want to separate node2/location2 from node1/location1 by placing it in its own "node" field. This is my code: augeas { "update template": lens => "Xml.lns", require => File["${buildpath}/tempfile.xml"], incl => "${buildpath}/tempfile.xml", changes => [ "set member/acceptors[#attribute]/node[#attribute]/nodeIdentity[

Create or update a section in XML file with Augeas

安稳与你 提交于 2019-12-07 03:10:16
问题 I would like to update a section in an XML config file or add a new one if does not exist already using Augeas. The XML file looks like this: <?xml version="1.0"?> <security> <users> ... <user> <id>deployment</id> <firstName>Deployment</firstName> <lastName>User</lastName> <password>somepasshere</password> <status>active</status> <email>changeme1@yourcompany.com</email> </user> </users> </security> I would like to update the last name/first name/email if the ID exists already or add a new

Create or update a section in XML file with Augeas

好久不见. 提交于 2019-12-05 06:48:32
I would like to update a section in an XML config file or add a new one if does not exist already using Augeas. The XML file looks like this: <?xml version="1.0"?> <security> <users> ... <user> <id>deployment</id> <firstName>Deployment</firstName> <lastName>User</lastName> <password>somepasshere</password> <status>active</status> <email>changeme1@yourcompany.com</email> </user> </users> </security> I would like to update the last name/first name/email if the ID exists already or add a new user section if it's a new ID. In AugTool I use: augtool> set /augeas/load/Xml/lens Xml.lns augtool> set

How to create separated XML nodes with “set” in Puppet using Augeas?

落花浮王杯 提交于 2019-12-04 20:20:14
I am using the Augeas tool for Puppet 3.2 and I am trying to create an XML file. I want to be able to add multiple fields with the same name into my XML doc. For instance, I want to separate node2/location2 from node1/location1 by placing it in its own "node" field. This is my code: augeas { "update template": lens => "Xml.lns", require => File["${buildpath}/tempfile.xml"], incl => "${buildpath}/tempfile.xml", changes => [ "set member/acceptors[#attribute]/node[#attribute]/nodeIdentity[#attribute]/#text node2", "set member/acceptors/node/nodeLocation[#attribute]/#text location2", "set member

How to use setm in puppet

邮差的信 提交于 2019-12-02 02:18:04
问题 I would like to change a one property name ( " modcluster.proxylist " ) with setm Command in Puppet. My following code is not working. Any help is much appreciated. 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