paloaltonetworks.panos.panos_active_in_ha (2.19.1) — module

Checks if node is an active node in HA pair.

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

Authors: Łukasz Pawlęga (@fosix)

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

A wrapper around the PAN-OS Upgrade Assurance package.

A simple boolean check, verifies if a node is an active (B(true)) or passive (B(false)) node in an HA pair.

If node does not belong to an HA pair or the pair is no configured correctly the module will fail.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Check if a node is active in HA pair
  panos_active_in_ha:
    provider: '{{ provider }}'
  register: active_ha
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run tasks dedicated to active node
  ansible.builtin.include_tasks: active_dedicated.yml
  when: active_ha.response.active

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

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

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

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

force_fail:
    default: false
    description:
    - When set to B(true) will make the module fail also when node is passive. This option
      is useful when we want to skip using M(ansible.builtin.assert).
    type: bool

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

skip_config_sync:
    default: false
    description:
    - When set to B(true) will skip configuration synchronization state between nodes
      before trying to retrieve node's current state in an HA pair. Can be useful when
      working with partially upgraded nodes. Use with caution.
    type: bool

Outputs

response:
  contains:
    active:
      description: Information if the device is active or not.
      returned: always
      type: bool
    reason:
      description: Meaningful if the device is not active.
      returned: always
      type: str
  description:
  - Information on test results.
  - This dict is available also when module is failed.
  returned: always
  sample:
    active: true
    reason: '[SUCCESS]'
  type: dict