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

Commit 0a0735b

Browse files
committed
support for custom configuration
Signed-off-by: Matthias Lohr <mail@mlohr.com>
1 parent c7e102a commit 0a0735b

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Warning: This role disables root-login on the target server! Please make sure yo
7373
|`ssh_macs` | [] | Change this list to overwrite macs. Defaults found in `defaults/main.yml` |
7474
|`ssh_kex` | [] | Change this list to overwrite kexs. Defaults found in `defaults/main.yml` |
7575
|`ssh_ciphers` | [] | Change this list to overwrite ciphers. Defaults found in `defaults/main.yml` |
76+
|`ssh_custom_options` | [] | Custom lines for SSH client configuration |
77+
|`sshd_custom_options` | [] | Custom lines for SSH daemon configuration |
7678

7779
## Example Playbook
7880

defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,9 @@ ssh_server_revoked_keys: []
221221
# Set to false to turn the role into a no-op. Useful when using
222222
# the Ansible role dependency mechanism.
223223
ssh_hardening_enabled: true
224+
225+
# Custom options for SSH client configuration file
226+
ssh_custom_options: []
227+
228+
# Custom options for SSH daemon configuration file
229+
sshd_custom_options: []

templates/openssh.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,7 @@ Compression yes
115115
# Disable experimental client roaming. This is known to cause potential issues with secrets being disclosed to malicious servers and defaults to being disabled.
116116
UseRoaming {{ 'yes' if ssh_client_roaming else 'no' }}
117117
{% endif %}
118+
119+
{% for line in ssh_custom_options %}
120+
{{ line }}
121+
{% endfor %}

templates/opensshd.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ DebianBanner {{ 'yes' if (ssh_print_debian_banner|bool) else 'no' }}
221221
# Reject keys that are explicitly blacklisted
222222
RevokedKeys /etc/ssh/revoked_keys
223223

224+
{% for line in sshd_custom_options %}
225+
{{ line }}
226+
{% endfor %}
227+
224228
{% if sftp_enabled %}
225229
# SFTP matching configuration
226230
# ===========================

0 commit comments

Comments
 (0)