Replies: 1 comment
-
Yeah I agree - that might be useful and speed-up mass-management. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
We use Ansible to manage a few OPNsense Firewalls with quit a lot ressources configured on it. Deploying everithing takes a considerable amount time. It would therefore be nice for ous to use some form of mass management with every ressource type. And it would be nice if the purge could be run in the same step. Now we have to purge after the step, either with a
_purge
module or list and a loop to ensure no ressources are left over.The current
_multi
/_purge
approach has in my oppinion some downsides. For the user the downside is that there is no easy and cocensistant way to create and/or purge multiple objects of the same type. For the developer it is more work to implement three modules instead of one. I therefor hesitate to start implement/test and document all the_multi
/_purge
modules which I would need as a user.Proposal
Expand the module interface of all (object bases) modules to handle either one or multiple objects at once. This could be achived by adding a
multi
parameter which taks a list of dicts with the same keys as the module already to descript the object.For example it would be possible to call the dhcrelay_relay mudule on the following two ways:
The mor general options like
enabled
,state
orreload
would sty on the top level only.To ensure that only the mentions objects are present and purge all other a
multi_control
dictionary option could be added to enable and tune this feature. A-like theloop_control
in ansible.This would allow once module call create all the objects required and remove the surpluss ones.
I am confident that most of the necessary changes could be made at the
module_process
to process multiple modules in sequence. In the mudules the would need to be a small change to accept the arguments in two ways, however this can be simplified by a helper function. This would keep the necessary changes to the actual modules and main small.Questions
_multi
/_purge
related itches worth considering?Beta Was this translation helpful? Give feedback.
All reactions