We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f9cda0 commit 4cd37e4Copy full SHA for 4cd37e4
infrastructure/server-setup/tasks/all/users.yml
@@ -144,15 +144,15 @@
144
145
- name: Check short Diffie-Hellman keys
146
ansible.builtin.shell: |
147
- awk '$5 < 3071' /etc/ssh/moduli | grep -q .
+ awk '$5 < 3071' /etc/ssh/moduli | grep -q . && echo "found" || echo "none"
148
register: short_dh_keys
149
- ignore_errors: yes
+ changed_when: false
150
151
- name: Remove short Diffie-Hellman keys
152
153
awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe
154
mv /etc/ssh/moduli.safe /etc/ssh/moduli
155
- when: short_dh_keys.rc == 0
+ when: '"found" in short_dh_keys.stdout'
156
become: yes
157
158
# Cleanup weak server keys
0 commit comments