Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
UFW (Uncomplicated FireWall) #748
I have added the following types:
This is my first time contributing to cdist, so I have a question: Since UFW's command line is idempotent, my types do not bother using explorers to check whether their work needs to be done --
Thanks for reviewing this!
After opening this I have realized there are a few changes I want to make: removing __ufw_default and including its functionality as --default_incoming, etc on __ufw, and adding a __ufw_route type which would be mostly copy paste from ufw rule, but for routes that do not terminate on the local machine (ufw has a slightly different syntax for these).
would it be possible to generate all rules before adding them with ufw and then diff them with currently active rules? i, myself, wouldn't wrap ufw syntax into cdist parameters, but just use multiple
so, for example, you want to add rules foo, bar, baz and current active rules are foo and bar - rule baz will be added. or you want to add rules foo, bar and active rules are foo, bar, baz - baz will be removed.
but this way you can only define ufw once per configuration run, because if you define ufw twice, then last ufw will remove first one's rules.
There could be an option to leave old rules or remove them, where by default they won't be removed.
As soon as we put it in
I may be wrong, but I was under the impression that if you attempt to instantiate the same object multiple times, all invocations after the first will be ignored regardless of how the type is written. We also have
I agree that wrapping UFW's syntax may be unnecessary though. If we follow
Current rules can be listed with
I think the proper solution to the diffing problem would be "singleton explorers" which run only once for a type, not once per object. Then a type like
To summarize, the options are:
I am fine with removing the custom parameters, but I strongly believe