W3cubDocs

/Ansible

f5networks.f5_modules.bigip_snat_translation – Manage SNAT translations on a BIG-IP

Note

This plugin is part of the f5networks.f5_modules collection (version 1.12.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install f5networks.f5_modules.

To use it in a playbook, specify: f5networks.f5_modules.bigip_snat_translation.

New in version 1.0.0: of f5networks.f5_modules

Synopsis

  • Manage SNAT translations on a BIG-IP system.

Parameters

Parameter Choices/Defaults Comments
address
string
Specifies the IP address of the SNAT translation. When state is present, enabled, or disabled, this parameter is required.
This parameter cannot be updated after it is set.

aliases: ip
arp
boolean
    Choices:
  • no
  • yes
If yes, specifies the NAT sends ARP requests.
connection_limit
integer
Specifies a limit on the number of connections a translation address must reach before it no longer initiates a connection. The default value of 0 indicates the setting is disabled.
The accepted value range is 0 - 65535.
description
string
Description of snat-translation. none or '' sets a default description of null.
ip_idle_timeout
string
Specifies the amount of time connections to an IP address initiated using a SNAT address are allowed to remain idle before being automatically disconnected. indefinite prevents the connection from timing out.
The accepted value range is 0 - 4294967295 seconds. Specifying indefinite sets it to the maximum value.
name
string / required
The name of SNAT translation.
partition
string
Device partition to manage resources on.
Required with state absent when a partition other than Common is used.
provider
dictionary
added in 1.0.0 of f5networks.f5_modules
A dict object containing connection details.
auth_provider
string
Configures the auth provider for to obtain authentication tokens from the remote device.
This option is really used when working with BIG-IQ devices.
no_f5_teem
boolean
    Choices:
  • no
  • yes
If yes, TEEM telemetry data is not sent to F5.
You may omit this option by setting the environment variable F5_TELEMETRY_OFF.
Previously used variable F5_TEEM is deprecated as its name was confusing.
password
string / 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
string / required
The BIG-IP host.
You may omit this option by setting the environment variable F5_SERVER.
server_port
integer
Default:
443
The BIG-IP server port.
You may omit this option by setting the environment variable F5_SERVER_PORT.
timeout
integer
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
string
    Choices:
  • rest
Configures the transport connection to use when connecting to the remote device.
user
string / 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.
state
string
    Choices:
  • present
  • absent
  • enabled
  • disabled
The SNAT translation state. If absent, deletes the SNAT translation if it exists. present creates the SNAT translation and enables it. If enabled, enables the SNAT translation if it exists. If disabled, creates the SNAT translation if needed, and sets the state to disabled.
tcp_idle_timeout
string
Specifies the amount of time that TCP connections initiated using a SNAT address are allowed to remain idle before being automatically disconnected. indefinite prevents the connection from timing out.
The accepted value range is 0 - 4294967295 seconds. Specifying indefinite sets it to the maximum value.
traffic_group
string
The traffic group for the snat-translation address. When creating a new address, if this value is not specified, the default is /Common/traffic-group-1.
udp_idle_timeout
string
Specifies the amount of time UDP connections initiated using a SNAT address are allowed to remain idle before being automatically disconnected. indefinite prevents the connection from timing out.
The accepted value range is 0 - 4294967295 seconds. Specifying indefinite sets it to the maximum value.

Notes

Note

  • For more information on using Ansible to manage F5 Networks devices see https://www.ansible.com/integrations/networks/f5.
  • 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 f5networks.f5_modules.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 a SNAT translation 'my-snat-translation'
  bigip_snat_translation:
    name: my-snat-pool
    state: present
    address: 10.10.10.10
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Modify a SNAT translation 'my-snat-translation'
  bigip_snat_translation:
    name: my-snat-pool
    state: present
    address: 10.10.10.10
    arp: no
    connection_limit: 300
    ip_idle_timeout: 1800
    tcp_idle_timeout: 1800
    udp_idle_timeout: 1800
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Disable a SNAT translation 'my-snat-translation'
  bigip_snat_translation:
    name: my-snat-pool
    state: disabled
    address: 10.10.10.10
    arp: no
    connection_limit: 300
    ip_idle_timeout: 1800
    tcp_idle_timeout: 1800
    udp_idle_timeout: 1800
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Enable a SNAT translation 'my-snat-translation'
  bigip_snat_translation:
    name: my-snat-pool
    state: enabled
    address: 10.10.10.10
    arp: no
    connection_limit: 300
    ip_idle_timeout: 1800
    tcp_idle_timeout: 1800
    udp_idle_timeout: 1800
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Create using partition other then /Common on a SNAT translation 'my-new-snat-translation'
  bigip_snat_translation:
    name: my-new-snat-pool
    state: enabled
    address: 10.10.10.10
    arp: no
    connection_limit: 300
    ip_idle_timeout: 1800
    partition: ansible
    tcp_idle_timeout: 1800
    udp_idle_timeout: 1800
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Modify using traffic group other then /Common/traffic-group-1 on a SNAT translation 'my-new-snat-translation'
  bigip_snat_translation:
    name: my-new-snat-pool
    state: enabled
    address: 10.10.10.10
    arp: no
    connection_limit: 300
    ip_idle_timeout: 1800
    partition: ansible
    tcp_idle_timeout: 1800
    traffic_group: /Common/ansible
    udp_idle_timeout: 1800
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  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 and success
IP address used for SNAT translation.

Sample:
10.10.10.10
arp
boolean
changed
Whether snat-translation sends arp requests.

Sample:
True
connection_limit
integer
changed
The new connection limit of the virtual address.

Sample:
1000
description
string
changed
Description of the snat-translation.

Sample:
My snat-translation
ip_idle_timeout
string
changed
IP idle timeout value for the snat-translation.

Sample:
300
state
string
changed
The new state of the snat-translation.

Sample:
disabled
tcp_idle_timeout
string
changed
TCP idle timeout value for the snat-translation.

Sample:
1800
traffic_group
string
changed
Assigned traffic group.

Sample:
/Common/traffic-group-1
udp_idle_timeout
string
changed
UDP idle timeout value for the snat-translation.

Sample:
indefinite


Authors

  • Greg Crosby (@crosbygw)
  • Wojciech Wypior (@wojtek0806)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/f5networks/f5_modules/bigip_snat_translation_module.html