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

  1. def ip_from_inventory(hostvars, hostname):
  2. """
  3. replace this ``{{ hostvars[hostname]['ansible_host'] }}``
  4. with something nicer such as `` {{ hostvars | ip_from_inventory(hostname) }}``
  5. """
  6. return hostvars[hostname]['ansible_host']
  7. class FilterModule(object):
  8. def filters(self):
  9. return {
  10. 'ip_from_inventory': ip_from_inventory,
  11. }