Skip to content

XML types #150

@raphink

Description

@raphink

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions