2017-06-17 20:02:48 +00:00
|
|
|
---
|
|
|
|
- debug: msg="START net_banner junos/basic.yaml"
|
|
|
|
|
|
|
|
- name: setup - remove login banner
|
|
|
|
net_banner:
|
|
|
|
banner: login
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
|
|
|
|
- name: Create login banner
|
|
|
|
net_banner:
|
|
|
|
banner: login
|
|
|
|
text: this is my login banner
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
2017-06-29 04:48:35 +00:00
|
|
|
- name: Get running configuration
|
|
|
|
junos_rpc:
|
|
|
|
rpc: get-configuration
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: config
|
|
|
|
|
2017-06-17 20:02:48 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-06-29 04:48:35 +00:00
|
|
|
- "'<message>this is my login banner</message>' in config.xml"
|
2017-06-17 20:02:48 +00:00
|
|
|
|
|
|
|
- name: Create login banner (idempotent)
|
|
|
|
net_banner:
|
|
|
|
banner: login
|
|
|
|
text: this is my login banner
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: delete login banner
|
|
|
|
net_banner:
|
|
|
|
banner: login
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
2017-06-29 04:48:35 +00:00
|
|
|
- name: Get running configuration
|
|
|
|
junos_rpc:
|
|
|
|
rpc: get-configuration
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: config
|
|
|
|
|
2017-06-17 20:02:48 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-06-29 04:48:35 +00:00
|
|
|
- "'<message>this is my login banner</message>' not in config.xml"
|
2017-06-17 20:02:48 +00:00
|
|
|
|
|
|
|
- name: setup - remove motd banner
|
|
|
|
net_banner:
|
|
|
|
banner: motd
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
|
|
|
|
- name: Create motd banner
|
|
|
|
junos_banner:
|
|
|
|
banner: motd
|
|
|
|
text: this is my motd banner
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
2017-06-29 04:48:35 +00:00
|
|
|
- name: Get running configuration
|
|
|
|
junos_rpc:
|
|
|
|
rpc: get-configuration
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: config
|
2017-06-17 20:02:48 +00:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-06-29 04:48:35 +00:00
|
|
|
- "'<announcement>this is my motd banner</announcement>' in config.xml"
|
2017-06-17 20:02:48 +00:00
|
|
|
|
|
|
|
- name: Create motd banner (idempotent)
|
|
|
|
net_banner:
|
|
|
|
banner: motd
|
|
|
|
text: this is my motd banner
|
|
|
|
state: present
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: delete motd banner
|
2017-10-31 09:51:27 +00:00
|
|
|
net_banner:
|
2017-06-17 20:02:48 +00:00
|
|
|
banner: motd
|
|
|
|
state: absent
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
|
2017-06-29 04:48:35 +00:00
|
|
|
- name: Get running configuration
|
|
|
|
junos_rpc:
|
|
|
|
rpc: get-configuration
|
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: config
|
|
|
|
|
2017-06-17 20:02:48 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
2017-06-29 04:48:35 +00:00
|
|
|
- "'<announcement>this is my motd banner</announcement>' not in config.xml"
|