mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 12:03:58 -07:00
Remove Deprecated Template network modules (#27076)
* removed deprecated networking template modules * update changelog * update changelog
This commit is contained in:
parent
0fb64214a4
commit
81151ef02c
86 changed files with 8 additions and 3420 deletions
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
testcase: "*"
|
|
@ -1,2 +0,0 @@
|
|||
dependencies:
|
||||
- prepare_eos_tests
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
- name: collect all cli test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/cli"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
- name: collect all eapi test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/eapi"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: enable eapi
|
||||
eos_eapi:
|
||||
http: yes
|
||||
https: yes
|
||||
local_http: no
|
||||
enable_socket: yes
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
|
||||
- name: disable eapi
|
||||
eos_eapi:
|
||||
state: stopped
|
||||
provider: "{{ cli }}"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
- { include: cli.yaml, tags: ['cli'] }
|
||||
- { include: eapi.yaml, tags: ['eapi'] }
|
|
@ -1,4 +0,0 @@
|
|||
interface Ethernet2
|
||||
description this is a test
|
||||
shutdown
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
interface Ethernet2
|
||||
description test description from ansible
|
||||
shutdown
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
interface Ethernet2
|
||||
description this is a test
|
||||
no shutdown
|
|
@ -1,4 +0,0 @@
|
|||
interface Ethernet2
|
||||
description this is a test
|
||||
shutdown
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- debug: msg="END cli/backup.yaml"
|
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END cli/basic.yaml"
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/defaults.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with defaults included
|
||||
eos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with defaults included
|
||||
eos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END cli/defaults.yaml"
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/force.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END cli/force.yaml"
|
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
- debug: msg="START eapi/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- debug: msg="END eapi/backup.yaml"
|
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
- debug: msg="START eapi/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END eapi/basic.yaml"
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
- debug: msg="START eapi/defaults.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: configure device with defaults included
|
||||
eos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
#- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with defaults included
|
||||
eos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
#- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END eapi/defaults.yaml"
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
- debug: msg="START eapi/force.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END eapi/force.yaml"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
testcase: "*"
|
||||
test_items: []
|
|
@ -1,2 +0,0 @@
|
|||
dependencies:
|
||||
- prepare_ios_tests
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
- name: collect all cli test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/cli"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
delegate_to: localhost
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
- { include: cli.yaml, tags: ['cli'] }
|
|
@ -1,4 +0,0 @@
|
|||
interface Loopback999
|
||||
description this is a test
|
||||
shutdown
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
interface Loopback999
|
||||
description this is a test
|
||||
no shutdown
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
ios_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
ignore_errors: yes
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure device with config
|
||||
ios_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- name: teardown
|
||||
ios_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/backup.yaml"
|
|
@ -1,37 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
ios_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
ignore_errors: yes
|
||||
|
||||
- name: configure device with config
|
||||
ios_template:
|
||||
src: basic/config.j2
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
ios_template:
|
||||
src: basic/config.j2
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: teardown
|
||||
ios_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/basic.yaml"
|
|
@ -1,37 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/defaults.yaml"
|
||||
|
||||
- name: setup
|
||||
ios_config:
|
||||
commands: no interface Loopback999
|
||||
match: none
|
||||
ignore_errors: yes
|
||||
|
||||
- name: configure device with defaults included
|
||||
ios_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with defaults included
|
||||
ios_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: teardown
|
||||
ios_config:
|
||||
commands: no interface Loopback999
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/defaults.yaml"
|
|
@ -1,39 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/force.yaml"
|
||||
|
||||
- name: setup
|
||||
ios_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
ignore_errors: yes
|
||||
|
||||
- name: configure device with config
|
||||
ios_template:
|
||||
src: basic/config.j2
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
ios_template:
|
||||
src: basic/config.j2
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: teardown
|
||||
ios_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/force.yaml"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
testcase: "*"
|
||||
test_items: []
|
|
@ -1,2 +0,0 @@
|
|||
dependencies:
|
||||
- prepare_iosxr_tests
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
- name: collect all cli test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/cli"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
delegate_to: localhost
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
- { include: cli.yaml, tags: ['cli'] }
|
|
@ -1,5 +0,0 @@
|
|||
hostname {{ inventory_hostname_short }}
|
||||
!
|
||||
interface Loopback999
|
||||
description this is a test
|
||||
shutdown
|
|
@ -1,52 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
ignore_errors: yes
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure device with config
|
||||
iosxr_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- name: teardown
|
||||
iosxr_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/backup.yaml"
|
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- name: configure device with config
|
||||
iosxr_template:
|
||||
src: basic/config.j2
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
iosxr_template:
|
||||
src: basic/config.j2
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: teardown
|
||||
iosxr_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/basic.yaml"
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/force.yaml"
|
||||
|
||||
- name: setup
|
||||
iosxr_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- name: configure device with config
|
||||
iosxr_template:
|
||||
src: basic/config.j2
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
iosxr_template:
|
||||
src: basic/config.j2
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: teardown
|
||||
iosxr_config:
|
||||
commands:
|
||||
- no interface Loopback999
|
||||
match: none
|
||||
|
||||
- debug: msg="END cli/force.yaml"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
testcase: "*"
|
||||
test_cases: []
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
- { include: netconf.yaml, tags: ['netconf'] }
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
- name: collect netconf test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/netconf"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
|
@ -1,10 +0,0 @@
|
|||
interfaces {
|
||||
lo0 {
|
||||
unit 0 {
|
||||
family inet {
|
||||
address 1.1.1.1/32;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
---
|
||||
- debug: msg="START netconf/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
junos_config:
|
||||
lines:
|
||||
- set system host-name {{ inventory_hostname_short }}
|
||||
- delete interfaces lo0
|
||||
provider: "{{ netconf }}"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure using template with backup
|
||||
junos_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'1.1.1.1/32' in result.diff.prepared"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- name: teardown
|
||||
junos_config:
|
||||
lines:
|
||||
- set system host-name {{ inventory_hostname_short }}
|
||||
- delete interfaces lo0
|
||||
provider: "{{ netconf }}"
|
||||
|
||||
- debug: msg="END netconf/backup.yaml"
|
|
@ -1,39 +0,0 @@
|
|||
---
|
||||
- debug: msg="START netconf/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
junos_config:
|
||||
lines:
|
||||
- set system host-name {{ inventory_hostname_short }}
|
||||
- delete interfaces lo0
|
||||
provider: "{{ netconf }}"
|
||||
|
||||
- name: configure basic config template
|
||||
junos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'1.1.1.1/32' in result.diff.prepared"
|
||||
|
||||
- name: check basic config template idempotent
|
||||
junos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- name: teardown
|
||||
junos_config:
|
||||
lines:
|
||||
- set system host-name {{ inventory_hostname_short }}
|
||||
- delete interfaces lo0
|
||||
provider: "{{ netconf }}"
|
||||
|
||||
- debug: msg="END netconf/basic.yaml"
|
|
@ -1,43 +0,0 @@
|
|||
---
|
||||
- debug: msg="START netconf/force.yaml"
|
||||
|
||||
- name: setup
|
||||
junos_config:
|
||||
lines:
|
||||
- set system host-name {{ inventory_hostname_short }}
|
||||
- delete interfaces lo0
|
||||
provider: "{{ netconf }}"
|
||||
|
||||
- name: configure basic config template
|
||||
junos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ netconf }}"
|
||||
action: replace
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'1.1.1.1/32' in result.diff.prepared"
|
||||
|
||||
- name: check basic config template idempotent
|
||||
junos_template:
|
||||
src: basic/config-update.j2
|
||||
action: replace
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'1.1.1.1/32' in result.diff.prepared"
|
||||
|
||||
- name: teardown
|
||||
junos_config:
|
||||
lines:
|
||||
- set system host-name {{ inventory_hostname_short }}
|
||||
- delete interfaces lo0
|
||||
action: replace
|
||||
provider: "{{ netconf }}"
|
||||
|
||||
- debug: msg="END netconf/force.yaml"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
testcase: "*"
|
||||
test_items: []
|
|
@ -1,2 +0,0 @@
|
|||
dependencies:
|
||||
- prepare_nxos_tests
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
- name: collect all cli test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/cli"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
- { include: cli.yaml, tags: ['cli'] }
|
||||
- { include: nxapi.yaml, tags: ['nxapi'] }
|
|
@ -1,28 +0,0 @@
|
|||
---
|
||||
- name: collect all nxapi test cases
|
||||
find:
|
||||
paths: "{{ role_path }}/tests/nxapi"
|
||||
patterns: "{{ testcase }}.yaml"
|
||||
register: test_cases
|
||||
|
||||
- name: set test_items
|
||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||
|
||||
- name: enable nxapi
|
||||
nxos_config:
|
||||
lines:
|
||||
- feature nxapi
|
||||
- nxapi http port 80
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: run test case
|
||||
include: "{{ test_case_to_run }}"
|
||||
with_items: "{{ test_items }}"
|
||||
loop_control:
|
||||
loop_var: test_case_to_run
|
||||
|
||||
- name: disable nxapi
|
||||
nxos_config:
|
||||
lines:
|
||||
- no feature nxapi
|
||||
provider: "{{ cli }}"
|
|
@ -1,4 +0,0 @@
|
|||
interface Ethernet2/5
|
||||
description this is a test
|
||||
shutdown
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
interface Ethernet2/5
|
||||
description test description from ansible
|
||||
shutdown
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
interface Ethernet2/5
|
||||
description this is a test
|
||||
no shutdown
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
interface Ethernet2/5
|
||||
description this is a test
|
||||
shutdown
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- debug: msg="END cli/backup.yaml"
|
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END cli/basic.yaml"
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/defaults.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with defaults included
|
||||
nxos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with defaults included
|
||||
nxos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END cli/defaults.yaml"
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
- debug: msg="START cli/force.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END cli/force.yaml"
|
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
- debug: msg="START nxapi/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ nxapi }}"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname_short }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- debug: msg="END nxapi/backup.yaml"
|
|
@ -1,36 +0,0 @@
|
|||
---
|
||||
- debug: msg="START nxapi/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ nxapi }}"
|
||||
|
||||
- name: configure device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END nxapi/basic.yaml"
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
- debug: msg="START nxapi/defaults.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ nxapi }}"
|
||||
|
||||
- name: configure device with defaults included
|
||||
nxos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with defaults included
|
||||
nxos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ nxapi }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END nxapi/defaults.yaml"
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
- debug: msg="START nxapi/force.yaml"
|
||||
|
||||
- name: setup
|
||||
nxos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet2/5
|
||||
match: none
|
||||
provider: "{{ nxapi }}"
|
||||
|
||||
- name: configure device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ nxapi }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
nxos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ nxapi }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END nxapi/force.yaml"
|
Loading…
Add table
Add a link
Reference in a new issue