cisco.nxos.nxos_snapshot (7.0.0) — module

Manage snapshots of the running states of selected features.

| "added in version" 1.0.0 of cisco.nxos"

Authors: Gabriele Gerbino (@GGabriele)

Install collection

Install with ansible-galaxy collection install cisco.nxos:==7.0.0


Add to requirements.yml

  collections:
    - name: cisco.nxos
      version: 7.0.0

Description

Create snapshots of the running states of selected features, add new show commands for snapshot creation, delete and compare existing snapshots.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a snapshot and store it locally
- cisco.nxos.nxos_snapshot:
    action: create
    snapshot_name: test_snapshot
    description: Done with Ansible
    save_snapshot_locally: true
    path: /home/user/snapshots/
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete a snapshot
- cisco.nxos.nxos_snapshot:
    action: delete
    snapshot_name: test_snapshot
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete all existing snapshots
- cisco.nxos.nxos_snapshot:
    action: delete_all
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add a show command for snapshots creation
- cisco.nxos.nxos_snapshot:
    section: myshow
    show_command: show ip interface brief
    row_id: ROW_intf
    element_key1: intf-name
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Compare two snapshots
- cisco.nxos.nxos_snapshot:
    action: compare
    snapshot1: pre_snapshot
    snapshot2: post_snapshot
    comparison_results_file: compare_snapshots.txt
    compare_option: summary
    path: ../snapshot_reports/

Inputs

    
path:
    default: ./
    description:
    - Specify the path of the file where new created snapshot or snapshots comparison
      will be stored, to be used when C(action=create) and C(save_snapshot_locally=true)
      or C(action=compare).
    type: str

action:
    choices:
    - add
    - compare
    - create
    - delete
    - delete_all
    description:
    - Define what snapshot action the module would perform.
    required: true
    type: str

row_id:
    description:
    - Specifies the tag of each row entry of the show command's XML output, to be used
      when C(action=add).
    type: str

section:
    description:
    - Used to name the show command output, to be used when C(action=add).
    type: str

snapshot1:
    description:
    - First snapshot to be used when C(action=compare).
    type: str

snapshot2:
    description:
    - Second snapshot to be used when C(action=compare).
    type: str

description:
    description:
    - Snapshot description to be used when C(action=create).
    type: str

element_key1:
    description:
    - Specify the tags used to distinguish among row entries, to be used when C(action=add).
    type: str

element_key2:
    description:
    - Specify the tags used to distinguish among row entries, to be used when C(action=add).
    type: str

show_command:
    description:
    - Specify a new show command, to be used when C(action=add).
    type: str

snapshot_name:
    description:
    - Snapshot name, to be used when C(action=create) or C(action=delete).
    type: str

compare_option:
    choices:
    - summary
    - ipv4routes
    - ipv6routes
    description:
    - Snapshot options to be used when C(action=compare).
    type: str

save_snapshot_locally:
    default: false
    description:
    - Specify to locally store a new created snapshot, to be used when C(action=create).
    type: bool

comparison_results_file:
    description:
    - Name of the file where snapshots comparison will be stored when C(action=compare).
    type: str

Outputs

commands:
  description: commands sent to the device
  returned: verbose mode
  sample:
  - snapshot create post_snapshot Post-snapshot
  type: list