Back to Ansible Reference

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

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

  Removes shun entries for specific source IP addresses from one or
  more ASA devices managed by SCC Firewall Manager.
  Use `source_ip' for a single removal, or `source_ips' to remove
  multiple IPs in a single API call (more efficient than looping).
  Executes `no shun <source_ip>' on the target devices for each IP.
  `source_ip' and `source_ips' are mutually exclusive.
  Devices can be selected by a Lucene query or by specifying a list of
  UIDs.
  See
  https://developer.cisco.com/docs/cisco-security-cloud-control-firewall-manager/execute-cli-command/
  for API documentation.

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

- offset  Pagination offset when using `query'.
           Ignored when using `uids'.
        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

- source_ip  The source IP address to remove from the shun list.
              Mutually exclusive with `source_ips'.
        default: null
        type: str

- source_ips  A list of source IP addresses to remove from the shun
               list.
               All removals are sent in a single transaction.
               Mutually exclusive with `source_ip'.
        default: null
        elements: str
        type: list

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

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: Remove a single shun on devices matching a query
- name: Remove shun for attacker IP on production ASAs
  cisco.sccfm.remove_asa_shun:
    query: "name:prod-* AND connectivityState:ONLINE"
    source_ip: "10.99.99.99"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"

# Example 2: Remove multiple shuns in a single transaction
- name: Remove multiple attacker IPs in one call
  cisco.sccfm.remove_asa_shun:
    query: "connectivityState:ONLINE"
    source_ips:
      - "203.0.113.40"
      - "203.0.113.50"
      - "203.0.113.60"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"

# Example 3: Remove a shun on specific devices by UID
- name: Remove shun on specific ASA
  cisco.sccfm.remove_asa_shun:
    uids:
      - "12345678-1234-1234-1234-123456789abc"
    source_ip: "10.99.99.99"

# Example 4: Using module_defaults (recommended)
- name: Remove shun entries
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ sccfm_api_token }}"
  tasks:
    - name: Remove shun for attacker
      cisco.sccfm.remove_asa_shun:
        query: "connectivityState:ONLINE"
        source_ip: "10.99.99.99"

RETURN VALUES:

- results  List of CLI execution results per device.
        elements: dict
        returned: success
        type: list
        contains:

        - device_uid  The UID of the device.
          type: str

        - error_msg  Error message if execution failed on this device
                      (None if successful).
          type: str

        - result  The CLI command output.
          type: str

        - script  The script that was executed.
          type: str