0
0
mirror of https://github.com/saltstack-formulas/openssh-formula.git synced 2024-11-30 22:15:33 +01:00
openssh-formula/openssh/known_hosts.sls
Daniel Dehennin 0b667cbcf5 fix(known_hosts): dig package does not install on Arch
The conditionnal on `ensure dig is available` does not work on Arch
since the `which` command does not exists. As the `pkg.installed`
state is idempotent, we don't need an extra check which depends on the
environment.

The `dig` utility is provided by `bind` on Arch and no more by
`bind-tools`.
2020-07-21 11:49:22 +02:00

23 lines
709 B
Plaintext

{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import openssh with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch %}
ensure dig is available:
pkg.installed:
- name: {{ openssh.dig_pkg }}
manage ssh_known_hosts file:
file.managed:
- name: {{ openssh.ssh_known_hosts }}
- source: {{ files_switch( [openssh.ssh_known_hosts_src],
'manage ssh_known_hosts file'
) }}
- template: jinja
- context:
known_hosts: {{ openssh | traverse("known_hosts", {}) | json }}
- user: root
- group: {{ openssh.ssh_config_group }}
- mode: 644
- require:
- pkg: ensure dig is available