Saltstack Official OpenSSH Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
924B

  1. {% from "openssh/map.jinja" import openssh with context %}
  2. include:
  3. - openssh
  4. sshd_config:
  5. file.managed:
  6. - name: {{ openssh.sshd_config }}
  7. - source: {{ openssh.sshd_config_src }}
  8. - template: jinja
  9. - user: root
  10. - mode: 644
  11. - watch_in:
  12. - service: openssh
  13. {% for keyType in ['ecdsa', 'dsa', 'rsa'] %}
  14. {% if salt['pillar.get']('openssh:provide_' ~ keyType ~ '_keys', False) %}
  15. ssh_host_{{ keyType }}_key:
  16. file.managed:
  17. - name: /etc/ssh/ssh_host_{{ keyType }}_key
  18. - contents_pillar: 'openssh:{{ keyType }}:private_key'
  19. - user: root
  20. - mode: 600
  21. - require_in:
  22. - service: {{ openssh.service }}
  23. ssh_host_{{ keyType }}_key.pub:
  24. file.managed:
  25. - name: /etc/ssh/ssh_host_{{ keyType }}_key.pub
  26. - contents_pillar: 'openssh:{{ keyType }}:public_key'
  27. - user: root
  28. - mode: 600
  29. - require_in:
  30. - service: {{ openssh.service }}
  31. {% endif %}
  32. {% endfor %}