1
0
Fork 0
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:
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: parents:
- interface Loopback999 - interface Loopback999
match: none match: none
provider: "{{ cli }}"
- name: collect any backup files - name: collect any backup files
find: find:
@ -27,6 +28,7 @@
ios_config: ios_config:
src: basic/config.j2 src: basic/config.j2
backup: yes backup: yes
provider: "{{ cli }}"
register: result register: result
- assert: - assert:

View file

@ -9,11 +9,13 @@
parents: parents:
- interface Loopback999 - interface Loopback999
match: none match: none
provider: "{{ cli }}"
- 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
provider: "{{ cli }}"
register: result register: result
- debug: var=result - debug: var=result
@ -28,6 +30,7 @@
ios_config: ios_config:
src: defaults/config.j2 src: defaults/config.j2
defaults: yes defaults: yes
provider: "{{ cli }}"
register: result register: result
- debug: var=result - debug: var=result

View file

@ -9,11 +9,13 @@
parents: parents:
- interface Loopback999 - interface Loopback999
match: none match: none
provider: "{{ cli }}"
- name: save config - name: save config
ios_config: ios_config:
save: true save: true
provider: "{{ cli }}"
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
@ -27,6 +29,7 @@
- name: save should always run - name: save should always run
ios_config: ios_config:
save: true save: true
provider: "{{ cli }}"
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

View file

@ -9,10 +9,12 @@
parents: parents:
- interface Loopback999 - interface Loopback999
match: none match: none
provider: "{{ cli }}"
- name: configure device with config - name: configure device with config
ios_config: ios_config:
src: basic/config.j2 src: basic/config.j2
provider: "{{ cli }}"
register: result register: result
- name: debug, remove me - name: debug, remove me
@ -28,6 +30,7 @@
- name: check device with config - name: check device with config
ios_config: ios_config:
src: basic/config.j2 src: basic/config.j2
provider: "{{ cli }}"
register: result register: result
- assert: - assert:

View file

@ -9,11 +9,13 @@
parents: parents:
- interface Loopback999 - interface Loopback999
match: none match: none
provider: "{{ cli }}"
- 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
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -26,6 +28,7 @@
- name: check device with config - name: check device with config
ios_config: ios_config:
src: basic/config.j2 src: basic/config.j2
provider: "{{ cli }}"
register: result register: result
- assert: - assert:

View file

@ -7,11 +7,13 @@
- 'no ip access-list extended test' - 'no ip access-list extended test'
- 'no ip access-list standard test' - 'no ip access-list standard test'
match: none match: none
provider: "{{ cli }}"
- 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']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -24,6 +26,7 @@
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']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -35,5 +38,6 @@
lines: lines:
- 'no ip access-list extended test' - 'no ip access-list extended test'
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/sublevel.yaml" - debug: msg="END cli/sublevel.yaml"

View file

@ -10,6 +10,7 @@
parents: ['ip access-list extended test'] parents: ['ip access-list extended test']
before: ['no ip access-list extended test'] before: ['no ip access-list extended test']
after: ['exit'] after: ['exit']
provider: "{{ cli }}"
match: none match: none
- name: configure sub level command using block resplace - name: configure sub level command using block resplace
@ -22,6 +23,7 @@
parents: ['ip access-list extended test'] parents: ['ip access-list extended test']
replace: block replace: block
after: ['exit'] after: ['exit']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -43,6 +45,7 @@
parents: ['ip access-list extended test'] parents: ['ip access-list extended test']
replace: block replace: block
after: ['exit'] after: ['exit']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -54,5 +57,6 @@
lines: lines:
- no ip access-list extended test - no ip access-list extended test
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/sublevel_block.yaml" - debug: msg="END cli/sublevel_block.yaml"

View file

@ -13,6 +13,7 @@
before: no ip access-list extended test before: no ip access-list extended test
after: exit after: exit
match: none match: none
provider: "{{ cli }}"
- name: configure sub level command using exact match - name: configure sub level command using exact match
ios_config: ios_config:
@ -25,6 +26,7 @@
before: no ip access-list extended test before: no ip access-list extended test
after: exit after: exit
match: exact match: exact
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -46,6 +48,7 @@
- permit ip host 4.4.4.4 any log - permit ip host 4.4.4.4 any log
parents: ip access-list extended test parents: ip access-list extended test
match: exact match: exact
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -57,5 +60,6 @@
lines: lines:
- no ip access-list extended test - no ip access-list extended test
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/sublevel_exact.yaml" - debug: msg="END cli/sublevel_exact.yaml"

View file

@ -12,6 +12,7 @@
parents: ip access-list extended test parents: ip access-list extended test
before: no ip access-list extended test before: no ip access-list extended test
match: none match: none
provider: "{{ cli }}"
- name: configure sub level command using strict match - name: configure sub level command using strict match
ios_config: ios_config:
@ -22,6 +23,7 @@
- permit ip host 4.4.4.4 any log - permit ip host 4.4.4.4 any log
parents: ip access-list extended test parents: ip access-list extended test
match: strict match: strict
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -37,6 +39,7 @@
parents: ip access-list extended test parents: ip access-list extended test
after: exit after: exit
match: strict match: strict
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -53,5 +56,6 @@
ios_config: ios_config:
lines: no ip access-list extended test lines: no ip access-list extended test
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/sublevel_strict.yaml" - debug: msg="END cli/sublevel_strict.yaml"

View file

@ -5,10 +5,12 @@
ios_config: ios_config:
lines: ['hostname {{ shorter_hostname }}'] lines: ['hostname {{ shorter_hostname }}']
match: none match: none
provider: "{{ cli }}"
- name: configure top level command - name: configure top level command
ios_config: ios_config:
lines: ['hostname foo'] lines: ['hostname foo']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -19,6 +21,7 @@
- name: configure top level command idempotent check - name: configure top level command idempotent check
ios_config: ios_config:
lines: ['hostname foo'] lines: ['hostname foo']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -29,5 +32,6 @@
ios_config: ios_config:
lines: ['hostname {{ shorter_hostname }}'] lines: ['hostname {{ shorter_hostname }}']
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/toplevel.yaml" - debug: msg="END cli/toplevel.yaml"

View file

@ -7,11 +7,13 @@
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ shorter_hostname }}" - "hostname {{ shorter_hostname }}"
match: none match: none
provider: "{{ cli }}"
- 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']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -24,6 +26,7 @@
ios_config: ios_config:
lines: ['hostname foo'] lines: ['hostname foo']
after: ['snmp-server contact foo'] after: ['snmp-server contact foo']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -36,5 +39,6 @@
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ shorter_hostname }}" - "hostname {{ shorter_hostname }}"
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/toplevel_after.yaml" - debug: msg="END cli/toplevel_after.yaml"

View file

@ -7,11 +7,13 @@
- "snmp-server contact ansible" - "snmp-server contact ansible"
- "hostname {{ shorter_hostname }}" - "hostname {{ shorter_hostname }}"
match: none match: none
provider: "{{ cli }}"
- 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']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -24,6 +26,7 @@
ios_config: ios_config:
lines: ['hostname foo'] lines: ['hostname foo']
before: ['snmp-server contact foo'] before: ['snmp-server contact foo']
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -36,5 +39,6 @@
- "no snmp-server contact" - "no snmp-server contact"
- "hostname {{ shorter_hostname }}" - "hostname {{ shorter_hostname }}"
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/toplevel_before.yaml" - debug: msg="END cli/toplevel_before.yaml"

View file

@ -5,11 +5,13 @@
ios_config: ios_config:
lines: ['hostname {{ shorter_hostname }}'] lines: ['hostname {{ shorter_hostname }}']
match: none match: none
provider: "{{ cli }}"
- name: configure top level command - name: configure top level command
ios_config: ios_config:
lines: ['hostname foo'] lines: ['hostname foo']
match: strict match: strict
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -21,6 +23,7 @@
ios_config: ios_config:
lines: ['hostname foo'] lines: ['hostname foo']
match: strict match: strict
provider: "{{ cli }}"
register: result register: result
- assert: - assert:
@ -31,5 +34,6 @@
ios_config: ios_config:
lines: ['hostname {{ shorter_hostname }}'] lines: ['hostname {{ shorter_hostname }}']
match: none match: none
provider: "{{ cli }}"
- debug: msg="END cli/toplevel_nonidempotent.yaml" - debug: msg="END cli/toplevel_nonidempotent.yaml"