ansible / ansible.builtin / v2.5.12 / 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.5.12) — module
pip
Install with pip install ansible==2.5.12
Create, update and remove OMAPI hosts into compatible DHCPd servers.
- 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
ip: default: None description: - Sets the lease host IP address. required: false key: description: - Sets the TSIG key content for authenticating against OMAPI server. required: true ddns: default: false description: - Enable dynamic DNS updates for this host. required: false host: default: localhost description: - Sets OMAPI server host to interact with. name: default: None 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). required: false
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