Skip to content

Commit 4cd37e4

Browse files
committed
fix: error message when no weak DH ciphers found
1 parent 2f9cda0 commit 4cd37e4

File tree

1 file changed

+3
-3
lines changed
  • infrastructure/server-setup/tasks/all

1 file changed

+3
-3
lines changed

infrastructure/server-setup/tasks/all/users.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@
144144

145145
- name: Check short Diffie-Hellman keys
146146
ansible.builtin.shell: |
147-
awk '$5 < 3071' /etc/ssh/moduli | grep -q .
147+
awk '$5 < 3071' /etc/ssh/moduli | grep -q . && echo "found" || echo "none"
148148
register: short_dh_keys
149-
ignore_errors: yes
149+
changed_when: false
150150

151151
- name: Remove short Diffie-Hellman keys
152152
ansible.builtin.shell: |
153153
awk '$5 >= 3071' /etc/ssh/moduli > /etc/ssh/moduli.safe
154154
mv /etc/ssh/moduli.safe /etc/ssh/moduli
155-
when: short_dh_keys.rc == 0
155+
when: '"found" in short_dh_keys.stdout'
156156
become: yes
157157

158158
# Cleanup weak server keys

0 commit comments

Comments
 (0)