Skip to content

Commit 5d6201d

Browse files
committed
Improve common var definitions
1 parent 608621e commit 5d6201d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

roles/common/defaults/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ apt_packages_custom: {}
4040
apt_packages: "{{ apt_packages_default | combine(apt_packages_custom) }}"
4141

4242
openssh_6_8_plus: "{{ (lookup('pipe', 'ssh -V 2>&1')) | regex_replace('(.*OpenSSH_([\\d\\.]*).*)', '\\2') is version_compare('6.8', '>=') }}"
43-
overlapping_ciphers: "[{% for cipher in (sshd_ciphers_default + sshd_ciphers_extra) if cipher in ssh_client_ciphers %}'{{ cipher }}',{% endfor %}]"
44-
overlapping_kex: "[{% for kex in (sshd_kex_algorithms_default + sshd_kex_algorithms_extra) if kex in ssh_client_kex %}'{{ kex }}',{% endfor %}]"
45-
overlapping_macs: "[{% for mac in (sshd_macs_default + sshd_macs_extra) if mac in ssh_client_macs %}'{{ mac }}',{% endfor %}]"
46-
host_key_types: "[{% for path in sshd_host_keys %}'{{ path | regex_replace('/etc/ssh/ssh_host_(.+)_key', '\\1') | regex_replace('dsa', 'ssh-dss')}}',{% endfor %}]"
47-
overlapping_host_keys: "{% for key in host_key_types if key in ssh_client_host_key_algorithms %}{{ key }},{% endfor %}"
43+
overlapping_ciphers: "{{ (sshd_ciphers_default + sshd_ciphers_extra) | intersect(ssh_client_ciphers) }}"
44+
overlapping_kex: "{{ (sshd_kex_algorithms_default + sshd_kex_algorithms_extra) | intersect(ssh_client_kex) }}"
45+
overlapping_macs: "{{ (sshd_macs_default + sshd_macs_extra) | intersect(ssh_client_macs) }}"
46+
host_key_types: "{{ sshd_host_keys | map('regex_replace', '/etc/ssh/ssh_host_(.+)_key', '\\1') | map('regex_replace', 'dsa', 'ssh-dss') | list }}"
47+
overlapping_host_keys: "{{ host_key_types | intersect(ssh_client_host_key_algorithms) | join(',') }}"

0 commit comments

Comments
 (0)