0
0
mirror of https://github.com/saltstack-formulas/openssh-formula.git synced 2024-11-27 20:57:48 +01:00

add options to give a key size to generate_key

This commit is contained in:
elfixit 2015-07-12 18:09:26 +02:00
parent 22309fdee6
commit 18ba94d0fc
2 changed files with 6 additions and 0 deletions

View File

@ -17,7 +17,12 @@ sshd_config:
{% if salt['pillar.get']('openssh:generate_' ~ keyType ~ '_keys', False) %}
ssh_generate_host_{{ keyType }}_key:
cmd.run:
{%- if salt['pillar.get']('openssh:generate_' ~ keyType ~ '_size', False) %}
{%- set keySize = salt['pillar.get']('openssh:generate_' ~ keyType ~ '_size', 4096) %}
- name: ssh-keygen -t {{ keyType }} -b {{ keySize }} -N '' -f /etc/ssh/ssh_host_{{ keyType }}_key
{%- else %}
- name: ssh-keygen -t {{ keyType }} -N '' -f /etc/ssh/ssh_host_{{ keyType }}_key
{%- endif %}
- creates: /etc/ssh/ssh_host_{{ keyType }}_key
- user: root

View File

@ -91,6 +91,7 @@ openssh:
ecdsa-sha2-nistp256 NOT_DEFINED
generate_rsa_keys: False
generate_rsa_size: 4096
absent_rsa_keys: False
provide_rsa_keys: False
rsa: