Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import ansible.utils as utils
  2. import ansible.errors as errors
  3. import socket
  4.  
  5. class LookupModule(object):
  6.  
  7. def __init__(self, basedir=None, **kwargs):
  8. self.basedir = basedir
  9.  
  10. def run(self, terms, inject=None, **kwargs):
  11.  
  12. if not isinstance(terms, basestring):
  13. raise errors.AnsibleError("ip lookup expects a string (hostname)")
  14.  
  15. return [socket.gethostbyname(terms)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement