Ask Your Question
0

Use Augeas provider to edit XML file

asked 2013-11-15 00:17:51 -0600

spuder gravatar image

updated 2013-11-15 10:00:43 -0600

I'm trying to use puppet to edit a file located in /opt/foo.xml

class foo {
  augeas {'foo.xml':
    incl     =>  '/tmp/foo.xml',
    context  =>  '/files/tmp/foo.xml/foo',
    lens     => "Xml.lns",
    changes   => [
      "set bar/#text herp",]
  }
}

The xml file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<foo>
  <bar>flub</bar>
</foo>

Augeas returns no diagnostic information, so it is impossible for me to know why this is not working. Can anyone else enlighten me?

Here is the output from the --debug

debug: Creating default schedules
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-11-15 08:57:57 -0600

spuder gravatar image

As pointed out by Dominic in the irc channel, the manifest does not include foo.

class foo {
  augeas {'foo.xml':
    incl     =>  '/tmp/foo.xml',
    context  =>  '/files/tmp/foo.xml/foo',
    lens     => "Xml.lns",
    changes   => [
      "set bar/#text herp",]
  }
}include foo
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-11-15 00:17:51 -0600

Seen: 3,006 times

Last updated: Nov 15 '13