I am running into this same issue... Did you resolve it?
Thanks a lot,
Mohamed.
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
- put the exec definition in the class that runs in the post stage.
- in site.pp put the default:
Firewall {
notify => Exec["persist-firewall"],
}
Thanks,
Mohamed.
Thus far I've only been able to get puppet to run without making the firewall persistent.
I too found that using stages is the only usable way out of this.
Just out of curiosity, what do you mean by:
> We ended
> up in situations where the drop rules would kick before the allow
> established rules, and thus kill the puppet run
In my experience, what breaks is the reporting attempt puppet clients
makes to the master, not the puppet run itself.
Mohamed.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/_GIF40iCIRYJ.
So I think though the documentation needs updating. This is what I use
in top scope, and I've included the pre/post classes that belong in
their respective module ultimately:
https://gist.github.com/2032141
You'll notice I ultimately don't use stages here, to avoid the problem
some people have with the exec being in the main stage.
If people can try this methodology and see if it works that would be
much appreciated, then the documentation can be updated to reflect
this pattern instead.
ken.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/xBTznk59RKkJ.
the numbers in the namevar are ultimately for how they get
ordered in the file ruleset as you state - but not what order
they are _inserted_.
If you look at my example in the gist:
Firewall {
notify => Exec["persist-firewall"],
before => Class["my_soe::fwpost"],
require => Class["my_soe::fwpre"],
}
I'm setting it so that by default, every rule firewall resource runs
'before' Class["my_soe::fwpost"], and it requires
Class["my_soe::fwpre"]. So in this example it doesn't need stages -
just put your pre & post in those classes.
ken.
No its not.
> Anyway, works great for us now. Thanks much!
Good to hear - I'll get the documentation fixed then.
> All that remains is waiting for a new release to get firewall rules at boot
> on debian, and then some magic work yet to be done for not stomping on
> custom chains like fail2ban.
Indeed.
ken.
Stages generate cycles.
Your solution tells me it cannot find the pre class:
Tue Jun 19 05:20:23 -0400 2012 Puppet (err): Failed to apply catalog: Could not find dependency Class[Fw::Pre] for Firewall[100 accept http connections] at
It definitely does not like:
Firewall {notify => Exec["persist-firewall"],before => Class["my_soe::fwpost"],require => Class["my_soe::fwpre"],}
Ken's example is not a drop-in solution. It works in appropriate context; especially, it requires your node declaration or ENC to declare the needed classes in an appropriate order. Alternatively -- perhaps easier -- you could wrap parts of it in a class that provides the needed ordering. Better yet, study the example to understand what it's doing, why it works when it does work, and what's needed to make it work.