Michael Knox
unread,Jun 6, 2011, 6:45:11 PM6/6/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppet...@googlegroups.com
Hi,
I'm working on a type to undertake some very simple management of the SuSE firewall service (/etc/sysconfig/SuSEfirewall2), specifcally I need to manage the contents of the list FW_CONFIGURATIONS_EXT which is handled as a shell list.
I've been able to use the shellvars_list.aug to manage the file, but I'm struggling with the puppet filter / onlyif.
The following works in augtool:
match FW_CONFIGURATIONS_EXT/value $svc
I then wanted to check that the size of this array was 0 before adding the service.
However this fails with ...
err: /Stage[main]/Svn::Server/Firewall::Service[svn]/Augeas[fwservice_svn]: Could not evaluate: Error sending command 'match' with params nil/Unknown command svn
So this filter argument for match is supported in Augeas, but not in the Augeas provider.
Is there a better way of doing this with the current provider?
The manifest code in question ....
augeas {"fwservice_$svc":
context => "/files/etc/sysconfig/SuSEfirewall2",
onlyif => "match FW_CONFIGURATIONS_EXT/value $svc size == 0",
#onlyif => "match FW_CONFIGURATIONS_EXT/value not_include $svc",
changes => [
"set FW_CONFIGURATIONS_EXT/value[last()+1] $svc",
],
load_path => "$augeas::params::lense_path",
require => Augeas::Lense['shellvars_list.aug'],
}