Refactor Ansible tasks and templates for improved consistency and clarity

This commit is contained in:
2026-07-31 02:24:42 +02:00
parent 81ef678904
commit 46327da2ac
52 changed files with 1679 additions and 1461 deletions
+10 -10
View File
@@ -177,8 +177,8 @@ HostbasedAuthentication no
# The allow/deny directives are processed in the following order: DenyUsers,
# AllowUsers, DenyGroups, and finally AllowGroups.
# By default, login is allowed for all users.
{% if (fact_sshd_allowed_users is defined) and fact_sshd_allowed_users %}
AllowUsers {{ fact_sshd_allowed_users }}
{% if (common_fact_sshd_allowed_users is defined) and common_fact_sshd_allowed_users %}
AllowUsers {{ common_fact_sshd_allowed_users }}
{% else %}
#AllowUsers back chris sysadm cityslang christoph
{% endif %}
@@ -239,8 +239,8 @@ UsePAM {{ sshd_use_pam }}
#
# The list of available key exchange algorithms may also be obtained using "ssh -Q kex".
#
{% if (fact_sshd_kexalgorithms is defined) and fact_sshd_kexalgorithms %}
KexAlgorithms {{ fact_sshd_kexalgorithms }}
{% if (common_fact_sshd_kexalgorithms is defined) and common_fact_sshd_kexalgorithms %}
KexAlgorithms {{ common_fact_sshd_kexalgorithms }}
{% else %}
#KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
{% endif %}
@@ -273,8 +273,8 @@ KexAlgorithms {{ fact_sshd_kexalgorithms }}
#
# The list of available ciphers may also be obtained using "ssh -Q cipher".
#
{% if (fact_sshd_ciphers is defined) and fact_sshd_ciphers %}
Ciphers {{ fact_sshd_ciphers }}
{% if (common_fact_sshd_ciphers is defined) and common_fact_sshd_ciphers %}
Ciphers {{ common_fact_sshd_ciphers }}
{% else %}
#Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr
{% endif %}
@@ -317,8 +317,8 @@ Ciphers {{ fact_sshd_ciphers }}
#
# The list of available MAC algorithms may also be obtained using "ssh -Q mac".
#
{% if (fact_sshd_macs is defined) and fact_sshd_macs %}
MACs {{ fact_sshd_macs }}
{% if (common_fact_sshd_macs is defined) and common_fact_sshd_macs %}
MACs {{ common_fact_sshd_macs }}
{% else %}
#MACs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,mac-sha2-256,hmac-sha2-512,hmac-sha1
{% endif %}
@@ -337,8 +337,8 @@ MACs {{ fact_sshd_macs }}
# ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
#
# The list of available key types may also be obtained using "ssh -Q key".
{% if (fact_sshd_hostkeyalgorithms is defined) and fact_sshd_hostkeyalgorithms %}
HostKeyAlgorithms {{ fact_sshd_hostkeyalgorithms }}
{% if (common_fact_sshd_hostkeyalgorithms is defined) and common_fact_sshd_hostkeyalgorithms %}
HostKeyAlgorithms {{ common_fact_sshd_hostkeyalgorithms }}
{% endif %}