1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

run banner exec test only for NXOS7K (#29041)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
Trishna Guha 2017-09-07 17:30:24 +05:30 committed by GitHub
parent 49658f9437
commit 064bb66e6d

View file

@ -1,34 +1,41 @@
--- ---
- name: setup - remove exec - debug: msg="START nxos_banner exec test"
nxos_banner:
banner: exec
state: absent
provider: "{{ connection }}"
- name: Set exec - block:
nxos_banner: &exec - name: setup - remove exec
banner: exec nxos_banner:
text: | banner: exec
this is my exec banner state: absent
that has a multiline provider: "{{ connection }}"
string
state: present
provider: "{{ connection }}"
register: result
- assert: - name: Set exec
that: nxos_banner: &exec
- "result.changed == true" banner: exec
- "'banner exec @\nthis is my exec banner\nthat has a multiline\nstring\n@' in result.commands" text: |
this is my exec banner
that has a multiline
string
state: present
provider: "{{ connection }}"
register: result
- name: Set exec again (idempotent) - assert:
nxos_banner: *exec that:
register: result - "result.changed == true"
- "'banner exec @\nthis is my exec banner\nthat has a multiline\nstring\n@' in result.commands"
- assert: - name: Set exec again (idempotent)
that: nxos_banner: *exec
- "result.changed == false" register: result
- "result.commands | length == 0"
- assert:
that:
- "result.changed == false"
- "result.commands | length == 0"
when: platform | match("N7K")
- debug: msg="END nxos_banner exec test"
# FIXME add in tests for everything defined in docs # FIXME add in tests for everything defined in docs
# FIXME Test state:absent + test: # FIXME Test state:absent + test: