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.

26 lines
793B

  1. {%- set tplroot = tpldir.split('/')[0] %}
  2. {%- from tplroot ~ "/map.jinja" import mapdata with context %}
  3. {%- from tplroot ~ "/libtofs.jinja" import files_switch %}
  4. {%- set openssh = mapdata.openssh %}
  5. {%- if openssh.dig_pkg %}
  6. ensure dig is available:
  7. pkg.installed:
  8. - name: {{ openssh.dig_pkg }}
  9. - require_in:
  10. - file: manage ssh_known_hosts file
  11. {%- endif %}
  12. manage ssh_known_hosts file:
  13. file.managed:
  14. - name: {{ openssh.ssh_known_hosts }}
  15. - source: {{ files_switch( [openssh.ssh_known_hosts_src],
  16. 'manage ssh_known_hosts file'
  17. ) }}
  18. - template: jinja
  19. - context:
  20. known_hosts: {{ openssh | traverse("known_hosts", {}) | json }}
  21. - user: root
  22. - group: {{ openssh.ssh_config_group }}
  23. - mode: 644