W3cubDocs

/Ansible

omapi_host - Setup OMAPI hosts.

New in version 2.3.

Synopsis

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

Requirements (on host that executes module)

  • pypureomapi

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
dictionary containing host information
success complex
contains:
name description returned type sample
hardware-type
hardware type, generally '1'
success int 1
name
hostname
success string mydesktop
ip-address
IP address, if there is.
success string 192.168.1.5
hardware-address
MAC address
success string 00:11:22:33:44:55

Status

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

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

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/omapi_host_module.html