Back to Ansible Reference

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

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

  Delete an ASA access rule from your SCC Firewall Manager tenant.
  The rule is identified by `uid'.
  Idempotent. Returns `changed=False' if the rule does not exist.

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

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

= uid     Unique identifier (UID) of the access rule to delete.
        type: str

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: Delete an access rule by UID
- name: Delete access rule
  cisco.sccfm.delete_access_rule:
    uid: "ac981dcd-9860-401e-a51d-c615c946b72f"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"

# Example 2: Delete using module_defaults
- name: Delete access rules
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ lookup('env', 'SCCFM_API_TOKEN') }}"
  tasks:
    - name: Delete old rule
      cisco.sccfm.delete_access_rule:
        uid: "{{ rule_uid }}"

RETURN VALUES:

- deleted_uid  The UID of the deleted access rule, or null if already
                absent.
        returned: always
        sample: ac981dcd-9860-401e-a51d-c615c946b72f
        type: str