Browse Source

Merge pull request #44 from elfixit/master

add options to give a key size to generate_key
tags/v0.41.0
Nitin Madhok 9 years ago
parent
commit
1c5f6ee889
2 changed files with 6 additions and 0 deletions
  1. +5
    -0
      openssh/config.sls
  2. +1
    -0
      pillar.example

+ 5
- 0
openssh/config.sls View File

{% if salt['pillar.get']('openssh:generate_' ~ keyType ~ '_keys', False) %} {% if salt['pillar.get']('openssh:generate_' ~ keyType ~ '_keys', False) %}
ssh_generate_host_{{ keyType }}_key: ssh_generate_host_{{ keyType }}_key:
cmd.run: 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 - name: ssh-keygen -t {{ keyType }} -N '' -f /etc/ssh/ssh_host_{{ keyType }}_key
{%- endif %}
- creates: /etc/ssh/ssh_host_{{ keyType }}_key - creates: /etc/ssh/ssh_host_{{ keyType }}_key
- user: root - user: root



+ 1
- 0
pillar.example View File

ecdsa-sha2-nistp256 NOT_DEFINED ecdsa-sha2-nistp256 NOT_DEFINED


generate_rsa_keys: False generate_rsa_keys: False
generate_rsa_size: 4096
absent_rsa_keys: False absent_rsa_keys: False
provide_rsa_keys: False provide_rsa_keys: False
rsa: rsa:

Loading…
Cancel
Save