fmgd_firewall_centralsnatmap – Configure IPv4 and IPv6 central SNAT policies.
Added in version 1.1.0.
Synopsis
This module is able to configure a FortiManager device.
Examples include all parameters and values need to be adjusted to data sources before usage.
Tested with FortiManager v7.x.
Requirements
The below requirements are needed on the host that executes this module.
ansible-core>=2.16.0
FortiManager Version Compatibility
Supported Version Ranges: v7.4.8 -> v7.4.10, v7.6.4 -> latest
Parameters
- access_token -The token to access FortiManager without using username and password. type: str required: false
- bypass_validation - Only set to True when module schema diffs with FortiManager API structure, module continues to execute without validating parameters. type: bool required: false default: False
- enable_log - Enable/Disable logging for task. type: bool required: false default: False
- forticloud_access_token - Access token of forticloud managed API users, this option is available with FortiManager later than 6.4.0. type: str required: false
- proposed_method - The overridden method for the underlying Json RPC request. type: str required: false choices: set, update, add
- rc_succeeded - The rc codes list with which the conditions to succeed will be overriden. type: list required: false
- rc_failed - The rc codes list with which the conditions to fail will be overriden. type: list required: false
- state - The directive to create, update or delete an object type: str required: true choices: present, absent
- workspace_locking_adom - Acquire the workspace lock if FortiManager is running in workspace mode. type: str required: false choices: global, custom adom including root
- workspace_locking_timeout - The maximum time in seconds to wait for other users to release workspace lock. type: integer required: false default: 300
- device - The parameter in requested url type: str required: true
- vdom - The parameter in requested url type: str required: true
- firewall_centralsnatmap - Configure IPv4 and IPv6 central SNAT policies. type: dict
- action Central snat action. type: str choices: [bypass, masquerade, ippool] more...
- dst_addr (Alias name: dst-addr) Ipv4 destination address. type: list more...
- dst_addr6 (Alias name: dst-addr6) Ipv6 destination address. type: list more...
- dstintf Destination interface name from available interfaces. type: list more...
- ipv6 Enable/disable ipv6. type: str choices: [disable, enable] more...
- nat_ippool (Alias name: nat-ippool) Name of the ip pools to be used to translate addresses from available ip pools. type: list more...
- nat_ippool6 (Alias name: nat-ippool6) Ipv6 pools to be used for source nat. type: list more...
- policyid Policy id. type: int more...
- src_addr (Alias name: src-addr) Original source address. type: list more...
- src_addr6 (Alias name: src-addr6) Original ipv6 source address. type: list more...
- srcintf Source interface name from available interfaces. type: list more...
- status Enable/disable the active status of this policy. type: str choices: [disable, enable] more...
- protocol Integer value for the protocol type (0 - 255). type: int more...
- orig_port (Alias name: orig-port) Original tcp port (1 to 65535, 0 means any port). type: str more...
- dst_port (Alias name: dst-port) Destination port or port range (1 to 65535, 0 means any port). type: str more...
- nat64 Enable/disable nat64. type: str choices: [disable, enable] more...
- nat46 Enable/disable nat46. type: str choices: [disable, enable] more...
- comments Comment. type: str more...
- orig_addr6 (Alias name: orig-addr6) Ipv6 original address. type: list more...
- nat Enable/disable source nat. type: str choices: [disable, enable] more...
- uuid Universally unique identifier (uuid; automatically assigned but can be manually reset). type: str more...
- nat_port (Alias name: nat-port) Translated port or port range (1 to 65535, 0 means any port). type: str more...
- orig_addr (Alias name: orig-addr) Ipv4 original address. type: list more...
- port_preserve (Alias name: port-preserve) Enable/disable preservation of the original source port from source nat if it has not been used. type: str choices: [disable, enable] more...
- type Ipv4/ipv6 source nat. type: str choices: [ipv4, ipv6] more...
- port_random (Alias name: port-random) Enable/disable random source port selection for source nat. type: str choices: [disable, enable] more...
Notes
Note
Running in workspace locking mode is supported in this FortiManager module, the top level parameters workspace_locking_adom and workspace_locking_timeout help do the work.
To create or update an object, use state: present directive.
To delete an object, use state: absent directive
Normally, running one module can fail when a non-zero rc is returned. you can also override the conditions to fail or succeed with parameters rc_failed and rc_succeeded
Examples
- name: Example playbook (generated based on argument schema)
hosts: fortimanagers
connection: httpapi
gather_facts: false
vars:
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
ansible_httpapi_port: 443
tasks:
- name: Configure IPv4 and IPv6 central SNAT policies.
fortinet.fmgdevice.fmgd_firewall_centralsnatmap:
# bypass_validation: false
# workspace_locking_adom: <global or your adom name>
# workspace_locking_timeout: 300
# rc_succeeded: [0, -2, -3, ...]
# rc_failed: [-2, -3, ...]
device: <your own value>
vdom: <your own value>
state: present # <value in [present, absent]>
firewall_centralsnatmap:
policyid: 0 # Required variable, integer
# action: <value in [bypass, masquerade, ippool]>
# dst_addr: <list or string>
# dst_addr6: <list or string>
# dstintf: <list or string>
# ipv6: <value in [disable, enable]>
# nat_ippool: <list or string>
# nat_ippool6: <list or string>
# src_addr: <list or string>
# src_addr6: <list or string>
# srcintf: <list or string>
# status: <value in [disable, enable]>
# protocol: <integer>
# orig_port: <string>
# dst_port: <string>
# nat64: <value in [disable, enable]>
# nat46: <value in [disable, enable]>
# comments: <string>
# orig_addr6: <list or string>
# nat: <value in [disable, enable]>
# uuid: <string>
# nat_port: <string>
# orig_addr: <list or string>
# port_preserve: <value in [disable, enable]>
# type: <value in [ipv4, ipv6]>
# port_random: <value in [disable, enable]>
Return Values
Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:
- meta - The result of the request.returned: always type: dict
- request_url - The full url requested. returned: always type: str sample: /sys/login/user
- response_code - The status of api request. returned: always type: int sample: 0
- response_data - The data body of the api response. returned: optional type: list or dict
- response_message - The descriptive message of the api response. returned: always type: str sample: OK
- system_information - The information of the target system. returned: always type: dict
- rc - The status the request. returned: always type: int sample: 0
- version_check_warning - Warning if the parameters used in the playbook are not supported by the current FortiManager version. returned: if at least one parameter not supported by the current FortiManager version type: list
Status
This module is not guaranteed to have a backwards compatible interface.