ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
827 stars 1.53k forks source link

linode_v4 - support for nodebalancers and private IPs in the module planned? #1946

Open l8gravely opened 3 years ago

l8gravely commented 3 years ago

Summary

Looking at the linode_v4 module, it only offers basic support for creating linodes. Are there any plans for supporting more aspects of the v4 API such as nodebalancers and examing the networking configuration of Linodes? I'm poking at it using the uri: module, but I get the feeling I'm at the wrong level and should be trying to help test the linode_v4 module instead.

Issue Type

Bug Report

Component Name

linode_v4

Ansible Version

ansible 2.9.17
  config file = /home/stoffj/work/Ansible/playbooks/tais-lweb-linode/ansible.cfg
  configured module search path = ['/home/stoffj/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]

Configuration

OS / Environment

Linode v4 API at https://www.linode.com/docs/api/

Steps To Reproduce

Expected Results

No response

Actual Results

Sorry it's not really a bug report, but more of a request for where this module is going.

ansibullbot commented 3 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 years ago

cc @InTheCloudDan @decentral1se @displague @rmcintosh click here for bot help

l8gravely commented 3 years ago

Hello? Any plans or updates? Anything I could do to try to do this myself? Any hints for what it takes to do an API to Ansible module?

felixfontein commented 3 years ago

@l8gravely you could take a look at people who modified the module recently (not the ones doing basic maintenance work which is not really related to linode though :) ) and ping them, maybe some of them are interested in this.

Also depending on what the proposed features do exactly, it might make sense to create new modules instead of squeezing everything in one module. I know too little about linode to properly comment on that though.

displague commented 3 years ago

@l8gravely 👋

There are no current plans that I am aware of to pursue the next logical modules. I don't represent Linode, but I have been involved with this module in the past.

https://github.com/ansible-collections/community.general/blob/main/plugins/modules/cloud/linode/linode_v4.py (as pointed out by the bot) is a good reference.

Feel free to take the nodebalancer module on and ping me for review when ready. I feel comfortable with my understanding of this set of resources and its peculiarities.

I'd be less inclined to offer review on enhancements to the linode_v4 instance module, since I'm not as familiar with the recent changes and caveats.

Some NodeBalancer resources to consider:

I think @rmcintosh is the best technical point-of-contact. @dorthu may also be able to lend assistance.

0xch4z commented 3 years ago

Hey there, @l8gravely! We are working on a Linode (APIv4 only) module internally right now with support for more than just instances. That should be released independently of the community.general module soon.

l8gravely commented 3 years ago

Charlie, That's great news, please keep me in mind for beta testing, since I'm going crazy trying to handle a simple (it should be simple) case of a pair of Linodes, a nodebalancer and some configs. The current set of Ansible tasks I have just makes tons of linode-cli calls.

Is there a good way I can reach out to you outside of here to take this offline?

l8gravely commented 3 years ago

Hi @displague thanks for the feedback and all the pointers! I'm hoping that @Charliekenney23 will also be able to help. I'm good at testing and finding problems, not nearly as good at python coding, though maybe it's a good time to learn more.

As a side note, it would be great if someone could give examples of using the Dynamic inventory pluging for Linodes without having to run multiple play books. OR is that not possible at all? The docs all seem to imply that the dynamic inventory only works at the start of running a playbook, but not when you actually create new entries in the system. Being able to refresh the inventory in the middle of a bunch of tasks would be awesome.

displague commented 3 years ago

Oh, @Charliekenney23 is great. Glad to hear you've been working together.😀

Charles, maybe you'd like to join this list: https://github.com/ansible-collections/community.general/issues/1946#issuecomment-788951594 ?

0xch4z commented 3 years ago

@l8gravely I think it's more likely that we will just release soon. I will ping back here with updates.

Heya @displague! I will definitely put a PR up to that maintainer list. Thanks

l8gravely commented 3 years ago

Please keep me in the loop, I'm happy to run tests!

l8gravely commented 3 years ago

"Charlie" == Charlie Kenney @.***> writes:

Charlie> Hey there, @l8gravely! We are working on a Linode (APIv4 Charlie> only) module internally right now with support for more than Charlie> just instances. That should be released independently of the Charlie> community.general module soon.

Is there any update on this? I'd love to try and test this out in the near future if I can.

ansibullbot commented 3 years ago

cc @LBGarber click here for bot help

ansibullbot commented 2 years ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

beatboxchad commented 1 year ago

Is there any reason nobody has tried to, say, use Python's ast module to metaprogram an Ansible Collection of modules for each computing resource object (one for CRUD and one _info, excluding objects like users, accounts, billing) using either Linode's official API client or the v4 OpenAPI spec as the data source?

Maybe such an approach would need some manual cleanup, but it's how I'd get started, personally. It's common to see machine-generated API clients in multiple languages, and not a huge extrapolation to imagine a clean, compliant Ansible collection. I've seen this approach used more and more in our industry since 2016 or so, and as a longtime Linode customer I've always wondered why development on this valuable collection stalled at this single example module.

If anybody's sponsoring this work, I'd love to help. I lack the resources to work on it unfunded, but I would benefit professionally from understanding why nobody has tried this approach. My freelance business built on Linode would benefit from a Collection supporting the full set of computing resources in the V4 API.

Thank you to everyone involved for this work so far, and be well!