menandmice.ansible_micetro.freeip (1.0.7) — lookup

Find free IP address(es) in a given network range in the Micetro

| "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 returns free IP address(es) in a range or ranges specified by the network names C(e.g. examplenet). This can be a string or a list

If multiple IP addresses are returned, the results will be returned as a comma-separated list. In such cases you may want to pass option C(wantlist=True) to the plugin, which will result in the record values being returned as a list over which you can iterate later on (or use C(query) instead)

Inputs

    
ping:
    default: false
    description: ping the address found before returning
    required: false
    type: bool

claim:
    description: Claim the IP address(es) for the specified amount of time in seconds
    required: false
    type: int

multi:
    default: false
    description: Get a list of x number of free IP addresses from the requested zones
    required: false
    type: int

filter:
    default: None
    description:
    - Micetro filter statement
    - Filter validation is done by the Micetro, not in the plugin
    - More filter info on https://docs.menandmice.com/display/MM930/Quickfilter
    required: false
    type: str

network:
    description:
    - network zone(s) from which the first free IP address is to be found.
    - This is either a single network or a list of networks
    required: true
    type: list

excludedhcp:
    default: false
    description: exclude DHCP reserved ranges from result
    required: false
    type: bool

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

startaddress:
    default: None
    description:
    - Start address when looking for the next free address
    - When the start address is not in de zone it will be ignored
    required: false
    type: str

Outputs

_list:
  description: A list containing the free IP address(es) in the network range
  fields:
    '0': IP address(es)