Jumping in on this thread since I’ve PRed the rax_network module to create/delete isolated networks.
Last night I hacked together a rax_lb because I needed to create load balancers. Given the presence of rax (service=cloud_loadbalancers), I chose to do a separate module because the amount of options you can pass into the load balancers endpoint via pyrax are sorta crazy and there was no way that was going to go through rax in a sane manner as it is. And of course, also because rax_clb is for adding/removing hosts from an lb, but not for creating them. But I digress.
What I would like to nail down is what our goals for the rax refactor and modules per resource look like in the future.
Let’s run with the lb example. create/delete is easy. adding/removing hosts form it is also easy. But combining the two into a module presents some larger questions.
What if I call state=present to create an lb with an empty set of nodes, but later, I make that call with a list of nodes? Should it ignore it, or update the list? Is that still state=present, or is that state=updated/latest? Same for removing hosts.
In some modules, like rax, when we do state=present, we check to see of the resource by that name/id exists. If it doesn’t, we create it. But we don’t ever update the resource if it already exists. For servers, this is more or less correct since there’s not much to edit/update after a create.
For load balancers on the other hand, many settings can be changed after creation. Port, Protocol, Algorithm, Logging, Error Page, etc.
Is this where a state=latest is appropriate?
More or less, I’d like to throw my hat in the ring and commit some things as I’m working on spinning up some new clients from scratch with servers, lbs, dns, etc. But I’d like to get a good clear direction and where we thing we should be going with 1 module per resource, and creation va updating, etc so I’m not PRing things that will never be accepted.
Thanks!
-=Chris