2019-07-04 01:07:34 +02:00
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
2020-07-31 10:54:40 +02:00
|
|
|
{%- from tplroot ~ "/map.jinja" import mapdata with context %}
|
2019-07-04 01:07:34 +02:00
|
|
|
{%- from tplroot ~ "/libtofs.jinja" import files_switch %}
|
2020-07-31 10:54:40 +02:00
|
|
|
{%- set openssh = mapdata.openssh %}
|
2015-03-26 17:50:32 +01:00
|
|
|
|
2021-03-25 02:13:00 +01:00
|
|
|
{%- if openssh.dig_pkg %}
|
2015-03-26 17:50:32 +01:00
|
|
|
ensure dig is available:
|
|
|
|
pkg.installed:
|
|
|
|
- name: {{ openssh.dig_pkg }}
|
2021-03-25 02:13:00 +01:00
|
|
|
- require_in:
|
|
|
|
- file: manage ssh_known_hosts file
|
|
|
|
{%- endif %}
|
2015-03-26 17:50:32 +01:00
|
|
|
|
|
|
|
manage ssh_known_hosts file:
|
|
|
|
file.managed:
|
|
|
|
- name: {{ openssh.ssh_known_hosts }}
|
2019-07-04 01:07:34 +02:00
|
|
|
- source: {{ files_switch( [openssh.ssh_known_hosts_src],
|
|
|
|
'manage ssh_known_hosts file'
|
2019-06-25 06:31:34 +02:00
|
|
|
) }}
|
2015-03-26 17:50:32 +01:00
|
|
|
- template: jinja
|
2020-07-17 10:48:32 +02:00
|
|
|
- context:
|
2020-07-20 16:28:22 +02:00
|
|
|
known_hosts: {{ openssh | traverse("known_hosts", {}) | json }}
|
2015-03-26 17:50:32 +01:00
|
|
|
- user: root
|
2017-03-04 14:19:52 +01:00
|
|
|
- group: {{ openssh.ssh_config_group }}
|
2015-03-26 17:50:32 +01:00
|
|
|
- mode: 644
|