Back to Ansible Reference

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

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

  Queries ASA devices managed by SCC Firewall Manager and returns only
  those that are NOT currently running the specified software version.
  Useful for identifying devices that still need upgrading to a target
  version.
  Devices can be filtered by a Lucene query or by specifying a list of
  UIDs. If neither is provided, all ASA devices are checked.
  Version comparison is performed client-side against the
  `softwareVersion' field returned by the inventory API.

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 fetch when using `query' or no
           filter.
           Ignored when using `uids'.
        default: 50
        type: int

- offset  Pagination offset when using `query' or no filter.
           Ignored when using `uids'.
        default: 0
        type: int

- query   Lucene query to narrow the set of ASA devices to check.
           Mutually exclusive with `uids'.
           The query is automatically combined with `deviceType:ASA'.
           If omitted, all ASA devices are checked.
        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'.
           If omitted, all ASA devices are checked (or those matching
           `query').
        default: null
        elements: str
        type: list

= version  The target software version to check against (e.g.
            `9.20(3'13)).
            Devices NOT running this exact version will be returned.
        type: str

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: List all ASAs not on a specific version
- name: Find ASAs not on 9.20(3)13
  cisco.sccfm.list_asa_not_on_version:
    version: "9.20(3)13"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"
  register: result

- name: Show devices that need upgrading
  ansible.builtin.debug:
    msg: "{{ item.name }} is on {{ item.software_version }}"
  loop: "{{ result.devices }}"

# Example 2: Filter by name pattern
- name: Find branch ASAs not on 9.20(3)13
  cisco.sccfm.list_asa_not_on_version:
    version: "9.20(3)13"
    query: "name:branch-*"
  register: result

# Example 3: Check specific devices by UID
- name: Check specific ASAs
  cisco.sccfm.list_asa_not_on_version:
    version: "9.20(3)13"
    uids:
      - "12345678-1234-1234-1234-123456789abc"
      - "87654321-4321-4321-4321-cba987654321"
  register: result

# Example 4: Using module_defaults (recommended)
- name: Identify devices needing upgrade
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ sccfm_api_token }}"
  tasks:
    - name: Find ASAs not on target version
      cisco.sccfm.list_asa_not_on_version:
        version: "9.20(3)13"
      register: result

    - name: Fail if any devices are not on target version
      ansible.builtin.fail:
        msg: "{{ result.device_count }} device(s) not on target version"
      when: result.device_count > 0

RETURN VALUES:

- device_count  Number of devices not on the specified version.
        returned: success
        type: int

- devices  List of ASA devices that are NOT running the specified
            version.
        elements: dict
        returned: success
        type: list
        contains:

        - asdm_version  The current ASDM version running on the
                         device.
          type: str

        - config_state  The device configuration state.
          type: str

        - connectivity_state  The device connectivity state.
          type: str

        - name  The device name.
          type: str

        - software_version  The current software version running on
                             the device.
          type: str

        - uid  The UID of the device.
          type: str

- matched_device_count  Number of ASA devices matched before version
                         comparison.
        returned: success
        type: int