add support to define per host settings for the ssh client

This commit is contained in:
nd 2021-06-12 18:25:15 +02:00
parent ab8c2c294e
commit 0d352e8ccf
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
2 changed files with 10 additions and 0 deletions

View file

@ -15,3 +15,5 @@ ssh:
MACs: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
user: {}
group: {}
client:
hosts: {}

View file

@ -8,3 +8,11 @@ HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
# add special rules for hosts defined in inventory variables
{% for i in ssh.client.hosts %}
Host {{ i }}
{% for j in ssh.client.hosts[i]|d({}) %}
{{ j }}={{ ssh.client.hosts[i][j] }}
{% endfor %}
{% endfor %}