community.general.ce_rollback (0.1.1) — module

Set a checkpoint or rollback to a checkpoint on HUAWEI CloudEngine switches.

Authors: Li Yanfeng (@QijunPan)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

This module offers the ability to set a configuration checkpoint file or rollback to a configuration checkpoint file on HUAWEI CloudEngine switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: rollback module test
  hosts: cloudengine
  connection: local
  gather_facts: no
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Ensure commit_id is exist, and specifies the label of the configuration rollback point to
        which system configurations are expected to roll back.
  ce_rollback:
    commit_id: 1000000748
    action: rollback
    provider: "{{ cli }}"

Inputs

    
last:
    description:
    - Specifies the number of configuration rollback points. The value is an integer that
      ranges from 1 to 80.

label:
    description:
    - Specifies a user label for a configuration rollback point. The value is a string
      of 1 to 256 case-sensitive ASCII characters, spaces not supported. The value must
      start with a letter and cannot be presented in a single hyphen (-).

action:
    choices:
    - rollback
    - clear
    - set
    - display
    - commit
    description:
    - The operation of configuration rollback.
    required: true

oldest:
    description:
    - Specifies the number of configuration rollback points. The value is an integer that
      ranges from 1 to 80.

filename:
    description:
    - Specifies a configuration file for configuration rollback. The value is a string
      of 5 to 64 case-sensitive characters in the format of *.zip, *.cfg, or *.dat, spaces
      not supported.

commit_id:
    description:
    - Specifies the label of the configuration rollback point to which system configurations
      are expected to roll back. The value is an integer that the system generates automatically.

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: bool
end_state:
  description: k/v pairs of configuration after module execution
  returned: always
  sample:
    commitId: '1000000748'
    userLabel: abc
  type: dict
existing:
  description: k/v pairs of existing rollback
  returned: sometimes
  sample:
    commitId: '1000000748'
    userLabel: abc
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: sometimes
  sample:
    action: rollback
    commit_id: '1000000748'
  type: dict
updates:
  description: command sent to the device
  returned: always
  sample:
  - rollback configuration to file a.cfg
  - set configuration commit 1000000783 label ddd
  - clear configuration commit 1000000783 label
  - display configuration commit list
  type: list