2017-10-26 17:27:55 +02:00
|
|
|
---
|
|
|
|
- debug: msg="START TRANSPORT:{{ connection.transport }} nxos_snapshot sanity test"
|
|
|
|
|
|
|
|
- set_fact: snapshot_run="true"
|
|
|
|
- set_fact: snapshot_run="false"
|
2017-11-27 23:58:08 +01:00
|
|
|
when: titanium and ( connection.transport is match('nxapi'))
|
2017-10-26 17:27:55 +02:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: create snapshot
|
|
|
|
nxos_snapshot:
|
|
|
|
action: create
|
|
|
|
snapshot_name: test_snapshot1
|
|
|
|
description: Ansible
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
- name: create another snapshot
|
|
|
|
nxos_snapshot:
|
|
|
|
action: create
|
|
|
|
snapshot_name: test_snapshot2
|
|
|
|
description: row
|
|
|
|
section: myshow
|
|
|
|
show_command: show ip interface brief
|
|
|
|
row_id: ROW_intf
|
|
|
|
element_key1: intf-name
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
- name: compare snapshots
|
|
|
|
nxos_snapshot:
|
|
|
|
action: compare
|
|
|
|
snapshot1: test_snapshot1
|
|
|
|
snapshot2: test_snapshot2
|
|
|
|
comparison_results_file: compare_snapshots.txt
|
|
|
|
compare_option: summary
|
|
|
|
path: '.'
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
|
|
|
|
when: snapshot_run
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: delete snapshot
|
|
|
|
nxos_snapshot:
|
|
|
|
action: delete_all
|
|
|
|
provider: "{{ connection }}"
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- debug: msg="END TRANSPORT:{{ connection.transport }} nxos_snapshot sanity test"
|