Documentation

omapi_host - Setup OMAPI hosts.

New in version 2.3.

Synopsis

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

Options

parameter required default choices comments
ddns
no
Enable dynamic DNS updates for this host.
host
no localhost
Sets OMAPI server host to interact with.
ip
no None
Sets the lease host IP address.
key
yes
Sets the TSIG key content for authenticating against OMAPI server.
key_name
yes
Sets the TSIG key name for authenticating against OMAPI server.
macaddr
yes
Sets the lease host MAC address.
name
no None
Sets the host lease hostname (mandatory if state=present).
port
no 7911
Sets the OMAPI server port to interact with.
state
yes
  • present
  • absent
Create or remove OMAPI host.
statements
no
Attach a list of OMAPI DHCP statements with host lease (without ending semicolon).

Examples

- 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

- 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

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
changed If module has modified a host success string
lease dictionnary containing host informations success complex


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.