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

Bryan Kearney bkearney at redhat.com
Thu Oct 9 14:01:48 UTC 2008


Marc Fournier wrote:
> 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

Marc:

Thank you for the patch. I believe I got a similar one (on the same day) 
which solves your problem. Can you please review the latest code based 
on this commit [1]. If this does not solve your issue, please let me 
know and we can work to get another change in.

-- bk

[1] 
http://git.et.redhat.com/?p=ace.git;a=commit;h=8c4420ba7c732d039ce6a37fd347437b0a0492a0






More information about the augeas-devel mailing list