ansible.builtin.omapi_host (v2.7.10) — module

Setup OMAPI hosts.

| "added in version" 2.3 of ansible.builtin"

Authors: Loic Blot (@nerzhul)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.7.10

Description

Create, update and remove OMAPI hosts into compatible DHCPd servers.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a host using OMAPI
  omapi_host:
    key_name: "defomapi"
    key: "+bFQtBCta6j2vWkjPkNFtgA=="
    host: "10.1.1.1"
    macaddr: "00:66:ab:dd:11:44"
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a host using OMAPI
  omapi_host:
    key_name: "defomapi"
    key: "+bFQtBCta6j2vWkjPkNFtgA=="
    host: "10.98.4.55"
    macaddr: "44:dd:ab:dd:11:44"
    name: "server01"
    ip: "192.168.88.99"
    ddns: yes
    statements:
      - 'filename "pxelinux.0"'
      - 'next-server 1.1.1.1'
    state: present

Inputs

    
ip:
    description:
    - Sets the lease host IP address.

key:
    description:
    - Sets the TSIG key content for authenticating against OMAPI server.
    required: true

ddns:
    default: 'no'
    description:
    - Enable dynamic DNS updates for this host.
    type: bool

host:
    default: localhost
    description:
    - Sets OMAPI server host to interact with.

name:
    description:
    - Sets the host lease hostname (mandatory if state=present).

port:
    default: 7911
    description:
    - Sets the OMAPI server port to interact with.

state:
    choices:
    - present
    - absent
    description:
    - Create or remove OMAPI host.
    required: true

macaddr:
    description:
    - Sets the lease host MAC address.
    required: true

key_name:
    description:
    - Sets the TSIG key name for authenticating against OMAPI server.
    required: true

statements:
    default: []
    description:
    - Attach a list of OMAPI DHCP statements with host lease (without ending semicolon).

Outputs

changed:
  description: If module has modified a host
  returned: success
  type: string
lease:
  contains:
    hardware-address:
      description: MAC address
      returned: success
      sample: 00:11:22:33:44:55
      type: string
    hardware-type:
      description: hardware type, generally '1'
      returned: success
      sample: 1
      type: int
    ip-address:
      description: IP address, if there is.
      returned: success
      sample: 192.168.1.5
      type: string
    name:
      description: hostname
      returned: success
      sample: mydesktop
      type: string
  description: dictionary containing host information
  returned: success
  type: complex