Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

13 lines
386 B

def ip_from_inventory(hostvars, hostname):
"""
replace this ``{{ hostvars[hostname]['ansible_host'] }}``
with something nicer such as `` {{ hostvars | ip_from_inventory(hostname) }}``
"""
return hostvars[hostname]['ansible_host']
class FilterModule(object):
def filters(self):
return {
'ip_from_inventory': ip_from_inventory,
}