mirror of https://github.com/ansible/ansible.git
Cherry pick 2.4 eos banner fixes (#26904)
* Fix multiple EOS EAPI code and test issues (#26651) (cherry picked from commitpull/26935/headb81209c187
) * Fix eos_banner basic-motd eapi asserts (#23398) The commands in EAPI does not contain the plain command sent to the device as a one liner, but it is split in cmd/input keys. (cherry picked from commitce9826d76e
) * Add CHANGELOG entry
parent
85e9a07117
commit
32b4342209
@ -1,48 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Setup
|
|
||||||
eos_banner:
|
|
||||||
banner: login
|
|
||||||
text: |
|
|
||||||
Junk login banner
|
|
||||||
over multiple lines
|
|
||||||
state: present
|
|
||||||
authorize: yes
|
|
||||||
provider: "{{ cli }}"
|
|
||||||
|
|
||||||
- name: remove login
|
|
||||||
eos_banner:
|
|
||||||
banner: login
|
|
||||||
state: absent
|
|
||||||
authorize: yes
|
|
||||||
provider: "{{ cli }}"
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- debug:
|
|
||||||
msg: "{{ result }}"
|
|
||||||
|
|
||||||
- assert:
|
|
||||||
that:
|
|
||||||
- "result.changed == true"
|
|
||||||
- "'no banner login' in result.commands" # does this break due to "contains?"
|
|
||||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
|
||||||
- "'ansible_1' in result.session_name"
|
|
||||||
|
|
||||||
- name: remove login (idempotent)
|
|
||||||
eos_banner:
|
|
||||||
banner: login
|
|
||||||
state: absent
|
|
||||||
authorize: yes
|
|
||||||
provider: "{{ cli }}"
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
|
||||||
that:
|
|
||||||
- "result.changed == false"
|
|
||||||
- "result.commands | length == 0"
|
|
||||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
|
||||||
- "result.session_name is not defined"
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME add in tests for everything defined in docs
|
|
||||||
# FIXME Test state:absent + test:
|
|
||||||
# FIXME Without powers ensure "privileged mode required"
|
|
@ -1,46 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Setup
|
|
||||||
eos_banner:
|
|
||||||
banner: login
|
|
||||||
text: Junk login banner single line
|
|
||||||
state: present
|
|
||||||
authorize: yes
|
|
||||||
provider: "{{ eapi }}"
|
|
||||||
|
|
||||||
- name: remove login
|
|
||||||
eos_banner:
|
|
||||||
banner: login
|
|
||||||
state: absent
|
|
||||||
authorize: yes
|
|
||||||
provider: "{{ eapi }}"
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- debug:
|
|
||||||
msg: "{{ result }}"
|
|
||||||
|
|
||||||
- assert:
|
|
||||||
that:
|
|
||||||
- "result.changed == true"
|
|
||||||
- "'no banner login' in result.commands" # does this break due to "contains?"
|
|
||||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
|
||||||
- "'ansible_1' in result.session_name"
|
|
||||||
|
|
||||||
- name: remove login (idempotent)
|
|
||||||
eos_banner:
|
|
||||||
banner: login
|
|
||||||
state: absent
|
|
||||||
authorize: yes
|
|
||||||
provider: "{{ eapi }}"
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- assert:
|
|
||||||
that:
|
|
||||||
- "result.changed == false"
|
|
||||||
- "result.commands | length == 0"
|
|
||||||
# Ensure sessions contains epoc. Will fail after 18th May 2033
|
|
||||||
- "result.session_name is not defined"
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME add in tests for everything defined in docs
|
|
||||||
# FIXME Test state:absent + test:
|
|
||||||
# FIXME Without powers ensure "privileged mode required"
|
|
Loading…
Reference in New Issue