Deprecated

Removed in 3.0.0

i

Reason:Updating module design to network resource modules. | Alternative:Use M(paloaltonetworks.panos.panos_nat_rule2) with I(state=gathered).

paloaltonetworks.panos.panos_nat_rule_facts (2.19.1) — module

Get information about a NAT rule.

| "added in version" 1.0.0 of paloaltonetworks.panos"

Authors: Garfield Lee Freeman (@shinmog)

Install collection

Install with ansible-galaxy collection install paloaltonetworks.panos:==2.19.1


Add to requirements.yml

  collections:
    - name: paloaltonetworks.panos
      version: 2.19.1

Description

Get information about one or more NAT rules.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get a list of all NAT rules
  paloaltonetworks.panos.panos_nat_rule_facts:
    provider: '{{ provider }}'
    listing: true
  register: res1
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: '{{ res1.listing }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get the NAT rule foo
  paloaltonetworks.panos.panos_nat_rule_facts:
    provider: '{{ provider }}'
    rule_name: 'foo'
  register: res2
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- debug:
    msg: '{{ res2.object }}'

Inputs

    
port:
    default: 443
    description:
    - B(Deprecated)
    - Use I(provider) to specify PAN-OS connectivity instead.
    - HORIZONTALLINE
    - The port number to connect to the PAN-OS device on.
    type: int

uuid:
    description:
    - Match the given rule UUID (PAN-OS 9.0+).
    - Mutually exclusive with rule_name, listing, and rule_regex.
    type: str

vsys:
    default: vsys1
    description:
    - The vsys this object belongs to.
    type: str

api_key:
    description:
    - B(Deprecated)
    - Use I(provider) to specify PAN-OS connectivity instead.
    - HORIZONTALLINE
    - The API key to use instead of generating it using I(username) / I(password).
    type: str

listing:
    description:
    - Return all rules.
    - Mutually exclusive with rule_name, rule_regex, and uuid.
    type: bool

password:
    description:
    - B(Deprecated)
    - Use I(provider) to specify PAN-OS connectivity instead.
    - HORIZONTALLINE
    - The password to use for authentication.  This is ignored if I(api_key) is specified.
    type: str

provider:
    description:
    - A dict object containing connection details.
    suboptions:
      api_key:
        description:
        - The API key to use instead of generating it using I(username) / I(password).
        type: str
      ip_address:
        description:
        - The IP address or hostname of the PAN-OS device being configured.
        type: str
      password:
        description:
        - The password to use for authentication.  This is ignored if I(api_key) is specified.
        type: str
      port:
        default: 443
        description:
        - The port number to connect to the PAN-OS device on.
        type: int
      serial_number:
        description:
        - The serial number of a firewall to use for targeted commands. If I(ip_address)
          is not a Panorama PAN-OS device, then this param is ignored.
        type: str
      username:
        default: admin
        description:
        - The username to use for authentication.  This is ignored if I(api_key) is specified.
        type: str
    type: dict
    version_added: 1.0.0
    version_added_collection: paloaltonetworks.panos

rulebase:
    choices:
    - pre-rulebase
    - rulebase
    - post-rulebase
    description:
    - The rulebase in which the rule is to exist.  If left unspecified, this defaults
      to I(rulebase=pre-rulebase) for Panorama.  For NGFW, this is always set to be I(rulebase=rulebase).
    type: str

username:
    default: admin
    description:
    - B(Deprecated)
    - Use I(provider) to specify PAN-OS connectivity instead.
    - HORIZONTALLINE
    - The username to use for authentication.  This is ignored if I(api_key) is specified.
    type: str

rule_name:
    description:
    - Name of the rule.
    - Mutually exclusive with rule_regex, listing, and uuid.
    type: str

ip_address:
    description:
    - B(Deprecated)
    - Use I(provider) to specify PAN-OS connectivity instead.
    - HORIZONTALLINE
    - The IP address or hostname of the PAN-OS device being configured.
    type: str

rule_regex:
    description:
    - A regex to match against the rule name.
    - Mutually exclusive with rule_name, listing, and uuid.
    type: str

device_group:
    default: shared
    description:
    - (Panorama only) The device group the operation should target.
    type: str

Outputs

listing:
  description: List of rules
  returned: When I(listing) or I(rule_regex) is set
  type: list
object:
  contains:
    description:
      description: Description
      type: str
    destination_ip:
      description: Destination addresses
      type: list
    destination_zone:
      description: To zones
      type: list
    dnat_address:
      description: Destination NAT translated address
      type: str
    dnat_port:
      description: Destination NAT translated port
      type: int
    nat_type:
      description: The NAT type
      type: str
    rule_name:
      description: Rule name
      type: str
    service:
      description: The service
      type: str
    snat_address_type:
      description: Type of source translation
      type: str
    snat_bidirectional:
      description: Bidirectional flag
      type: bool
    snat_dynamic_address:
      description: Source NAT translated address
      type: list
    snat_interface:
      description: Source NAT interface
      type: str
    snat_interface_address:
      description: SNAT interface address
      type: str
    snat_static_address:
      description: Static IP SNAT translated address
      type: str
    snat_type:
      description: Type of source translation
      type: str
    source_ip:
      description: Source addresses
      type: list
    source_zone:
      description: Source zone
      type: list
    tag_val:
      description: Administrative tags for this rule
      type: list
    to_interface:
      description: Egress interface from route lookup
      type: str
    uuid:
      description: The UUID of the rule (PAN-OS 9.0+)
      type: str
  description: Single rule definition
  returned: When I(rule_name) or I(uuid) is specified
  type: complex