Re: [ansible-devel] Accessing inventory variables from custom connection plugin

2023-08-16 Thread Piotr Gabryś
Thank you Brian! I thought that I had to be missing some important concept. I need to investigate httpapi plugins then środa, 16 sierpnia 2023 o 20:13:03 UTC+2 bc...@redhat.com napisał(a): > forgot to add, you might want to look at httpapi (netcli, netconf) > plugins, which are a variant on norm

Re: [ansible-devel] Accessing inventory variables from custom connection plugin

2023-08-16 Thread Brian Coca
forgot to add, you might want to look at httpapi (netcli, netconf) plugins, which are a variant on normal connection plugins that uses a 'local execution' and then passes the connection to the module. Another option is 'turbo' mode from module utils which can cache connections and cloud libraries.

Re: [ansible-devel] Accessing inventory variables from custom connection plugin

2023-08-16 Thread Brian Coca
I'm not sure what you are trying to do, but it looks like you are trying to instantiate a connection plugin from a module, this is not normally how things work. Connection plugins are provided the vars they declare in config when they are loaded from the task executor, trying to load/create it fro

[ansible-devel] Accessing inventory variables from custom connection plugin

2023-08-16 Thread Piotr Gabryś
Hi, I am developing a new Ansible collection to manage configuration of network devices. These devices are configured only over API. I need to be able to define them in an inventory file. From my understanding, I should create a new connection plugin and use it to connect to devices. The probl