[augeas-devel] augeas puppet type doesn't add missing nodes

Marc Fournier marc.fournier at camptocamp.com
Wed Oct 8 12:15:57 UTC 2008


Hello,

I noticed that when using onlyif/match statements from puppet, nodes aren't
added to the tree if they are missing.

Explained in a different way, if aug.match() or aug.get() don't find the
node they are looking for, the puppet type does nothing. I would have
expected it to silently create the missing node.

The idea would be to have statements such as below modify the node
AuthorizedKeysFile if needed, as well as create it if it doesn't exist.

  augeas { "sshd/AuthorizedKeysFile":
    context => "/files/etc/ssh/sshd_config/",
    changes => "set AuthorizedKeysFile /etc/ssh/authorized_keys/%u",
    onlyif => "get AuthorizedKeysFile != /etc/ssh/authorized_keys/%u",
    notify => Service["ssh"],
  }

Attached is a patch which seems to fix the problem in my case. But I'm not
really sure it's the best way to resolve the issue.

Thanks for any comments !

Marc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: augeas.rb-missing-nodes.patch
Type: text/x-diff
Size: 1187 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20081008/9c5e1bb5/attachment.bin>


More information about the augeas-devel mailing list