On this page
omapi_host - Setup OMAPI hosts.
New in version 2.3.
Synopsis
- Create, update and remove OMAPI hosts into compatible DHCPd servers.
Requirements
The below requirements are needed on the host that executes this module.
- pypureomapi
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
ddns
bool
|
|
Enable dynamic DNS updates for this host.
|
host | Default:
"localhost"
|
Sets OMAPI server host to interact with.
|
ip |
Sets the lease host IP address.
|
|
key
required
|
Sets the TSIG key content for authenticating against OMAPI server.
|
|
key_name
required
|
Sets the TSIG key name for authenticating against OMAPI server.
|
|
macaddr
required
|
Sets the lease host MAC address.
|
|
name |
Sets the host lease hostname (mandatory if state=present).
|
|
port | Default:
7911
|
Sets the OMAPI server port to interact with.
|
state
required
|
|
Create or remove OMAPI host.
|
statements | Default:
[]
|
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, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
changed
string
|
success |
If module has modified a host
|
|
lease
complex
|
success |
dictionary containing host information
|
|
ip-address
string
|
success |
IP address, if there is.
Sample:
192.168.1.5
|
|
hardware-address
string
|
success |
MAC address
Sample:
00:11:22:33:44:55
|
|
hardware-type
int
|
success |
hardware type, generally '1'
Sample:
1
|
|
name
string
|
success |
hostname
Sample:
mydesktop
|
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Maintenance
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Author
- Loic Blot (@nerzhul)
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.6/modules/omapi_host_module.html