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.

56 lines
1.3KB

  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. - group: root
  11. - mode: 644
  12. - watch_in:
  13. - service: openssh
  14. {% if salt['pillar.get']('openssh:provide_dsa_keys', False) %}
  15. ssh_host_dsa_key:
  16. file.managed:
  17. - name: /etc/ssh/ssh_host_dsa_key
  18. - contents_pillar: 'openssh:dsa:private_key'
  19. - user: root
  20. - mode: 600
  21. - require_in:
  22. - service: {{ openssh.service }}
  23. ssh_host_dsa_key.pub:
  24. file.managed:
  25. - name: /etc/ssh/ssh_host_dsa_key.pub
  26. - contents_pillar: 'openssh:dsa:public_key'
  27. - user: root
  28. - mode: 600
  29. - require_in:
  30. - service: {{ openssh.service }}
  31. {% endif %}
  32. {% if salt['pillar.get']('openssh:provide_rsa_keys', False) %}
  33. ssh_host_rsa_key:
  34. file.managed:
  35. - name: /etc/ssh/ssh_host_rsa_key
  36. - contents_pillar: 'openssh:rsa:private_key'
  37. - user: root
  38. - mode: 600
  39. - require_in:
  40. - service: {{ openssh.service }}
  41. ssh_host_rsa_key.pub:
  42. file.managed:
  43. - name: /etc/ssh/ssh_host_rsa_key.pub
  44. - contents_pillar: 'openssh:rsa:public_key'
  45. - user: root
  46. - mode: 600
  47. - require_in:
  48. - service: {{ openssh.service }}
  49. {% endif %}