forked from colin-mccarthy/ansible-playbooks-for-cisco-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
2.4_banner.playbook.yml
44 lines (37 loc) · 991 Bytes
/
2.4_banner.playbook.yml
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
37
38
39
40
41
42
43
44
---
- hosts: ios
gather_facts: no
connection: local
tasks:
- name: OBTAIN LOGIN CREDENTIALS
include_vars: secrets.yaml
- name: DEFINE PROVIDER
set_fact:
provider:
host: "{{ inventory_hostname }}"
username: "{{ creds['username'] }}"
password: "{{ creds['password'] }}"
auth_pass: "{{ creds['auth_pass'] }}"
- name: SHOW RUN | BEG BANNER
ios_command:
provider: "{{ provider }}"
authorize: yes
commands:
- show run | beg banner
register: banner
- debug: var=banner.stdout_lines
- name: Configure banner from file
ios_banner:
provider: "{{ provider }}"
authorize: yes
banner: login
text: "{{ lookup('file', './vars/raw_banner.cfg') }}"
state: present
- name: SHOW RUN | BEG BANNER
ios_command:
provider: "{{ provider }}"
authorize: yes
commands:
- show run | beg banner
register: banner
- debug: var=banner.stdout_lines