# bigip_snat_translation – Manage SNAT Translations on a BIG-IP

New in version 2.9.

- Synopsis
- Parameters
- Notes
- Examples
- Return Values
- Status

## Synopsis

- Manage SNAT Translations on a BIG-IP.

## Parameters

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

arp
boolean

Choices:
- no
- yes

If `yes`, specifies that 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 that the setting is disabled. The accepted value range is `0 - 65535`.
description string |  | Description of snat-translation. `none or ''` will set to default description of null.
ip_idle_timeout string |  | Specifies the amount of time that 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` will set 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 partition other than Common used.
provider dictionary added in 2.5 |  | 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.
| 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`.
| ssh_keyfile path |  | 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 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:
- cli
- 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`, delete the SNAT translation if it exists. `present` creates the SNAT translation and enable it. If `enabled`, enable the SNAT translation if it exists. If `disabled`, create the SNAT translation if needed, and set 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` will set 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 of `/Common/traffic-group-1` will be used.
udp_idle_timeout string |  | Specifies the amount of time that 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` will set 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 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 send 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-translaiton. Sample: My snat-translation
ip_idle_timeout string | changed | IP idle timeout value for 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 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 snat-translation. Sample: indifinite

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by an Ansible Partner. [certified]

### Authors

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

Hint

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