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:
Ricardo Carrillo Cruz 2017-09-14 00:00:58 +02:00 committed by GitHub
parent 2186b04934
commit dbe9df1289
13 changed files with 46 additions and 0 deletions

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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:

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"