web-logs: Initial version of role

This commit is contained in:
Timo Makinen 2021-09-18 18:46:12 +00:00
parent 8a2471f932
commit 8f54421d17
4 changed files with 108 additions and 0 deletions

View file

@ -0,0 +1,10 @@
# {{ ansible_managed }}
{% for host in groups['webservers'] %}
[{{ host.split('.')[0] }}]
type = sftp
host = {{ host }}
user = logsync
key_file = ~/.ssh/id_ed25519
known_hosts_file = /etc/ssh/ssh_known_hosts
{% endfor %}

View file

@ -0,0 +1,5 @@
{% for host, vars in hostvars|dictsort %}
{% if vars["ansible_ssh_host_key_ed25519_public"] is defined %}
{{ host }} ssh-ed25519 {{ vars["ansible_ssh_host_key_ed25519_public"] }}
{% endif %}
{% endfor %}