Fixes for nxos_config integration tests (#34579)

* deletage_to: localhost -> connection: local

* Fix test setup
This commit is contained in:
Nathaniel Case 2018-01-08 10:56:47 -05:00 committed by GitHub
parent 42dd48a6d0
commit 46263d77f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 16 deletions

View file

@ -17,11 +17,11 @@
provider: "{{ connection }}" provider: "{{ connection }}"
- name: collect any backup files - name: collect any backup files
find: find: &backups
paths: "{{ role_path }}/backup" paths: "{{ role_path }}/backup"
pattern: "{{ inventory_hostname_short }}_config*" pattern: "{{ inventory_hostname_short }}_config*"
connection: local
register: backup_files register: backup_files
delegate_to: localhost
- name: delete backup files - name: delete backup files
file: file:
@ -46,11 +46,9 @@
- "result.updates is defined" - "result.updates is defined"
- name: collect any backup files - name: collect any backup files
find: find: *backups
paths: "{{ role_path }}/backup" connection: local
pattern: "{{ inventory_hostname_short }}_config*"
register: backup_files register: backup_files
delegate_to: localhost
- assert: - assert:
that: that:

View file

@ -4,12 +4,8 @@
when: ansible_connection == "local" when: ansible_connection == "local"
- name: setup - name: setup
nxos_config: nxos_config: &clear
lines: lines: no ip access-list test
- 10 permit ip 1.1.1.1/32 any log
- 20 permit ip 2.2.2.2/32 any log
- 30 permit ip 3.3.3.3/32 any log
parents: ip access-list test
provider: "{{ connection }}" provider: "{{ connection }}"
match: none match: none
@ -51,9 +47,6 @@
- "result.changed == false" - "result.changed == false"
- name: teardown - name: teardown
nxos_config: nxos_config: *clear
lines: no ip access-list test
provider: "{{ connection }}"
match: none
- debug: msg='END connection={{ ansible_connection }}/sublevel_block.yaml' - debug: msg='END connection={{ ansible_connection }}/sublevel_block.yaml'