mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
8 years ago
|
---
|
||
|
- 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"
|