mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add CLI provider with authorize yes to ios tests (#30312)
We are getting failures to do lack of elevated privileges.
This commit is contained in:
parent
2186b04934
commit
dbe9df1289
13 changed files with 46 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
parents:
|
||||
- interface Loopback999
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
|
@ -27,6 +28,7 @@
|
|||
ios_config:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
parents:
|
||||
- interface Loopback999
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with defaults included
|
||||
ios_config:
|
||||
src: defaults/config.j2
|
||||
defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
@ -28,6 +30,7 @@
|
|||
ios_config:
|
||||
src: defaults/config.j2
|
||||
defaults: yes
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- debug: var=result
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
parents:
|
||||
- interface Loopback999
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
|
||||
- name: save config
|
||||
ios_config:
|
||||
save: true
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
||||
ignore_errors: true
|
||||
|
@ -27,6 +29,7 @@
|
|||
- name: save should always run
|
||||
ios_config:
|
||||
save: true
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
# FIXME https://github.com/ansible/ansible-modules-core/issues/5008
|
||||
ignore_errors: true
|
||||
|
|
|
@ -9,10 +9,12 @@
|
|||
parents:
|
||||
- interface Loopback999
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with config
|
||||
ios_config:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- name: debug, remove me
|
||||
|
@ -28,6 +30,7 @@
|
|||
- name: check device with config
|
||||
ios_config:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -9,11 +9,13 @@
|
|||
parents:
|
||||
- interface Loopback999
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure device with config
|
||||
ios_config:
|
||||
src: basic/config.j2
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -26,6 +28,7 @@
|
|||
- name: check device with config
|
||||
ios_config:
|
||||
src: basic/config.j2
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
- 'no ip access-list extended test'
|
||||
- 'no ip access-list standard test'
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure sub level command
|
||||
ios_config:
|
||||
lines: ['permit ip any any log']
|
||||
parents: ['ip access-list extended test']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -24,6 +26,7 @@
|
|||
ios_config:
|
||||
lines: ['permit ip any any log']
|
||||
parents: ['ip access-list extended test']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -35,5 +38,6 @@
|
|||
lines:
|
||||
- 'no ip access-list extended test'
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/sublevel.yaml"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
parents: ['ip access-list extended test']
|
||||
before: ['no ip access-list extended test']
|
||||
after: ['exit']
|
||||
provider: "{{ cli }}"
|
||||
match: none
|
||||
|
||||
- name: configure sub level command using block resplace
|
||||
|
@ -22,6 +23,7 @@
|
|||
parents: ['ip access-list extended test']
|
||||
replace: block
|
||||
after: ['exit']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -43,6 +45,7 @@
|
|||
parents: ['ip access-list extended test']
|
||||
replace: block
|
||||
after: ['exit']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -54,5 +57,6 @@
|
|||
lines:
|
||||
- no ip access-list extended test
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/sublevel_block.yaml"
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
before: no ip access-list extended test
|
||||
after: exit
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure sub level command using exact match
|
||||
ios_config:
|
||||
|
@ -25,6 +26,7 @@
|
|||
before: no ip access-list extended test
|
||||
after: exit
|
||||
match: exact
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -46,6 +48,7 @@
|
|||
- permit ip host 4.4.4.4 any log
|
||||
parents: ip access-list extended test
|
||||
match: exact
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -57,5 +60,6 @@
|
|||
lines:
|
||||
- no ip access-list extended test
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/sublevel_exact.yaml"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
parents: ip access-list extended test
|
||||
before: no ip access-list extended test
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure sub level command using strict match
|
||||
ios_config:
|
||||
|
@ -22,6 +23,7 @@
|
|||
- permit ip host 4.4.4.4 any log
|
||||
parents: ip access-list extended test
|
||||
match: strict
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -37,6 +39,7 @@
|
|||
parents: ip access-list extended test
|
||||
after: exit
|
||||
match: strict
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -53,5 +56,6 @@
|
|||
ios_config:
|
||||
lines: no ip access-list extended test
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/sublevel_strict.yaml"
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
ios_config:
|
||||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure top level command
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -19,6 +21,7 @@
|
|||
- name: configure top level command idempotent check
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -29,5 +32,6 @@
|
|||
ios_config:
|
||||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/toplevel.yaml"
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
- "snmp-server contact ansible"
|
||||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure top level command with before
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
after: ['snmp-server contact bar']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -24,6 +26,7 @@
|
|||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
after: ['snmp-server contact foo']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -36,5 +39,6 @@
|
|||
- "no snmp-server contact"
|
||||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/toplevel_after.yaml"
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
- "snmp-server contact ansible"
|
||||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure top level command with before
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
before: ['snmp-server contact bar']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -24,6 +26,7 @@
|
|||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
before: ['snmp-server contact foo']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -36,5 +39,6 @@
|
|||
- "no snmp-server contact"
|
||||
- "hostname {{ shorter_hostname }}"
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/toplevel_before.yaml"
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
ios_config:
|
||||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- name: configure top level command
|
||||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
match: strict
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -21,6 +23,7 @@
|
|||
ios_config:
|
||||
lines: ['hostname foo']
|
||||
match: strict
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
@ -31,5 +34,6 @@
|
|||
ios_config:
|
||||
lines: ['hostname {{ shorter_hostname }}']
|
||||
match: none
|
||||
provider: "{{ cli }}"
|
||||
|
||||
- debug: msg="END cli/toplevel_nonidempotent.yaml"
|
||||
|
|
Loading…
Reference in a new issue