mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Swap how become is specified for ios integration tests (#34107)
This commit is contained in:
parent
427479ae48
commit
5f215337c9
49 changed files with 28 additions and 202 deletions
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
banner: login
|
banner: login
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Set login
|
- name: Set login
|
||||||
ios_banner:
|
ios_banner:
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
string
|
string
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
string
|
string
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
banner: motd
|
banner: motd
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Set motd
|
- name: Set motd
|
||||||
ios_banner:
|
ios_banner:
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
string
|
string
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
string
|
string
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -7,14 +7,12 @@
|
||||||
over multiple lines
|
over multiple lines
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: remove login
|
- name: remove login
|
||||||
ios_banner:
|
ios_banner:
|
||||||
banner: login
|
banner: login
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
|
@ -30,7 +28,6 @@
|
||||||
banner: login
|
banner: login
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
authorize: yes
|
authorize: yes
|
||||||
wait_for:
|
wait_for:
|
||||||
- "result[0] contains 'Description: Foo'"
|
- "result[0] contains 'Description: Foo'"
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
wait_for:
|
wait_for:
|
||||||
- "result[0] contains Cisco"
|
- "result[0] contains Cisco"
|
||||||
- "result[1] contains Loopback888"
|
- "result[1] contains Loopback888"
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
ios_command:
|
ios_command:
|
||||||
commands: show foo
|
commands: show foo
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
@ -19,7 +18,6 @@
|
||||||
- show version
|
- show version
|
||||||
- show foo
|
- show foo
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
commands:
|
commands:
|
||||||
- show version
|
- show version
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -20,7 +19,6 @@
|
||||||
- show version
|
- show version
|
||||||
- show interfaces
|
- show interfaces
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
authorize: yes
|
authorize: yes
|
||||||
wait_for:
|
wait_for:
|
||||||
- "result[0] contains bad_value_string"
|
- "result[0] contains bad_value_string"
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
- interface Loopback999
|
- interface Loopback999
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: collect any backup files
|
- name: collect any backup files
|
||||||
find:
|
find:
|
||||||
|
@ -30,7 +29,6 @@
|
||||||
src: basic/config.j2
|
src: basic/config.j2
|
||||||
backup: yes
|
backup: yes
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -10,14 +10,12 @@
|
||||||
- interface Loopback999
|
- interface Loopback999
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure device with defaults included
|
- name: configure device with defaults included
|
||||||
ios_config:
|
ios_config:
|
||||||
src: defaults/config.j2
|
src: defaults/config.j2
|
||||||
defaults: yes
|
defaults: yes
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug: var=result
|
- debug: var=result
|
||||||
|
@ -33,7 +31,6 @@
|
||||||
src: defaults/config.j2
|
src: defaults/config.j2
|
||||||
defaults: yes
|
defaults: yes
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug: var=result
|
- debug: var=result
|
||||||
|
@ -48,7 +45,6 @@
|
||||||
lines:
|
lines:
|
||||||
- mac-address-table notification mac-move
|
- mac-address-table notification mac-move
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: show interfaces brief to ensure deivce goes to valid prompt
|
- name: show interfaces brief to ensure deivce goes to valid prompt
|
||||||
|
@ -56,7 +52,6 @@
|
||||||
commands:
|
commands:
|
||||||
- show interfaces
|
- show interfaces
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -10,14 +10,12 @@
|
||||||
- interface Loopback999
|
- interface Loopback999
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
|
|
||||||
- name: save config
|
- name: save config
|
||||||
ios_config:
|
ios_config:
|
||||||
save: true
|
save: true
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
@ -32,7 +30,6 @@
|
||||||
ios_config:
|
ios_config:
|
||||||
save: true
|
save: true
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
@ -44,7 +41,6 @@
|
||||||
- "no ip http server"
|
- "no ip http server"
|
||||||
save_when: modified
|
save_when: modified
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: save should always run
|
- name: save should always run
|
||||||
|
@ -54,7 +50,6 @@
|
||||||
- "ip http server"
|
- "ip http server"
|
||||||
save_when: modified
|
save_when: modified
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -66,7 +61,6 @@
|
||||||
lines:
|
lines:
|
||||||
- "no ip http server"
|
- "no ip http server"
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -10,13 +10,11 @@
|
||||||
- interface Loopback999
|
- interface Loopback999
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure device with config
|
- name: configure device with config
|
||||||
ios_config:
|
ios_config:
|
||||||
src: basic/config.j2
|
src: basic/config.j2
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: debug, remove me
|
- name: debug, remove me
|
||||||
|
@ -33,7 +31,6 @@
|
||||||
ios_config:
|
ios_config:
|
||||||
src: basic/config.j2
|
src: basic/config.j2
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
ios_config:
|
ios_config:
|
||||||
src: basic/foobar.j2
|
src: basic/foobar.j2
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,12 @@
|
||||||
- interface Loopback999
|
- interface Loopback999
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure device with config
|
- name: configure device with config
|
||||||
ios_config:
|
ios_config:
|
||||||
src: basic/config.j2
|
src: basic/config.j2
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -31,7 +29,6 @@
|
||||||
ios_config:
|
ios_config:
|
||||||
src: basic/config.j2
|
src: basic/config.j2
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -8,14 +8,12 @@
|
||||||
- 'no ip access-list standard test'
|
- 'no ip access-list standard test'
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure sub level command
|
- name: configure sub level command
|
||||||
ios_config:
|
ios_config:
|
||||||
lines: ['permit ip any any log']
|
lines: ['permit ip any any log']
|
||||||
parents: ['ip access-list extended test']
|
parents: ['ip access-list extended test']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -29,7 +27,6 @@
|
||||||
lines: ['permit ip any any log']
|
lines: ['permit ip any any log']
|
||||||
parents: ['ip access-list extended test']
|
parents: ['ip access-list extended test']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -42,6 +39,5 @@
|
||||||
- 'no ip access-list extended test'
|
- 'no ip access-list extended test'
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
after: ['exit']
|
after: ['exit']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
match: none
|
match: none
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure sub level command using block resplace
|
- name: configure sub level command using block resplace
|
||||||
ios_config:
|
ios_config:
|
||||||
|
@ -25,7 +24,6 @@
|
||||||
replace: block
|
replace: block
|
||||||
after: ['exit']
|
after: ['exit']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -48,7 +46,6 @@
|
||||||
replace: block
|
replace: block
|
||||||
after: ['exit']
|
after: ['exit']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -61,6 +58,5 @@
|
||||||
- no ip access-list extended test
|
- no ip access-list extended test
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
after: exit
|
after: exit
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure sub level command using exact match
|
- name: configure sub level command using exact match
|
||||||
ios_config:
|
ios_config:
|
||||||
|
@ -28,7 +27,6 @@
|
||||||
after: exit
|
after: exit
|
||||||
match: exact
|
match: exact
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -51,7 +49,6 @@
|
||||||
parents: ip access-list extended test
|
parents: ip access-list extended test
|
||||||
match: exact
|
match: exact
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -64,6 +61,5 @@
|
||||||
- no ip access-list extended test
|
- no ip access-list extended test
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
before: no ip access-list extended test
|
before: no ip access-list extended test
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure sub level command using strict match
|
- name: configure sub level command using strict match
|
||||||
ios_config:
|
ios_config:
|
||||||
|
@ -25,7 +24,6 @@
|
||||||
parents: ip access-list extended test
|
parents: ip access-list extended test
|
||||||
match: strict
|
match: strict
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -42,7 +40,6 @@
|
||||||
after: exit
|
after: exit
|
||||||
match: strict
|
match: strict
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -60,6 +57,5 @@
|
||||||
lines: no ip access-list extended test
|
lines: no ip access-list extended test
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -6,13 +6,11 @@
|
||||||
lines: ['hostname {{ shorter_hostname }}']
|
lines: ['hostname {{ shorter_hostname }}']
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure top level command
|
- name: configure top level command
|
||||||
ios_config:
|
ios_config:
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -24,7 +22,6 @@
|
||||||
ios_config:
|
ios_config:
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -36,6 +33,5 @@
|
||||||
lines: ['hostname {{ shorter_hostname }}']
|
lines: ['hostname {{ shorter_hostname }}']
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -8,14 +8,12 @@
|
||||||
- "hostname {{ shorter_hostname }}"
|
- "hostname {{ shorter_hostname }}"
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure top level command with before
|
- name: configure top level command with before
|
||||||
ios_config:
|
ios_config:
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
after: ['snmp-server contact bar']
|
after: ['snmp-server contact bar']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -29,7 +27,6 @@
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
after: ['snmp-server contact foo']
|
after: ['snmp-server contact foo']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -43,6 +40,5 @@
|
||||||
- "hostname {{ shorter_hostname }}"
|
- "hostname {{ shorter_hostname }}"
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -8,14 +8,12 @@
|
||||||
- "hostname {{ shorter_hostname }}"
|
- "hostname {{ shorter_hostname }}"
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure top level command with before
|
- name: configure top level command with before
|
||||||
ios_config:
|
ios_config:
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
before: ['snmp-server contact bar']
|
before: ['snmp-server contact bar']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -29,7 +27,6 @@
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
before: ['snmp-server contact foo']
|
before: ['snmp-server contact foo']
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -43,6 +40,5 @@
|
||||||
- "hostname {{ shorter_hostname }}"
|
- "hostname {{ shorter_hostname }}"
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -6,14 +6,12 @@
|
||||||
lines: ['hostname {{ shorter_hostname }}']
|
lines: ['hostname {{ shorter_hostname }}']
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure top level command
|
- name: configure top level command
|
||||||
ios_config:
|
ios_config:
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
match: strict
|
match: strict
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -26,7 +24,6 @@
|
||||||
lines: ['hostname foo']
|
lines: ['hostname foo']
|
||||||
match: strict
|
match: strict
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -38,6 +35,5 @@
|
||||||
lines: ['hostname {{ shorter_hostname }}']
|
lines: ['hostname {{ shorter_hostname }}']
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
gather_subset:
|
gather_subset:
|
||||||
- all
|
- all
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
- name: test getting default facts
|
- name: test getting default facts
|
||||||
ios_facts:
|
ios_facts:
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
gather_subset:
|
gather_subset:
|
||||||
- "foobar"
|
- "foobar"
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
@ -31,7 +30,6 @@
|
||||||
- "!hardware"
|
- "!hardware"
|
||||||
- "hardware"
|
- "hardware"
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
gather_subset:
|
gather_subset:
|
||||||
- "!hardware"
|
- "!hardware"
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
ios_command:
|
ios_command:
|
||||||
commands: show version
|
commands: show version
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: show_version_result
|
register: show_version_result
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
@ -24,7 +23,6 @@
|
||||||
- no negotiation auto
|
- no negotiation auto
|
||||||
parents: int GigabitEthernet2
|
parents: int GigabitEthernet2
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Set test interface 2 to GigabitEthernet3 as we are on Cisco IOS-XE
|
- name: Set test interface 2 to GigabitEthernet3 as we are on Cisco IOS-XE
|
||||||
set_fact: test_interface2=GigabitEthernet3
|
set_fact: test_interface2=GigabitEthernet3
|
||||||
|
@ -34,7 +32,6 @@
|
||||||
- no negotiation auto
|
- no negotiation auto
|
||||||
parents: int GigabitEthernet3
|
parents: int GigabitEthernet3
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
when: "'Cisco IOS-XE' in show_version_result.stdout[0]"
|
when: "'Cisco IOS-XE' in show_version_result.stdout[0]"
|
||||||
|
|
||||||
- name: Configure interface (setup)
|
- name: Configure interface (setup)
|
||||||
|
@ -45,7 +42,6 @@
|
||||||
mtu: 1800
|
mtu: 1800
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Configure interface
|
- name: Configure interface
|
||||||
|
@ -54,7 +50,6 @@
|
||||||
description: test-interface-initial
|
description: test-interface-initial
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -69,7 +64,6 @@
|
||||||
description: test-interface-initial
|
description: test-interface-initial
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -83,7 +77,6 @@
|
||||||
mtu: 2000
|
mtu: 2000
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -100,7 +93,6 @@
|
||||||
mtu: 1800
|
mtu: 1800
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -115,7 +107,6 @@
|
||||||
name: "{{ test_interface }}"
|
name: "{{ test_interface }}"
|
||||||
enabled: False
|
enabled: False
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -129,7 +120,6 @@
|
||||||
name: "{{ test_interface }}"
|
name: "{{ test_interface }}"
|
||||||
enabled: True
|
enabled: True
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -146,7 +136,6 @@
|
||||||
mtu: 1800
|
mtu: 1800
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Add interface aggregate
|
- name: Add interface aggregate
|
||||||
|
@ -157,7 +146,6 @@
|
||||||
speed: 1000
|
speed: 1000
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -177,7 +165,6 @@
|
||||||
speed: 1000
|
speed: 1000
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -192,7 +179,6 @@
|
||||||
enabled: False
|
enabled: False
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -211,7 +197,6 @@
|
||||||
enabled: True
|
enabled: True
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -229,7 +214,6 @@
|
||||||
- name: Loopback10
|
- name: Loopback10
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Create loopback interface aggregate
|
- name: Create loopback interface aggregate
|
||||||
ios_interface:
|
ios_interface:
|
||||||
|
@ -238,7 +222,6 @@
|
||||||
- name: Loopback10
|
- name: Loopback10
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -254,7 +237,6 @@
|
||||||
- name: Loopback10
|
- name: Loopback10
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -270,7 +252,6 @@
|
||||||
- name: Loopback10
|
- name: Loopback10
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
ios_command:
|
ios_command:
|
||||||
commands: show version
|
commands: show version
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: show_version_result
|
register: show_version_result
|
||||||
|
|
||||||
- name: Set test interface to GigabitEthernet0/2 if we are on Cisco IOS
|
- name: Set test interface to GigabitEthernet0/2 if we are on Cisco IOS
|
||||||
|
@ -24,7 +23,6 @@
|
||||||
tx_rate: ge(0)
|
tx_rate: ge(0)
|
||||||
rx_rate: ge(0)
|
rx_rate: ge(0)
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -38,7 +36,6 @@
|
||||||
tx_rate: gt(0)
|
tx_rate: gt(0)
|
||||||
rx_rate: lt(0)
|
rx_rate: lt(0)
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -55,7 +52,6 @@
|
||||||
enabled: False
|
enabled: False
|
||||||
state: down
|
state: down
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -68,7 +64,6 @@
|
||||||
enabled: False
|
enabled: False
|
||||||
authorize: yes
|
authorize: yes
|
||||||
state: up
|
state: up
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -82,7 +77,6 @@
|
||||||
commands:
|
commands:
|
||||||
- show lldp neighbors
|
- show lldp neighbors
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: show_lldp_neighbors_result
|
register: show_lldp_neighbors_result
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
@ -93,7 +87,6 @@
|
||||||
- port: eth0
|
- port: eth0
|
||||||
host: netdev
|
host: netdev
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -107,7 +100,6 @@
|
||||||
- port: dummy_port
|
- port: dummy_port
|
||||||
host: dummy_host
|
host: dummy_host
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -125,7 +117,6 @@
|
||||||
enabled: True
|
enabled: True
|
||||||
state: up
|
state: up
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -142,7 +133,6 @@
|
||||||
- port: eth0
|
- port: eth0
|
||||||
host: netdev
|
host: netdev
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
@ -160,7 +150,6 @@
|
||||||
- port: dummy_port
|
- port: dummy_port
|
||||||
host: dummy_host
|
host: dummy_host
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
name: 172.16.0.1
|
name: 172.16.0.1
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Remove console
|
- name: Remove console
|
||||||
ios_logging:
|
ios_logging:
|
||||||
|
@ -14,7 +13,6 @@
|
||||||
level: warnings
|
level: warnings
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Remove buffer
|
- name: Remove buffer
|
||||||
ios_logging:
|
ios_logging:
|
||||||
|
@ -22,7 +20,6 @@
|
||||||
size: 8000
|
size: 8000
|
||||||
authorize: yes
|
authorize: yes
|
||||||
state: absent
|
state: absent
|
||||||
become: yes
|
|
||||||
|
|
||||||
# start tests
|
# start tests
|
||||||
- name: Set up host logging
|
- name: Set up host logging
|
||||||
|
@ -32,7 +29,6 @@
|
||||||
facility: local7
|
facility: local7
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -47,7 +43,6 @@
|
||||||
name: 172.16.0.1
|
name: 172.16.0.1
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -60,7 +55,6 @@
|
||||||
name: 172.16.0.1
|
name: 172.16.0.1
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -74,7 +68,6 @@
|
||||||
name: 172.16.0.1
|
name: 172.16.0.1
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -87,7 +80,6 @@
|
||||||
level: warnings
|
level: warnings
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -100,7 +92,6 @@
|
||||||
dest: buffered
|
dest: buffered
|
||||||
size: 8000
|
size: 8000
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -114,7 +105,6 @@
|
||||||
- { dest: console, level: notifications }
|
- { dest: console, level: notifications }
|
||||||
- { dest: buffered, size: 9000 }
|
- { dest: buffered, size: 9000 }
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -130,7 +120,6 @@
|
||||||
- { dest: buffered, size: 9000 }
|
- { dest: buffered, size: 9000 }
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
next_hop: 10.0.0.8
|
next_hop: 10.0.0.8
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -21,7 +20,6 @@
|
||||||
next_hop: 10.0.0.8
|
next_hop: 10.0.0.8
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -36,7 +34,6 @@
|
||||||
admin_distance: 2
|
admin_distance: 2
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -52,7 +49,6 @@
|
||||||
admin_distance: 2
|
admin_distance: 2
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -67,7 +63,6 @@
|
||||||
admin_distance: 2
|
admin_distance: 2
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -83,7 +78,6 @@
|
||||||
admin_distance: 2
|
admin_distance: 2
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -97,7 +91,6 @@
|
||||||
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
|
- { prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -113,7 +106,6 @@
|
||||||
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
|
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -129,7 +121,6 @@
|
||||||
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
|
- { prefix: 172.16.34.0, mask: 255.255.255.0, next_hop: 10.0.0.8 }
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
- no ip domain-list redhat.com
|
- no ip domain-list redhat.com
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure domain_search
|
- name: configure domain_search
|
||||||
ios_system:
|
ios_system:
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
- ansible.com
|
- ansible.com
|
||||||
- redhat.com
|
- redhat.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -31,7 +29,6 @@
|
||||||
- ansible.com
|
- ansible.com
|
||||||
- redhat.com
|
- redhat.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -43,7 +40,6 @@
|
||||||
domain_search:
|
domain_search:
|
||||||
- ansible.com
|
- ansible.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -56,7 +52,6 @@
|
||||||
domain_search:
|
domain_search:
|
||||||
- ansible.com
|
- ansible.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -69,7 +64,6 @@
|
||||||
- ansible.com
|
- ansible.com
|
||||||
- redhat.com
|
- redhat.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -83,7 +77,6 @@
|
||||||
- ansible.com
|
- ansible.com
|
||||||
- redhat.com
|
- redhat.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -96,7 +89,6 @@
|
||||||
- ansible.com
|
- ansible.com
|
||||||
- eng.ansible.com
|
- eng.ansible.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -112,7 +104,6 @@
|
||||||
- ansible.com
|
- ansible.com
|
||||||
- eng.ansible.com
|
- eng.ansible.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -127,6 +118,5 @@
|
||||||
- no ip domain-list eng.ansible.com
|
- no ip domain-list eng.ansible.com
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/set_domain_search.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/set_domain_search.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -6,13 +6,11 @@
|
||||||
lines: no ip domain-name
|
lines: no ip domain-name
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure domain_name
|
- name: configure domain_name
|
||||||
ios_system:
|
ios_system:
|
||||||
domain_name: eng.ansible.com
|
domain_name: eng.ansible.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -23,7 +21,6 @@
|
||||||
ios_system:
|
ios_system:
|
||||||
domain_name: eng.ansible.com
|
domain_name: eng.ansible.com
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -35,6 +32,5 @@
|
||||||
lines: no ip domain-name
|
lines: no ip domain-name
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/set_domain_name.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/set_domain_name.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -6,13 +6,11 @@
|
||||||
lines: hostname switch
|
lines: hostname switch
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure hostname
|
- name: configure hostname
|
||||||
ios_system:
|
ios_system:
|
||||||
hostname: foo
|
hostname: foo
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -23,7 +21,6 @@
|
||||||
ios_system:
|
ios_system:
|
||||||
hostname: foo
|
hostname: foo
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -35,6 +32,5 @@
|
||||||
lines: "hostname {{ inventory_hostname }}"
|
lines: "hostname {{ inventory_hostname }}"
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/set_hostname.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/set_hostname.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -8,13 +8,11 @@
|
||||||
- vrf definition ansible
|
- vrf definition ansible
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure lookup_source
|
- name: configure lookup_source
|
||||||
ios_system:
|
ios_system:
|
||||||
lookup_source: Loopback888
|
lookup_source: Loopback888
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -26,7 +24,6 @@
|
||||||
ios_system:
|
ios_system:
|
||||||
lookup_source: Loopback888
|
lookup_source: Loopback888
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -37,7 +34,6 @@
|
||||||
ios_system:
|
ios_system:
|
||||||
lookup_enabled: False
|
lookup_enabled: False
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -49,7 +45,6 @@
|
||||||
ios_system:
|
ios_system:
|
||||||
lookup_enabled: True
|
lookup_enabled: True
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -64,7 +59,6 @@
|
||||||
# vrf: ansible
|
# vrf: ansible
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# provider: "{{ cli }}"
|
# provider: "{{ cli }}"
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
#
|
#
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -81,7 +75,6 @@
|
||||||
# vrf: ansible
|
# vrf: ansible
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# provider: "{{ cli }}"
|
# provider: "{{ cli }}"
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
#
|
#
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -95,7 +88,6 @@
|
||||||
- no vrf definition ansible
|
- no vrf definition ansible
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
# FIXME: Not sure why this is failing with msg": "no vrf definition ansible\r\n% IPv4 and IPv6 addresses from all interfaces in VRF ansible have been removed\r\nfoo(config)#", rc:1
|
# FIXME: Not sure why this is failing with msg": "no vrf definition ansible\r\n% IPv4 and IPv6 addresses from all interfaces in VRF ansible have been removed\r\nfoo(config)#", rc:1
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
- no ip name-server
|
- no ip name-server
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: configure name_servers
|
- name: configure name_servers
|
||||||
ios_system:
|
ios_system:
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
- 2.2.2.2
|
- 2.2.2.2
|
||||||
- 3.3.3.3
|
- 3.3.3.3
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -34,7 +32,6 @@
|
||||||
- 2.2.2.2
|
- 2.2.2.2
|
||||||
- 3.3.3.3
|
- 3.3.3.3
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -76,7 +73,6 @@
|
||||||
- 1.1.1.1
|
- 1.1.1.1
|
||||||
- 2.2.2.2
|
- 2.2.2.2
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -91,6 +87,5 @@
|
||||||
- no ip name-server
|
- no ip name-server
|
||||||
match: none
|
match: none
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- debug: msg="END cli/set_name_servers.yaml on connection={{ ansible_connection }}"
|
- debug: msg="END cli/set_name_servers.yaml on connection={{ ansible_connection }}"
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
configured_password: pass123
|
configured_password: pass123
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: test login
|
- name: test login
|
||||||
expect:
|
expect:
|
||||||
|
@ -35,7 +34,6 @@
|
||||||
name: auth_user
|
name: auth_user
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: reset connection
|
- name: reset connection
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
- name: ansibletest3
|
- name: ansibletest3
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
|
|
||||||
- name: Create user (SetUp)
|
- name: Create user (SetUp)
|
||||||
ios_user:
|
ios_user:
|
||||||
|
@ -16,7 +15,6 @@
|
||||||
role: network-operator
|
role: network-operator
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -32,7 +30,6 @@
|
||||||
authorize: yes
|
authorize: yes
|
||||||
state: present
|
state: present
|
||||||
view: network-admin
|
view: network-admin
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -47,7 +44,6 @@
|
||||||
role: network-operator
|
role: network-operator
|
||||||
state: present
|
state: present
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -63,7 +59,6 @@
|
||||||
authorize: yes
|
authorize: yes
|
||||||
state: present
|
state: present
|
||||||
view: network-admin
|
view: network-admin
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -79,7 +74,6 @@
|
||||||
- name: ansibletest3
|
- name: ansibletest3
|
||||||
state: absent
|
state: absent
|
||||||
authorize: yes
|
authorize: yes
|
||||||
become: yes
|
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
|
||||||
|
|
||||||
- name: run test cases (connection=network_cli)
|
- name: run test cases (connection=network_cli)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=network_cli"
|
include: "{{ test_case_to_run }} ansible_connection=network_cli ansible_become=yes"
|
||||||
with_items: "{{ test_items }}"
|
with_items: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
||||||
- name: run test case (connection=local)
|
- name: run test case (connection=local)
|
||||||
include: "{{ test_case_to_run }} ansible_connection=local ansible_become=no"
|
include: "{{ test_case_to_run }} ansible_connection=local"
|
||||||
with_first_found: "{{ test_items }}"
|
with_first_found: "{{ test_items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: test_case_to_run
|
loop_var: test_case_to_run
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
# - no vlan 200
|
# - no vlan 200
|
||||||
# - no vlan 300
|
# - no vlan 300
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
|
|
||||||
#- name: setup - remove switchport settings on interfaces used in test
|
#- name: setup - remove switchport settings on interfaces used in test
|
||||||
# ios_config:
|
# ios_config:
|
||||||
|
@ -15,7 +14,6 @@
|
||||||
# - no switchport access vlan 100
|
# - no switchport access vlan 100
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# parents: "{{ item }}"
|
# parents: "{{ item }}"
|
||||||
# become: yes
|
|
||||||
# with_items:
|
# with_items:
|
||||||
# - interface GigabitEthernet0/1
|
# - interface GigabitEthernet0/1
|
||||||
# - interface GigabitEthernet0/2
|
# - interface GigabitEthernet0/2
|
||||||
|
@ -25,7 +23,6 @@
|
||||||
# vlan_id: 100
|
# vlan_id: 100
|
||||||
# name: test-vlan
|
# name: test-vlan
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -36,7 +33,6 @@
|
||||||
|
|
||||||
#- name: create vlan(idempotence)
|
#- name: create vlan(idempotence)
|
||||||
# ios_vlan: *create
|
# ios_vlan: *create
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -50,7 +46,6 @@
|
||||||
# - GigabitEthernet0/1
|
# - GigabitEthernet0/1
|
||||||
# - GigabitEthernet0/2
|
# - GigabitEthernet0/2
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -65,7 +60,6 @@
|
||||||
|
|
||||||
#- name: Add interfaces to vlan(idempotence)
|
#- name: Add interfaces to vlan(idempotence)
|
||||||
# ios_vlan: *interfaces
|
# ios_vlan: *interfaces
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -78,7 +72,6 @@
|
||||||
# interfaces:
|
# interfaces:
|
||||||
# - GigabitEthernet0/1
|
# - GigabitEthernet0/1
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -91,7 +84,6 @@
|
||||||
|
|
||||||
#- name: Remove interface from vlan(idempotence)
|
#- name: Remove interface from vlan(idempotence)
|
||||||
# ios_vlan: *single_int
|
# ios_vlan: *single_int
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -103,7 +95,6 @@
|
||||||
# vlan_id: 100
|
# vlan_id: 100
|
||||||
# state: suspend
|
# state: suspend
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -117,7 +108,6 @@
|
||||||
# vlan_id: 100
|
# vlan_id: 100
|
||||||
# state: active
|
# state: active
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -131,7 +121,6 @@
|
||||||
# vlan_id: 100
|
# vlan_id: 100
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# state: absent
|
# state: absent
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -141,7 +130,6 @@
|
||||||
|
|
||||||
#- name: delete vlan(idempotence)
|
#- name: delete vlan(idempotence)
|
||||||
# ios_vlan: *delete
|
# ios_vlan: *delete
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -154,7 +142,6 @@
|
||||||
# - { vlan_id: 200, name: vlan-200 }
|
# - { vlan_id: 200, name: vlan-200 }
|
||||||
# - { vlan_id: 300, name: vlan-300 }
|
# - { vlan_id: 300, name: vlan-300 }
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -167,7 +154,6 @@
|
||||||
|
|
||||||
#- name: create vlans using aggregate(idempotence)
|
#- name: create vlans using aggregate(idempotence)
|
||||||
# ios_vlan: *create_aggregate
|
# ios_vlan: *create_aggregate
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -181,7 +167,6 @@
|
||||||
# - { vlan_id: 300, name: vlan-300 }
|
# - { vlan_id: 300, name: vlan-300 }
|
||||||
# state: absent
|
# state: absent
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -192,7 +177,6 @@
|
||||||
|
|
||||||
#- name: delete vlans using aggregate(idempotence)
|
#- name: delete vlans using aggregate(idempotence)
|
||||||
# ios_vlan: *delete_aggregate
|
# ios_vlan: *delete_aggregate
|
||||||
# become: yes
|
|
||||||
# register: result
|
# register: result
|
||||||
|
|
||||||
#- assert:
|
#- assert:
|
||||||
|
@ -206,7 +190,6 @@
|
||||||
# - no vlan 200
|
# - no vlan 200
|
||||||
# - no vlan 300
|
# - no vlan 300
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# become: yes
|
|
||||||
|
|
||||||
#- name: teardown(part2)
|
#- name: teardown(part2)
|
||||||
# ios_config:
|
# ios_config:
|
||||||
|
@ -215,7 +198,6 @@
|
||||||
# - no switchport access vlan 100
|
# - no switchport access vlan 100
|
||||||
# authorize: yes
|
# authorize: yes
|
||||||
# parents: "{{ item }}"
|
# parents: "{{ item }}"
|
||||||
# become: yes
|
|
||||||
# with_items:
|
# with_items:
|
||||||
# - interface GigabitEthernet0/1
|
# - interface GigabitEthernet0/1
|
||||||
# - interface GigabitEthernet0/2
|
# - interface GigabitEthernet0/2
|
||||||
|
|
Loading…
Reference in a new issue