Back to Ansible Reference

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

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

  Changes the configured ASA boot image for the next reload.
  The requested image must already exist on the device filesystem.
  Check mode validates the image path and inspects the containing
  filesystem without changing the boot configuration.
  The module persists the boot configuration and verifies the
  resulting `boot system' entry.
  The module does not upload the image and does not reload the device.
  Devices can be selected by a Lucene query or by specifying a list of
  UIDs.

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

= image_path  Full ASA image path already present on the device, such
               as `disk0:/asa9xxx.bin' or `boot:/asa9xxx.bin'.
        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

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

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: Change boot image using a query
- name: Change ASA boot image for branch devices
  cisco.sccfm.change_asa_boot_image:
    query: "name:branch-*"
    image_path: "disk0:/asa9-18-4-smp-k8.bin"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"

# Example 2: Change boot image on specific devices
- name: Change boot image on specific ASA devices
  cisco.sccfm.change_asa_boot_image:
    uids:
      - "12345678-1234-1234-1234-123456789abc"
      - "87654321-4321-4321-4321-cba987654321"
    image_path: "boot:/asa9231-smp-k8.bin"

# Example 3: Check mode
- name: Preview boot image changes
  cisco.sccfm.change_asa_boot_image:
    query: "name:prod-*"
    image_path: "disk0:/asa9-18-4-smp-k8.bin"
    # check_mode runs non-mutating pre-checks, including image path validation
    # on the device and containing-filesystem inspection.
  check_mode: true

# Example 4: Using module_defaults (recommended)
- name: Change ASA boot image
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ sccfm_api_token }}"
  tasks:
    - name: Set boot image on branch ASAs
      cisco.sccfm.change_asa_boot_image:
        query: "name:branch-*"
        image_path: "disk0:/asa9-18-4-smp-k8.bin"

RETURN VALUES:

- results  List of boot image change results, one per matched device.
        elements: dict
        returned: success
        type: list
        contains:

        - boot_system_entries_after  Boot entries after the
                                      operation.
          elements: str
          type: list

        - boot_system_entries_before  Boot entries before the
                                       operation.
          elements: str
          type: list

        - device_name  Device name.
          type: str

        - device_uid  Device UID.
          type: str

        - message  Human-readable result message.
          type: str

        - requested_image_path  Requested on-device image path.
          type: str

        - status  Outcome of the operation.
          type: str