Inventory plugins can only read from ENV variables. Not sure why, but seems like a architectural limitation. Most of the inventory plugins either read from files (like AWS) or from ENV variables. 

Sent from my iPhone

On 29/09/2023, at 5:17 AM, J M <[email protected]> wrote:

Many thank, works!!!

Because not work with --extra-vars?

Regards


El jueves, 28 de septiembre de 2023 a las 18:09:18 UTC+2, Will McDonald escribió:

On Thu, 28 Sept 2023 at 16:56, J M <[email protected]> wrote:
Hi,

I have a question of howto use external variables in the nmap plugin.

I have a simple yml:
plugin: nmap
...

But I need to pass the network range as a external variable, as example:
plugin: nmap
address: '{{ mynetrange }}'
# I tested this argument also:
use_extra_vars: true
...

And launch as:
ansible-inventory -i nmap.yml --list -e "mynetrange=192.168.10.0/24"

but I can't get it to work, someone could help me?


Regards

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5b1c9c10-08cb-4cc3-a8eb-747cedbac6d1n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b8189b91-1a39-4674-ad47-f8e3b9cdd900n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/B403B994-0E34-4A61-A814-ECF062AE627C%40gmail.com.

Reply via email to