Add variable to specify host rsa key size (#394)

Signed-off-by: Norman Ziegner <[email protected]>
This commit is contained in:
Norman Ziegner authored and GitHub committed 2021-02-09 09:44:55 +01:00
1 parent a17f4a6f45
commit 614662b99d
3 files changed
+8 -2

No files matched your search

+3
View File
@@ -35,6 +35,9 @@ Warning: This role disables root-login on the target server! Please make sure yo
- `ssh_host_key_files`
- Default: `[]`
- Description: Host keys for sshd. If empty ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key'] will be used, as far as supported by the installed sshd version.
- `ssh_host_rsa_key_size`
- Default: `4096`
- Description: Specifies the number of bits in the private host RSA key to create.
- `ssh_host_key_algorithms`
- Default: `[]`
- Description: Host key algorithms that the server offers. If empty the [default list](https://man.openbsd.org/sshd_config#HostKeyAlgorithms) will be used, otherwise overrides the setting with specified list of algorithms.
+3
View File
@@ -36,6 +36,9 @@ ssh_listen_to: ['0.0.0.0'] # sshd
# Host keys to look for when starting sshd.
ssh_host_key_files: [] # sshd
# Host RSA key size in bits
ssh_host_rsa_key_size: 4096 # sshd
# Host certificates to look for when starting sshd.
ssh_host_certificates: [] # sshd
@@ -1,9 +1,9 @@
---
- name: replace default 2048 bits RSA keypair with 4096 bits keypair
- name: replace default 2048 bits RSA keypair
community.crypto.openssh_keypair:
state: present
type: rsa
size: 4096
size: "{{ ssh_host_rsa_key_size }}"
path: "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
force: false
regenerate: partial_idempotence