Back to Ansible Reference

$ ansible-doc -t module cisco.sccfm.asa_ha_check

> MODULE cisco.sccfm.asa_ha_check (sccfm-ansible/plugins/modules/asa_ha_check.py)

  Performs health checks on ASA High Availability (failover) pairs
  managed by SCC Firewall Manager.
  Executes `show failover' and `show failover state' on the target
  devices, then analyses the output for common HA issues.
  Queries the ASA Interfaces API to detect enabled interfaces that are
  not monitored for failover — a common misconfiguration that can
  silently break HA.
  Returns structured check results suitable for assertions in
  playbooks.
  Devices can be selected by a Lucene query or by specifying UIDs.

OPTIONS (= indicates it is required):

- api_token  API token for SCCFM.
        set_via:
          env:
          - name: SCCFM_API_TOKEN
        default: null
        no_log: true
        type: str

- limit   Maximum number of devices to return when using `query'.
        default: 50
        type: int

- offset  Pagination offset when using `query'.
        default: 0
        type: int

- query   Lucene query to filter ASA devices.
           Mutually exclusive with `uids'.
           The query is automatically combined with `deviceType:ASA'.
        default: null
        type: str

- region  SCCFM region (int, us, eu, apj, au, uae, in, or ci).
        set_via:
          env:
          - name: SCCFM_REGION
        default: null
        type: str

- uids    List of device UIDs to check.
           Mutually exclusive with `query'.
        default: null
        elements: str
        type: list

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: Check HA status on devices matching a query
- name: Run HA checks on production ASAs
  cisco.sccfm.asa_ha_check:
    query: "name:prod-ha-* AND connectivityState:ONLINE"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"
  register: ha_results

# Example 2: Check HA status on a specific device by UID
- name: Run HA checks on a specific ASA
  cisco.sccfm.asa_ha_check:
    uids:
      - "544d3c3b-2440-4b94-8438-74466d95909b"
  register: ha_results

# Example 3: Assert all checks pass
- name: Verify HA health
  cisco.sccfm.asa_ha_check:
    query: "asaFailoverMode:ACTIVE_STANDBY"
  register: ha_results

- name: Fail if any HA check failed
  ansible.builtin.assert:
    that: ha_results.all_passed
    fail_msg: "HA health check failures detected"

# Example 4: Using module_defaults (recommended)
- name: HA health checks
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ sccfm_api_token }}"
  tasks:
    - name: Run HA checks
      cisco.sccfm.asa_ha_check:
        query: "asaFailoverMode:ACTIVE_STANDBY AND connectivityState:ONLINE"
      register: ha_results

RETURN VALUES:

- all_passed  Whether all checks passed across all devices.
        returned: success
        type: bool

- results  List of HA check reports, one per device.
        elements: dict
        returned: success
        type: list
        contains:

        - all_passed  Whether all checks passed for this device.
          type: bool

        - checks  List of individual check results.
          elements: dict
          type: list
          contains:

          - detail  Human-readable detail.
            type: str

          - name  Check name.
            type: str

          - passed  Whether the check passed.
            type: bool

        - device_uid  The UID of the device.
          type: str

        - failover_unit  The failover unit role (Primary/Secondary).
          type: str

        - other_host_state  Failover state of the mate.
          type: str

        - this_host_state  Failover state of this host (Active,
                            Standby Ready, etc.).
          type: str

        - unmonitored_interfaces  Enabled interfaces not monitored
                                   for failover.
          elements: dict
          type: list
          contains:

          - hardware_name  Hardware interface name.
            type: str

          - name  Interface nameif.
            type: str