2017-06-15 18:35:38 +02:00
|
|
|
---
|
2018-01-18 07:20:15 +01:00
|
|
|
- debug: msg="START cli/nxos_banner exec test"
|
2017-09-07 14:00:24 +02:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: setup - remove exec
|
2018-01-18 07:20:15 +01:00
|
|
|
nxos_banner: &remove
|
2017-09-07 14:00:24 +02:00
|
|
|
banner: exec
|
|
|
|
state: absent
|
2018-01-18 07:20:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2017-09-07 14:00:24 +02: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 07:20:15 +01:00
|
|
|
provider: "{{ cli }}"
|
2017-09-07 14:00:24 +02: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 07:20:15 +01:00
|
|
|
- name: teardown - remove exec
|
|
|
|
nxos_banner: *remove
|
2017-09-07 14:00:24 +02:00
|
|
|
|
2018-01-18 07:20:15 +01:00
|
|
|
when: platform is match("N7K")
|
2017-06-15 18:35:38 +02:00
|
|
|
|
2018-01-18 07:20:15 +01:00
|
|
|
- debug: msg="END cli/nxos_banner exec test"
|