ansible / ansible.builtin / v2.7.18 / module / panos_nat_rule create a policy NAT rule | "added in version" 2.4 of ansible.builtin" Authors: Luigi Mori (@jtschichold), Ivan Bojer (@ivanbojer), Robert Hagen (@rnh556) preview | supported by communityansible.builtin.panos_nat_rule (v2.7.18) — module
pip
Install with pip install ansible==2.7.18
- Create a policy nat rule. Keep in mind that we can either end up configuring source NAT, destination NAT, or both. Instead of splitting it into two we will make a fair attempt to determine which one the user wants.
# Create a source and destination nat rule - name: Create NAT SSH rule for 10.0.1.101 panos_nat_rule: ip_address: '{{ ip_address }}' username: '{{ username }}' password: '{{ password }}' rule_name: "Web SSH" source_zone: ["external"] destination_zone: "external" source: ["any"] destination: ["10.0.0.100"] service: "service-tcp-221" snat_type: "dynamic-ip-and-port" snat_interface: "ethernet1/2" dnat_address: "10.0.1.101" dnat_port: "22"
commit: default: 'yes' description: - Commit configuration if changed. type: bool api_key: description: - API key that can be used instead of I(username)/I(password) credentials. service: default: any description: - service password: description: - Password credentials to use for auth unless I(api_key) is set. required: true username: default: admin description: - Username credentials to use for auth unless I(api_key) is set. dnat_port: description: - dnat translated port operation: description: - The action to be taken. Supported values are I(add)/I(update)/I(find)/I(delete). rule_name: description: - name of the SNAT rule required: true snat_type: description: - type of source translation source_ip: default: - any description: - list of source addresses ip_address: description: - IP address (or hostname) of PAN-OS device being configured. required: true source_zone: description: - list of source zones required: true dnat_address: description: - dnat translated address destination_ip: default: - any description: - list of destination addresses snat_interface: description: - snat interface destination_zone: description: - destination zone required: true snat_address_type: default: translated-address description: - type of source translation. Supported values are I(translated-address)/I(translated-address). snat_bidirectional: default: 'no' description: - bidirectional flag type: bool snat_static_address: description: - Source NAT translated address. Used with Static-IP translation. snat_dynamic_address: description: - Source NAT translated address. Used with Dynamic-IP and Dynamic-IP-and-Port. snat_interface_address: description: - snat interface address