Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Parameterise Banner and DebianBanner as defaults #77

Merged
merged 2 commits into from
Oct 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ ssh_print_motd: false # sshd
# false to disable display of last login information
ssh_print_last_log: false # sshd

# false to disable serving /etc/ssh/banner.txt before authentication is allowed
ssh_banner: false # sshd

# false to disable distribution version leakage during initial protocol handshake
ssh_print_debian_banner: false # sshd (Debian OS family only)

# true to enable sftp configuration
sftp_enabled: false

Expand Down
2 changes: 0 additions & 2 deletions templates/openssh.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# This is the ssh client system-wide configuration file.
# See ssh_config(5) for more information on any settings used. Comments will be added only to clarify why a configuration was chosen.
#
# Created for OpenSSH v5.9

# Basic configuration
# ===================

Expand Down
11 changes: 5 additions & 6 deletions templates/opensshd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# This is the ssh client system-wide configuration file.
# See sshd_config(5) for more information on any settings used. Comments will be added only to clarify why a configuration was chosen.
#
# Created for OpenSSH v5.9

# Basic configuration
# ===================
Expand Down Expand Up @@ -200,10 +198,11 @@ PrintMotd {{ 'yes' if ssh_print_motd else 'no' }}

PrintLastLog {{ 'yes' if ssh_print_last_log else 'no' }}

#Banner /etc/ssh/banner.txt
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
Banner {{ '/etc/ssh/banner.txt' if ssh_banner else 'none' }}

{% if ansible_os_family == 'Debian' %}
DebianBanner {{ 'yes' if ssh_print_debian_banner else 'no' }}
{% endif %}

{% if sftp_enabled %}
# Configuration, in case SFTP is used
Expand Down