Add CLI provider with authorize yes to ios tests (#30312)

We are getting failures to do lack of elevated privileges.
pull/30335/head
Ricardo Carrillo Cruz 7 years ago committed by GitHub
parent 2186b04934
commit dbe9df1289

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save