Joel Nimety wrote:
>
>
> Bryan Kearney wrote:
>> Joel Nimety wrote:
>>
>>
>> Thank you. I have applied this patch. Please let me know if it works for
>> you.
>>
>> http://git.et.redhat.com/?p=ace.git;a=commit;h=8c4420ba7c732d039ce6a37fd347437b0a0492a0
>>
>> -- bk
>
> hmmm. looks like a patch from Marc Fournier attempts to address the same
> thing and I'm not sure both are necessary (and they conflict in some
> cases). I suppose it depends on what behavior is appropriate.
>
> Marc's patch will not perform the onlyif get/match if the node doesn't
> exist (when result.nil?). My patch will still perform the get/match; my
> thinking was that this would allow to test for the entry not being
> present (onlyif => "Key =~ ''").
>
> I'm not sure which approach results in a more intuitive behavior but
> only one should be used. Thoughts?
I put a test in there where, assuming no star wars characters exist in
the file this should run
augeas{"test_missing_node_should_run":
require => Augeas[test_regex_2_should_not_run],
context => "/files/etc/sysconfig/firstboot",
changes => "set Boss Nass",
onlyif => "get Boss != Nass ",
}
And this should not
augeas{"test_missing_node2_should_not_run":
require => Augeas[test_regex_2_should_not_run],
context => "/files/etc/sysconfig/firstboot",
changes => "set Jango Fett",
onlyif => "get Jango == Fett ",
}
So.. we basically say run if nil != Nass and do not run if nil == Fett.
This appears to be true. This seems logical to me. What it does not
allow for is the setting of value X if node Y is absent. But this can be
done with the following (again, first runs second will not)
augeas{"test_missing_node3_should_run":
require => Augeas[test_regex_2_should_not_run],
context => "/files/etc/sysconfig/firstboot",
changes => "set Boba Fett",
onlyif => "match Anakin size == 0",
}
augeas{"test_missing_node4_should_not_run":
require => Augeas[test_regex_2_should_not_run],
context => "/files/etc/sysconfig/firstboot",
changes => "set Anakin Skywalker",
onlyif => "match Boba size == 0",
}
-- bk
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---