codeaffen / phpipam-ansible-modules

Ansible Modules to manage phpIPAM installations
https://codeaffen.org/projects/phpipam-ansible-modules
GNU General Public License v3.0
22 stars 10 forks source link

Refactor subnet module to handle either parent or folder #104

Closed cmeissner closed 1 year ago

cmeissner commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently the subnet module can handle nested subnets via the parent parameter. As phpIPAM handles subnets and folders in the same namespace we need to refactor our subnet module.

Describe the solution you'd like

We propose to manage either parent or folder in separate parameters in subnet module. These parameters needs to be mutual exclusive. This way we have the chance to use the current phpipam_helper.py methods to resolve given names/cidrs to an id.

Describe alternatives you've considered

Another solution could be the recycling of the existing parent parameter to use for either a containing subnet or folder. This solution needs more efford to be implemented as we need to cover all possible issues related to wrong user inputs.

Additional context

No matter which solution will be implemented the parameter is_folder needs to be removed from subnet module as folders will be managed by its own module.