Which tool to use for auto-generating Ansible modules from OpenAPI definitions?

Hello everybody,

I’m currently trying to auto-generate Ansible modules from OpenAPI (Swagger) definitions. During research I stumbled upon the ansible.content_builder collection. This collection is suspect to be replaced with the ansible-creator utility - anyhow, this tool still lacks OpenAPI support.

I tried to get ansible.content_builder running, but stumbled upon various issues.

Next, I discovered ansible-waldur-generator that generates code, but isn’t working for me - the documentation is very hard to get into.

My question: Are these the only two utilities to auto-generate Ansible modules from OpenAPI definitions these days? Am I missing something?

Thanks a lot in advance!

1 Like

Hi. While I may have no real answer, the thing you are doing reminded me of what Citrix did for their NetScaler product line.

Take a look at:

and

This is not OpenAPI per se but the idea is the same. They have a huge strict API specification in form of a Python dict (almost JSON) and a “module executor” that can generate modules on the fly using the specification. The modules are then trivial. They just call the module executor.

1 Like

That’s a good catch, thanks for sharing!