puppet-augeasproviders icon indicating copy to clipboard operation
puppet-augeasproviders copied to clipboard

XML types

Open raphink opened this issue 8 years ago • 0 comments

One of the main uses of Augeas in Puppet is to edit XML nodes. The typical use identifies a node and sets its text and/or attributes, so I'd suggest an xml_node type like so:

xml_node { 'some node':
  ensure       => present,             # or absent, maybe positioned as well
  target       => '/path/to/file.xml',
  path         => '/path/to/node',     # allow to pass an Augeas expression to filter out node
  text         => 'my text value',     # maybe a way to remove the value
  attributes   => {
    attr1 => 'val1',
    attr2 => 'val2',
  },
  attr_append  => true,                # should we not replace the attributes?
}

Would that be useful? Is it missing something?

raphink avatar Nov 20 '17 20:11 raphink