Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/net_tools/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/net_tools/ipinfoio_facts.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
d
Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys%
---
module: ipinfoio_facts
short_description: "Retrieve IP geolocation facts of a host's IP address"
description:
  - "Gather IP geolocation facts of a host's IP address using ipinfo.io API"
version_added: "2.3"
author: "Aleksei Kostiuk (@akostyuk)"
options:
  timeout:
    description:
      - HTTP connection timeout in seconds
    required: false
    default: 10
  http_agent:
    description:
      - Set http user agent
    required: false
    default: "ansible-ipinfoio-module/0.0.1"
notes:
  - "Check http://ipinfo.io/ for more information"
sf
# Retrieve geolocation data of a host's IP address
- name: get IP geolocation data
  ipinfoio_facts:
s�
ansible_facts:
  description: "Dictionary of ip geolocation facts for a host's IP address"
  returned: changed
  type: complex
  contains:
    ip:
      description: "Public IP address of a host"
      type: str
      sample: "8.8.8.8"
    hostname:
      description: Domain name
      type: str
      sample: "google-public-dns-a.google.com"
    country:
      description: ISO 3166-1 alpha-2 country code
      type: str
      sample: "US"
    region:
      description: State or province name
      type: str
      sample: "California"
    city:
      description: City name
      type: str
      sample: "Mountain View"
    loc:
      description: Latitude and Longitude of the location
      type: str
      sample: "37.3860,-122.0838"
    org:
      description: "organization's name"
      type: str
      sample: "AS3356 Level 3 Communications, Inc."
    postal:
      description: Postal code
      type: str
      sample: "94035"
(t
AnsibleModule(t	fetch_urlsansible-ipinfoio-module/0.0.1t
IpinfoioFactscB`seZd�Zd�ZRS(cC`s+d|_|jjd�|_||_dS(Nshttps://ipinfo.io/jsonttimeout(turltparamstgetRtmodule(tselfR((sL/usr/lib/python2.7/site-packages/ansible/modules/net_tools/ipinfoio_facts.pyt__init__^s	cC`s�t|j|jdtd|j�\}}y|ddkWn0tk
rn|jjddj|j��nfXy+|j�}|jj	|j
d��}Wn3tk
r�|jjddj|j|��nX|SdS(	NtforceRRi�tmsgs/Could not get {0} page, check for connectivity!tutf8s/Failed to parse the ipinfo.io response: {0} {1}(R	RRtTrueRtAssertionErrort	fail_jsontformattreadt	from_jsontdecodet
ValueError(Rtresponsetinfotcontenttresult((sL/usr/lib/python2.7/site-packages/ansible/modules/net_tools/ipinfoio_facts.pytget_geo_datacs

(t__name__t
__module__RR!(((sL/usr/lib/python2.7/site-packages/ansible/modules/net_tools/ipinfoio_facts.pyR
\s	cC`sttdtdtdt�dtdddd��dt�}t|�}td	td
|j��}|j|�dS(Nt
argument_spect
http_agenttdefaultRttypetinti
tsupports_check_modetchangedt
ansible_facts(Rtdictt
USER_AGENTRR
tFalseR!t	exit_json(Rtipinfoiotipinfoio_result((sL/usr/lib/python2.7/site-packages/ansible/modules/net_tools/ipinfoio_facts.pytmainws	t__main__N(t
__future__RRRR't
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.urlsR	R-tobjectR
R2R"(((sL/usr/lib/python2.7/site-packages/ansible/modules/net_tools/ipinfoio_facts.pyt<module>s


(	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]