menandmice.ansible_micetro.ipinfo (1.0.7) — lookup

Find information of an IP address

| "added in version" 2.7 of menandmice.ansible_micetro"

Authors: Ton Kersten <t.kersten@atcomputing.nl> for Men&Mice

Install collection

Install with ansible-galaxy collection install menandmice.ansible_micetro:==1.0.7


Add to requirements.yml

  collections:
    - name: menandmice.ansible_micetro
      version: 1.0.7

Description

This lookup collects info of an IP address

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Find all info for IP 172.16.17.2
  debug:
    msg: "Info for IP: {{ lookup('menandmice.ansible_micetro.ipinfo', mm_provider, '172.16.17.2') }}"
  vars:
    mm_provider:
      mm_url: http://micetro.example.net
      mm_user: apiuser
      mm_password: apipasswd
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get DHCP reservations for 172.16.17.2
  debug:
        msg: "{{ ipinfo['dhcpReservations'] }}"
  vars:
    mm_provider:
      mm_url: http://micetro.example.net
      mm_user: apiuser
      mm_password: apipasswd
    ipinfo: "{{ query('menandmice.ansible_micetro.ipinfo', mm_provider, '172.16.17.2') }}"

Inputs

    
ipaddress:
    description:
    - The IP address that is examined
    required: true
    type: str

mm_provider:
    description: Definition of the Micetro API mm_provider
    required: true
    suboptions:
      mm_password:
        description: password to login with into the API
        no_log: true
        required: true
        type: str
      mm_url:
        description: Men&Mice API server to connect to
        required: true
        type: str
      mm_user:
        description: userid to login with into the API
        required: true
        type: str
    type: dict

Outputs

_list:
  description: A dict containing all results
  fields:
    '0': IP address(es)