Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ansible.utils as utils
- import ansible.errors as errors
- import socket
- class LookupModule(object):
- def __init__(self, basedir=None, **kwargs):
- self.basedir = basedir
- def run(self, terms, inject=None, **kwargs):
- if not isinstance(terms, basestring):
- raise errors.AnsibleError("ip lookup expects a string (hostname)")
- return [socket.gethostbyname(terms)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement