2017-06-15 16:35:38 +00:00
|
|
|
---
|
2018-01-18 06:20:15 +00:00
|
|
|
- debug: msg="START cli/nxos_banner exec test"
|
2017-09-07 12:00:24 +00:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: setup - remove exec
|
2018-01-18 06:20:15 +00:00
|
|
|
nxos_banner: &remove
|
2017-09-07 12:00:24 +00:00
|
|
|
banner: exec
|
|
|
|
state: absent
|
2018-01-18 06:20:15 +00:00
|
|
|
provider: "{{ cli }}"
|
2017-09-07 12:00:24 +00:00
|
|
|
|
|
|
|
- name: Set exec
|
|
|
|
nxos_banner: &exec
|
|
|
|
banner: exec
|
|
|
|
text: |
|
|
|
|
this is my exec banner
|
|
|
|
that has a multiline
|
|
|
|
string
|
|
|
|
state: present
|
2018-01-18 06:20:15 +00:00
|
|
|
provider: "{{ cli }}"
|
2017-09-07 12:00:24 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
- "'banner exec @\nthis is my exec banner\nthat has a multiline\nstring\n@' in result.commands"
|
|
|
|
|
|
|
|
- name: Set exec again (idempotent)
|
|
|
|
nxos_banner: *exec
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
- "result.commands | length == 0"
|
|
|
|
|
2018-01-18 06:20:15 +00:00
|
|
|
- name: teardown - remove exec
|
|
|
|
nxos_banner: *remove
|
2017-09-07 12:00:24 +00:00
|
|
|
|
2018-01-18 06:20:15 +00:00
|
|
|
when: platform is match("N7K")
|
2017-06-15 16:35:38 +00:00
|
|
|
|
2018-01-18 06:20:15 +00:00
|
|
|
- debug: msg="END cli/nxos_banner exec test"
|