ansible/test/integration/targets/nxos_snapshot/tests/common/sanity.yaml
Nathaniel Case c371ed8d30
nxos tests to use network_cli (#34474)
* Fix over-byte

* Fix nxos_l2_interface docs

* Update connections for tasks

* Add default ssh port

* Only report provider when using connection=local

* Send empty provider when connection=network_cli

* Fix find tasks
2018-01-05 12:39:04 -05:00

48 lines
1.3 KiB
YAML

---
- debug: msg="START connection={{ ansible_connection }} nxos_snapshot sanity test"
- debug: msg="Using provider={{ connection.transport }}"
when: ansible_connection == "local"
- set_fact: snapshot_run="true"
- set_fact: snapshot_run="false"
when: titanium and ( connection.transport is match('nxapi'))
- 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 connection={{ ansible_connection }} nxos_snapshot sanity test"