I have written a custom module "filter_prefix" that accepts "host" and
"prefixes".
I have a dictionary that looks like this -
d2 = {'4.4.4.4':'10.0.0.0/8','11.0.0.0/8', '5.5.5.5':'10.0.0.0/8'}
In the API script, I have -
hosts = d2.keys()
device_inventory = Inventory(hosts)
pb = Runner(
module_name = 'filter_prefix',
module_args = 'host={{ inventory_hostname }} prefixes= ???',
transport = local,
inventory = device_inventory)
I would like to be able to pass appropriate 'value' to prefixes based on
'host' from d2 dictionary. I tried using -
prefixes="d2[ '{{ inventory_hostname }}' ]" but then it doesn't expand d2.
I am running ansible version 1.9.2.
Any ideas?
Amit
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/75a9c353-cfb7-4955-8cec-6f3e15f29e46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.