ansible / ansible.builtin / v2.9.27 / module / omapi_host Setup OMAPI hosts. | "added in version" 2.3 of ansible.builtin" Authors: Loic Blot (@nerzhul) preview | supported by communityansible.builtin.omapi_host (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Manage OMAPI hosts into compatible DHCPd servers
- 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
- 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
ip: description: - Sets the lease host IP address. type: str key: description: - Sets the TSIG key content for authenticating against OMAPI server. required: true type: str ddns: default: false description: - Enable dynamic DNS updates for this host. type: bool host: default: localhost description: - Sets OMAPI server host to interact with. type: str port: default: 7911 description: - Sets the OMAPI server port to interact with. type: int state: choices: - absent - present description: - Create or remove OMAPI host. required: true type: str macaddr: description: - Sets the lease host MAC address. required: true type: str hostname: aliases: - name description: - Sets the host lease hostname (mandatory if state=present). type: str key_name: description: - Sets the TSIG key name for authenticating against OMAPI server. required: true type: str statements: default: [] description: - Attach a list of OMAPI DHCP statements with host lease (without ending semicolon). type: list
lease: contains: hardware-address: description: MAC address returned: success sample: 00:11:22:33:44:55 type: str 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: str name: description: hostname returned: success sample: mydesktop type: str description: dictionary containing host information returned: success type: complex