Back to Ansible Reference

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

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

  Update an ASA access rule in your SCC Firewall Manager tenant.
  The rule is identified by `uid'.
  At least one update field must be provided.
  Non-idempotent. The update is always applied.

OPTIONS (= indicates it is required):

- active  Whether the rule is active.
        default: null
        type: bool

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

- destination_network  Destination network object name.
        default: null
        type: str

- destination_port  Destination port or port range.
        default: null
        type: str

- index   New position of the rule in the ordered list.
        default: null
        type: int

- log_interval  Log interval in seconds.
        default: null
        type: int

- log_level  Log level.
        default: null
        type: str

- protocol  Protocol (e.g. tcp, udp, ip).
        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

- remark  Human-readable description of the rule.
        default: null
        type: str

- rule_action  Rule action — PERMIT or DENY.
        choices: [PERMIT, DENY]
        default: null
        type: str

- source_network  Source network object name.
        default: null
        type: str

- source_port  Source port or port range.
        default: null
        type: str

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

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: Update a rule's action
- name: Change rule to DENY
  cisco.sccfm.update_access_rule:
    uid: "ac981dcd-9860-401e-a51d-c615c946b72f"
    rule_action: DENY
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"

# Example 2: Update remark and networks using module_defaults
- name: Update 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: Update rule remark and source
      cisco.sccfm.update_access_rule:
        uid: "{{ rule_uid }}"
        remark: "Updated rule description"
        source_network: new-source-network
      register: result

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

RETURN VALUES:

- access_rule  The updated 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