dellemc.enterprise_sonic.sonic_image_management module – Manage installation of Enterprise SONiC image, software patch and firmware updater

Note

This module is part of the dellemc.enterprise_sonic collection (version 2.5.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic.

To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_image_management.

New in dellemc.enterprise_sonic 2.4.0

Synopsis

  • Manage installation of Enterprise SONiC image, software patch and firmware updater.

Parameters

Parameter

Comments

firmware

dictionary

Manage installation of Firmware updater

command

string / required

Specifies the firmware updater manangement operation to be performed.

install - Stage firmware updater specified by path.

cancel - Cancel a pending firmware updater.

get-list - Retrieve details of pending firmware updater and result of installed firmware updater.

get-status - Retrieve firmware updater staging status.

Choices:

  • "install"

  • "cancel"

  • "get-list"

  • "get-status"

path

string

When command=install, specifies the path of the firmware updater to be staged.

Path can be a file in the device (file://filepath) or URL (http:// or https://).

image

dictionary

Manage installation of Enterprise SONiC image.

command

string / required

Specifies the image manangement operation to be performed.

install - Install image specified by path.

cancel - Cancel image installation.

remove - Remove image specified by name.

set-default - Set the image specified by name as default boot image.

get-list - Retrieve list of installed images.

get-status - Retrieve image installation status.

Choices:

  • "install"

  • "cancel"

  • "remove"

  • "set-default"

  • "get-list"

  • "get-status"

name

string

When command=remove or command=set-default, specifies the name of the image.

When command=remove, name can be specified as all to remove all images which are not current or next.

path

string

When command=install, specifies the path of the image to be installed.

Path can be a file in the device (file://filepath) or URL (http:// or https://).

patch

dictionary

Manage installation of software patch.

command

string / required

Specifies the patch manangement operation to be performed.

install - Install patch specified by path.

rollback - Remove an installed patch specified by name.

get-history - Retrieve history of patches applied/rolled back.

get-list - Retrieve list of installed patches.

get-status - Retrieve patch installation/removal status.

Choices:

  • "install"

  • "rollback"

  • "get-history"

  • "get-list"

  • "get-status"

name

string

When command=rollback, specifies the name of the patch.

path

string

When command=install, specifies the path of the patch to be installed.

Path can be a file in the device (file://filepath) or URL (http:// or https://).

Examples

- name: Install Enterprise SONiC image
  dellemc.enterprise_sonic.sonic_image_management:
    image:
      command: install
      path: 'file://home/admin/sonic.bin'

- name: Get image installation status
  dellemc.enterprise_sonic.sonic_image_management:
    image:
      command: get-status

- name: Get list of installed images
  dellemc.enterprise_sonic.sonic_image_management:
    image:
      command: get-list

- name: Stage a firmware updater
  dellemc.enterprise_sonic.sonic_image_management:
    firmware:
      command: install
      path: 'file://home/admin/onie-update-full.bin'

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

info

dictionary

Details returned by the specified get operation.

Returned: when command=get-status or command=get-list or command=get-history

Sample: {"file-download-speed": "106200", "file-progress": 100, "file-size": "1304997870", "file-transfer-bytes": "1304997870", "install-end-time": "1695714740", "install-start-time": "1695714698", "install-status": "INSTALL_STATE_SUCCESS", "install-status-detail": "Image install success", "operation-status": "GLOBAL_STATE_SUCCESS", "transfer-end-time": "1695714669", "transfer-start-time": "1695714657", "transfer-status": "TRANSFER_STATE_SUCCESS", "transfer-status-detail": "DOWNLOADING IMAGE"}

status

string

Status of the operation performed.

Returned: when command is not get-status, get-list and get-history

Sample: "SUCCESS"

Authors

  • Arun Saravanan Balachandran (@ArunSaravananBalachandran)