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.

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