zahodi / ansible-mikrotik

Mikrotik module collection for ansible
Apache License 2.0
96 stars 33 forks source link

Create action plugin and use connection information from inventory #19

Open CFSworks opened 7 years ago

CFSworks commented 7 years ago

This may supersede #7 (I'm not extremely familiar with Ansible plugins yet).

The integration test playbook mentions an action plugin which is a necessary prerequisite for using the inventory connection details as the MikroTik API connection details.

What is necessary for this plugin?

senorsmile commented 7 years ago

So, my thoughts on this are:

Nearly all ansible modules that work by connecting to an API (especially an HTTP API) do not do so through a new connection type (or any other plugin). They do so by defining variables which are consumed by the module itself. This also has the requirement that the node that you're connecting to is technically localhost.

I'm not entirely against create a plugin to manage the connection, but we should do a more thorough survey of current and future Ansible network modules to determine what is recommended.

In the meantime, there are definitely some lower hanging fruit we could do to get things much more performant (like https://github.com/zahodi/ansible-mikrotik/issues/7)