forked from mlowcher61/F5-Ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SSHD_banner.yml
executable file
·35 lines (33 loc) · 1.08 KB
/
SSHD_banner.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
---
#
# Copyright (c) 2016 F5 Networks
# All rights reserved.
#
# author: Mark Lowcher F5 Networks
# description: This playbook will set a banner that is presented upon
# login. The "inactivity_timeout" can limit the session to X number of seconds.
# "allow" can limit ssh access to specific ips or ip ranges.
# EXAMPLE:
# ip address such as: 30.20.10.5
# ip range such as: 172.27.*.* or 172.27.0.0/255.255.0.0
# but are there to show how to add them if desired.
# banner: "disabled" will remove the banner.
- name: Connecting...
hosts: "10.0.0.166"
connection: local
gather_facts: no
vars:
setup_user: "admin"
setup_pass: "admin"
bigip: "10.0.0.157"`
tasks:
- name: Set the banner for the SSHD service from a file
bigip_device_sshd:
banner: "enabled"
banner_text: "{{ lookup('file', '/var/tmp/SSHD-banner.txt') }}"
inactivity_timeout: "no"
allow: "all"
server: "{{bigip}}"
user: "{{setup_user}}"
password: "{{setup_pass}}"
delegate_to: localhost