Back to Ansible Reference

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

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

  Retrieve the full details of an ASA access rule by UID.

OPTIONS (= indicates it is required):

- config_path  Optional path to the canonical SCCFM profile
                configuration file.
        default: null
        type: path

- profile  Named SCCFM profile configured by `sccfm-cli configure'.
        default: default
        type: str

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

AUTHOR: Cisco SCCFM Team (@CiscoDevNet)

EXAMPLES:
# Example 1: Get access rule details by UID
- name: Get access rule
  cisco.sccfm.get_access_rule:
    uid: "ac981dcd-9860-401e-a51d-c615c946b72f"
    profile: default
  register: result

- name: Show rule
  ansible.builtin.debug:
    var: result.access_rule

# Example 2: Using module_defaults
- name: Inspect access rule
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      profile: default
  tasks:
    - name: Get access rule details
      cisco.sccfm.get_access_rule:
        uid: "{{ rule_uid }}"
      register: rule_result

    - name: Show rule action
      ansible.builtin.debug:
        msg: "Rule action: {{ rule_result.access_rule.rule_action }}"

RETURN VALUES:

- access_rule  Full details of the access rule.
        returned: success
        type: dict
        contains:

        - access_group_uid  UID of the associated access group.
          type: str

        - destination_network  Destination network details.
          type: dict

        - entity_uid  UID of the device or manager.
          type: str

        - index  Position in the rule list.
          type: int

        - remark  Rule description.
          type: str

        - rule_action  PERMIT or DENY.
          type: str

        - source_network  Source network details.
          type: dict

        - uid  Unique identifier of the access rule.
          type: str