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 3.0.0).

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.

gpg-key - Install GPG key.

verify - Verify the image specified by path using GPG or PKI method.

Choices:

  • "install"

  • "cancel"

  • "remove"

  • "set-default"

  • "get-list"

  • "get-status"

  • "gpg-key"

  • "verify"

keyserver

string

added in dellemc.enterprise_sonic 3.0.0

GPG Key server URL.

Required when command=gpg-key.

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 or command=verify specifies the path of the image to be installed.

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

pubkeyfilename

string

added in dellemc.enterprise_sonic 3.0.0

Specifies the certificate for signature file.

Required when command=verify and verifymethod=pki.

pubkeyid

string

added in dellemc.enterprise_sonic 3.0.0

GPG Key ID to be installed.

Required when command=gpg-key.

signaturefile

string

added in dellemc.enterprise_sonic 3.0.0

GPG/PKI file to be verified.

Required when command=verify.

verifymethod

string

added in dellemc.enterprise_sonic 3.0.0

Image verification GPG or PKI method

Required when command=verify.

Choices:

  • "gpg"

  • "pki"

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'

- name: Install GPG Key for image verification
  dellemc.enterprise_sonic.sonic_image_management:
    image:
      command: gpg-key
      keyserver: 'hkp://keyserver.ubuntu.com:80'
      pubkeyid: 'DAFWQGEW12345678'

- name: Verify Enterprise SONiC image
  dellemc.enterprise_sonic.sonic_image_management:
    image:
      command: verify
      path: 'home://sonic.bin'
      verifymethod: 'gpg'
      signaturefile: 'sign.gpg'

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), Aravind Mani (@aravindmani-1)