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.

58 lines
1.4KB

  1. {## Start with defaults from defaults.yaml ##}
  2. {% import_yaml "openssh/defaults.yaml" as default_settings %}
  3. {##
  4. Setup variable using grains['os_family'] based logic, only add key:values here
  5. that differ from whats in defaults.yaml
  6. ##}
  7. {% set os_family_map = salt['grains.filter_by']({
  8. 'Arch': {
  9. 'server': 'openssh',
  10. 'client': 'openssh',
  11. 'service': 'sshd',
  12. },
  13. 'Debian': {
  14. 'server': 'openssh-server',
  15. 'client': 'openssh-client',
  16. 'service': 'ssh',
  17. },
  18. 'FreeBSD': {
  19. 'service': 'sshd',
  20. 'dig_pkg': 'bind-tools',
  21. 'Subsystem': 'sftp /usr/libexec/sftp-server',
  22. },
  23. 'Gentoo': {
  24. 'server': 'net-misc/openssh',
  25. 'client': 'net-misc/openssh',
  26. 'service': 'sshd',
  27. 'dig_pkg': 'net-dns/bind-tools',
  28. },
  29. 'RedHat': {
  30. 'server': 'openssh-server',
  31. 'client': 'openssh',
  32. 'service': 'sshd',
  33. 'dig_pkg': 'bind-utils',
  34. },
  35. 'Suse': {
  36. 'server': 'openssh',
  37. 'client': 'openssh',
  38. 'service': 'sshd',
  39. 'dig_pkg': 'bind-utils',
  40. },
  41. }
  42. , grain="os_family"
  43. , merge=salt['pillar.get']('openssh:lookup'))
  44. %}
  45. {## Merge the flavor_map to the default settings ##}
  46. {% do default_settings.openssh.update(os_family_map) %}
  47. {## Merge in openssh:lookup pillar ##}
  48. {% set openssh = salt['pillar.get'](
  49. 'openssh',
  50. default=default_settings.openssh,
  51. merge=True
  52. )
  53. %}