community.general.ipadm_addr (0.1.1) — module

Manage IP addresses on an interface on Solaris/illumos systems

Authors: Adam Števko (@xen0l)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Create/delete static/dynamic IP addresses on network interfaces on Solaris/illumos systems.

Up/down static/dynamic IP addresses on network interfaces on Solaris/illumos systems.

Manage IPv6 link-local addresses on network interfaces on Solaris/illumos systems.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure IP address 10.0.0.1 on e1000g0
  ipadm_addr: addr=10.0.0.1/32 addrobj=e1000g0/v4 state=present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete addrobj
  ipadm_addr: addrobj=e1000g0/v4 state=absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure link-local IPv6 address
  ipadm_addr: addtype=addrconf addrobj=vnic0/v6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Configure address via DHCP and wait 180 seconds for address obtaining
  ipadm_addr: addrobj=vnic0/dhcp addrtype=dhcp wait=180

Inputs

    
wait:
    default: 60
    description:
    - Specifies the time in seconds we wait for obtaining address via DHCP.
    required: false

state:
    choices:
    - absent
    - present
    - up
    - down
    - enabled
    - disabled
    - refreshed
    default: present
    description:
    - Create/delete/enable/disable an IP address on the network interface.
    required: false

address:
    aliases:
    - addr
    description:
    - Specifiies an IP address to configure in CIDR notation.
    required: false

addrobj:
    description:
    - Specifies an unique IP address on the system.
    required: true

addrtype:
    choices:
    - static
    - dhcp
    - addrconf
    default: static
    description:
    - Specifiies a type of IP address to configure.
    required: false

temporary:
    default: false
    description:
    - Specifies that the configured IP address is temporary. Temporary IP addresses do
      not persist across reboots.
    required: false
    type: bool

Outputs

address:
  description: IP address
  returned: only if addrtype is 'static'
  sample: 1.3.3.7/32
  type: str
addrobj:
  description: address object name
  returned: always
  sample: bge0/v4
  type: str
addrtype:
  description: address type
  returned: always
  sample: static
  type: str
state:
  description: state of the target
  returned: always
  sample: present
  type: str
temporary:
  description: specifies if operation will persist across reboots
  returned: always
  sample: true
  type: bool
wait:
  description: time we wait for DHCP
  returned: only if addrtype is 'dhcp'
  sample: 10
  type: str