Saltstack Official OpenSSH Formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

11 лет назад
11 лет назад
11 лет назад
11 лет назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. openssh:
  2. pkg:
  3. - installed
  4. {% if grains['os_family'] == 'Debian' %}
  5. - name: openssh-server
  6. {% endif %}
  7. service.running:
  8. - enable: True
  9. {% if grains['os_family'] == 'RedHat' %}
  10. - name: sshd
  11. {% else %}
  12. - name: ssh
  13. {% endif %}
  14. - require:
  15. - pkg: openssh
  16. - file: sshd_banner
  17. - watch:
  18. - file: sshd_config
  19. {% if salt['pillar.get']('openssh:provide_dsa_keys', False) %}
  20. - file: /etc/ssh/ssh_host_dsa_key
  21. - file: /etc/ssh/ssh_host_dsa_key.pub
  22. {% endif %}
  23. {% if salt['pillar.get']('openssh:provide_rsa_keys', False) %}
  24. - file: /etc/ssh/ssh_host_rsa_key
  25. - file: /etc/ssh/ssh_host_rsa_key.pub
  26. {% endif %}
  27. sshd_config:
  28. file.managed:
  29. - name: /etc/ssh/sshd_config
  30. - source: salt://openssh/files/sshd_config
  31. - user: root
  32. - mode: 600
  33. sshd_banner:
  34. file.managed:
  35. - name: /etc/ssh/banner
  36. - source: salt://openssh/files/banner
  37. - template: jinja
  38. {% if salt['pillar.get']('openssh:provide_dsa_keys', False) %}
  39. ssh_host_dsa_key:
  40. file.managed:
  41. - name: /etc/ssh/ssh_host_dsa_key
  42. - contents_pillar: 'openssh:dsa:private_key'
  43. - user: root
  44. - mode: 600
  45. ssh_host_dsa_key.pub:
  46. file.managed:
  47. - name: /etc/ssh/ssh_host_dsa_key.pub
  48. - contents_pillar: 'openssh:dsa:public_key'
  49. - user: root
  50. - mode: 600
  51. {% endif %}
  52. {% if salt['pillar.get']('openssh:provide_rsa_keys', False) %}
  53. ssh_host_rsa_key:
  54. file.managed:
  55. - name: /etc/ssh/ssh_host_rsa_key
  56. - contents_pillar: 'openssh:rsa:private_key'
  57. - user: root
  58. - mode: 600
  59. ssh_host_rsa_key.pub:
  60. file.managed:
  61. - name: /etc/ssh/ssh_host_rsa_key.pub
  62. - contents_pillar: 'openssh:rsa:public_key'
  63. - user: root
  64. - mode: 600
  65. {% endif %}