瀏覽代碼

Config: Add support for generating keys

master
Alan Pearce 10 年之前
父節點
當前提交
6fb57f40bc
共有 1 個檔案被更改,包括 8 行新增1 行删除
  1. +8
    -1
      openssh/config.sls

+ 8
- 1
openssh/config.sls 查看文件

@@ -14,7 +14,14 @@ sshd_config:
- service: openssh

{% for keyType in ['ecdsa', 'dsa', 'rsa'] %}
{% if salt['pillar.get']('openssh:provide_' ~ keyType ~ '_keys', False) %}
{% if salt['pillar.get']('openssh:generate_' ~ keyType ~ '_keys', False) %}
ssh_generate_host_{{ keyType }}_key:
cmd.run:
- name: ssh-keygen -t {{ keyType }} -N '' -f /etc/ssh/ssh_host_{{ keyType }}_key
- creates: /etc/ssh/ssh_host_{{ keyType }}_key
- user: root

{% elif salt['pillar.get']('openssh:provide_' ~ keyType ~ '_keys', False) %}
ssh_host_{{ keyType }}_key:
file.managed:
- name: /etc/ssh/ssh_host_{{ keyType }}_key

Loading…
取消
儲存