bigip_selfip – Manage Self-IPs on a BIG-IP system

New in version 2.2.

Synopsis

  • Manage Self-IPs on a BIG-IP system.

Requirements

The below requirements are needed on the host that executes this module.

  • f5-sdk >= 3.0.16

Parameters

Parameter Choices/Defaults Comments
address
-
The IP addresses for the new self IP. This value is ignored upon update as addresses themselves cannot be changed after they are created.
This value is required when creating new self IPs.
allow_service
-
Configure port lockdown for the Self IP. By default, the Self IP has a "default deny" policy. This can be changed to allow TCP and UDP ports as well as specific protocols. This list should contain protocol:port values.
name
- / required
The self IP to create.
If this parameter is not specified, then it will default to the value supplied in the address parameter.
netmask
-
The netmask for the self IP. When creating a new Self IP, this value is required.
partition
-
added in 2.5
Default:
"Common"
Device partition to manage resources on. You can set different partitions for Self IPs, but the address used may not match any other address used by a Self IP. In that sense, Self IPs are not isolated by partitions as other resources on a BIG-IP are.
password
- / required
The password for the user account used to connect to the BIG-IP.
You may omit this option by setting the environment variable F5_PASSWORD.

aliases: pass, pwd
provider
-
added in 2.5
Default:
null
A dict object containing connection details.
password
- / required
The password for the user account used to connect to the BIG-IP.
You may omit this option by setting the environment variable F5_PASSWORD.

aliases: pass, pwd
server
- / required
The BIG-IP host.
You may omit this option by setting the environment variable F5_SERVER.
server_port
-
Default:
443
The BIG-IP server port.
You may omit this option by setting the environment variable F5_SERVER_PORT.
ssh_keyfile
-
Specifies the SSH keyfile to use to authenticate the connection to the remote device. This argument is only used for cli transports.
You may omit this option by setting the environment variable ANSIBLE_NET_SSH_KEYFILE.
timeout
-
Default:
10
Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error.
transport
- / required
    Choices:
  • rest
  • cli ←
Configures the transport connection to use when connecting to the remote device.
user
- / required
The username to connect to the BIG-IP with. This user must have administrative privileges on the device.
You may omit this option by setting the environment variable F5_USER.
validate_certs
boolean
    Choices:
  • no
  • yes ←
If no, SSL certificates are not validated. Use this only on personally controlled sites using self-signed certificates.
You may omit this option by setting the environment variable F5_VALIDATE_CERTS.
route_domain
-
added in 2.3
The route domain id of the system. When creating a new Self IP, if this value is not specified, a default value of 0 will be used.
This value cannot be changed after it is set.
server
- / required
The BIG-IP host.
You may omit this option by setting the environment variable F5_SERVER.
server_port
-
added in 2.2
Default:
443
The BIG-IP server port.
You may omit this option by setting the environment variable F5_SERVER_PORT.
state
-
    Choices:
  • absent
  • present ←
When present, guarantees that the Self-IP exists with the provided attributes.
When absent, removes the Self-IP from the system.
traffic_group
-
The traffic group for the Self IP addresses in an active-active, redundant load balancer configuration. When creating a new Self IP, if this value is not specified, the default of /Common/traffic-group-local-only will be used.
user
- / required
The username to connect to the BIG-IP with. This user must have administrative privileges on the device.
You may omit this option by setting the environment variable F5_USER.
validate_certs
boolean
added in 2.0
    Choices:
  • no
  • yes ←
If no, SSL certificates are not validated. Use this only on personally controlled sites using self-signed certificates.
You may omit this option by setting the environment variable F5_VALIDATE_CERTS.
vlan
-
The VLAN that the new self IPs will be on. When creating a new Self IP, this value is required.

Notes

Note

  • For more information on using Ansible to manage F5 Networks devices see https://www.ansible.com/integrations/networks/f5.
  • Requires the f5-sdk Python package on the host. This is as easy as pip install f5-sdk.
  • Requires BIG-IP software version >= 12.
  • The F5 modules only manipulate the running configuration of the F5 product. To ensure that BIG-IP specific configuration persists to disk, be sure to include at least one task that uses the bigip_config module to save the running configuration. Refer to the module’s documentation for the correct usage of the module to save your running configuration.

Examples

- name: Create Self IP
  bigip_selfip:
    address: 10.10.10.10
    name: self1
    netmask: 255.255.255.0
    password: secret
    server: lb.mydomain.com
    user: admin
    validate_certs: no
    vlan: vlan1
  delegate_to: localhost

- name: Create Self IP with a Route Domain
  bigip_selfip:
    server: lb.mydomain.com
    user: admin
    password: secret
    validate_certs: no
    name: self1
    address: 10.10.10.10
    netmask: 255.255.255.0
    vlan: vlan1
    route_domain: 10
    allow_service: default
  delegate_to: localhost

- name: Delete Self IP
  bigip_selfip:
    name: self1
    password: secret
    server: lb.mydomain.com
    state: absent
    user: admin
    validate_certs: no
  delegate_to: localhost

- name: Allow management web UI to be accessed on this Self IP
  bigip_selfip:
    name: self1
    password: secret
    server: lb.mydomain.com
    state: absent
    user: admin
    validate_certs: no
    allow_service:
      - tcp:443
  delegate_to: localhost

- name: Allow HTTPS and SSH access to this Self IP
  bigip_selfip:
    name: self1
    password: secret
    server: lb.mydomain.com
    state: absent
    user: admin
    validate_certs: no
    allow_service:
      - tcp:443
      - tcp:22
  delegate_to: localhost

- name: Allow all services access to this Self IP
  bigip_selfip:
    name: self1
    password: secret
    server: lb.mydomain.com
    state: absent
    user: admin
    validate_certs: no
    allow_service:
      - all
  delegate_to: localhost

- name: Allow only GRE and IGMP protocols access to this Self IP
  bigip_selfip:
    name: self1
    password: secret
    server: lb.mydomain.com
    state: absent
    user: admin
    validate_certs: no
    allow_service:
      - gre:0
      - igmp:0
  delegate_to: localhost

- name: Allow all TCP, but no other protocols access to this Self IP
  bigip_selfip:
    name: self1
    password: secret
    server: lb.mydomain.com
    state: absent
    user: admin
    validate_certs: no
    allow_service:
      - tcp:0
  delegate_to: localhost

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
address
string
changed
The address for the Self IP

Sample:
192.0.2.10
allow_service
list
changed
Services that allowed via this Self IP

Sample:
['igmp:0', 'tcp:22', 'udp:53']
name
string
created
The name of the Self IP

Sample:
self1
netmask
string
changed
The netmask of the Self IP

Sample:
255.255.255.0
traffic_group
string
changed
The traffic group that the Self IP is a member of

Sample:
traffic-group-local-only
vlan
string
changed
The VLAN set on the Self IP

Sample:
vlan1


Status

  • This module is guaranteed to have no backward incompatible interface changes going forward. [stableinterface]
  • This module is maintained by an Ansible Partner. [certified]

Authors

  • Tim Rupp (@caphrim007)

Hint

If you notice any issues in this documentation you can edit this document to improve it.