Note
This plugin is part of the community.network collection (version 2.0.1).
To install it use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.ipadm_addr
.
Parameter | Choices/Defaults | Comments |
---|---|---|
address string | Specifiies an IP address to configure in CIDR notation. aliases: addr | |
addrobj string / required | Specifies an unique IP address on the system. | |
addrtype string |
| Specifiies a type of IP address to configure. |
state string |
| Create/delete/enable/disable an IP address on the network interface. |
temporary boolean |
| Specifies that the configured IP address is temporary. Temporary IP addresses do not persist across reboots. |
wait string | Default: 60 | Specifies the time in seconds we wait for obtaining address via DHCP. |
- name: Configure IP address 10.0.0.1 on e1000g0 community.network.ipadm_addr: addr=10.0.0.1/32 addrobj=e1000g0/v4 state=present - name: Delete addrobj community.network.ipadm_addr: addrobj=e1000g0/v4 state=absent - name: Configure link-local IPv6 address community.network.ipadm_addr: addtype=addrconf addrobj=vnic0/v6 - name: Configure address via DHCP and wait 180 seconds for address obtaining community.network.ipadm_addr: addrobj=vnic0/dhcp addrtype=dhcp wait=180
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
address string | only if addrtype is 'static' | IP address Sample: 1.3.3.7/32 |
addrobj string | always | address object name Sample: bge0/v4 |
addrtype string | always | address type Sample: static |
state string | always | state of the target Sample: present |
temporary boolean | always | specifies if operation will persist across reboots Sample: True |
wait string | only if addrtype is 'dhcp' | time we wait for DHCP Sample: 10 |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/network/ipadm_addr_module.html