Could you use the environment variable ANSIBLE_NMAP_ADDRESS as documented below as an alternative?
https://docs.ansible.com/ansible/latest/collections/community/general/nmap_inventory.html#parameter-address https://docs.ansible.com/ansible/latest/collections/environment_variables.html#envvar-ANSIBLE_NMAP_ADDRESS 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 > address: 192.168.10.0/24 > ... > > 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 > <https://groups.google.com/d/msgid/ansible-project/5b1c9c10-08cb-4cc3-a8eb-747cedbac6d1n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAKtKohREUxLB4BEnNeBQHs_q7%3Dm2eYbRdgtLU4e%2BuzYc6X3Mrw%40mail.gmail.com.
