mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-15 17:40:50 -07:00
Eos :do not push config to device if check_mode is enabled (#37287)
* eos can not check config without config session support * add testcase for check_mode without config session * fix eos eapi to read use_session env var
This commit is contained in:
parent
dc61f4c6b1
commit
a1026dbce5
2 changed files with 48 additions and 3 deletions
|
@ -37,4 +37,33 @@
|
|||
that:
|
||||
- "config.session not in result.stdout[0].sessions"
|
||||
|
||||
- name: invalid configuration in check mode + no config session
|
||||
eos_config:
|
||||
lines:
|
||||
- ip address 119.31.1.1 255.255.255.256
|
||||
parents: interface Loopback911
|
||||
check_mode: 1
|
||||
environment:
|
||||
ANSIBLE_EOS_USE_SESSIONS: 0
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
|
||||
- name: valid configuration in check mode + no config session
|
||||
eos_config:
|
||||
lines:
|
||||
- ip address 119.31.1.1 255.255.255.255
|
||||
parents: interface Loopback911
|
||||
check_mode: yes
|
||||
register: result
|
||||
environment:
|
||||
ANSIBLE_EOS_USE_SESSIONS: 0
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
|
||||
- debug: msg="END cli/check_mode.yaml on connection={{ ansible_connection }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue