summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_banner/tests/cli/basic-post-login.yaml
blob: da8adb1f2afee20cf6b0b3cd02a44252af4fb46f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
- debug:
    msg: cli/basic-post-login.yaml on connection={{ ansible_connection }}

- name: setup - remove post-login
  vyos.vyos.vyos_banner:
    banner: post-login
    state: absent

- name: Set post-login
  register: result
  vyos.vyos.vyos_banner:
    banner: post-login
    text: "this is my post-login banner\nthat has a multiline\nstring\n"
    state: present

- debug:
    msg: "{{ result }}"

- assert:
    that:
      - result.changed == true
      - "'this is my post-login banner' in result.commands[0]"
      - "'that has a multiline' in result.commands[0]"

- name: Set post-login again (idempotent)
  register: result
  vyos.vyos.vyos_banner:
    banner: post-login
    text: "this is my post-login banner\nthat has a multiline\nstring\n"
    state: present

- assert:
    that:
      - result.changed == false
      - result.commands | length == 0