Back to Ansible Reference

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

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

  Apply the override value of a specific target device as the new
  `defaultContent' of the object.
  The override for that target is removed from the list; all other
  overrides and the remaining overrides are preserved.
  Supports `NETWORK_OBJECT' and `URL_OBJECT' types.

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

= target_id  UID of the target device whose override value to promote
              as the new default.
        type: str

= uid     Unique identifier (UID) of the object.
        type: str

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: Promote a device override to become the new default
- name: Apply branch office override as new default
  cisco.sccfm.apply_object_override_as_default:
    uid: "abc-123-def"
    target_id: "897b293f-132e-4678-9d78-0f0947629500"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"

# Example 2: Using module_defaults
- name: Apply object override as default
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ lookup('env', 'SCCFM_API_TOKEN') }}"
  tasks:
    - name: Apply override as default
      cisco.sccfm.apply_object_override_as_default:
        uid: "{{ object_uid }}"
        target_id: "{{ device_uid }}"
      register: apply_result

    - name: Show result
      ansible.builtin.debug:
        var: apply_result.object_override

RETURN VALUES:

- object_override  The updated object state after the override was
                    applied as the new default.
        returned: success
        type: dict
        contains:

        - name  Name of the object.
          type: str

        - object_type  Type of the object (e.g., NETWORK_OBJECT,
                        URL_OBJECT).
          type: str

        - overrides_count  Total number of overrides remaining on the
                            object.
          type: int

        - uid  Unique identifier of the object.
          type: str