Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions roles/ssh/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@

- name: remove short diffie diffie-hellman
become: true
shell: |
awk '$5 >= 3071' /etc/ssh/moduli | sudo tee /etc/ssh/moduli.tmp
mv /etc/ssh/moduli.tmp /etc/ssh/moduli
notify: restart ssh service
shell:
creates: /etc/ssh/moduli.short
cmd: |
cp /etc/ssh/moduli /etc/ssh/moduli.short
awk '$5 >= 3071' /etc/ssh/moduli | tee /etc/ssh/moduli.tmp
if ! cmp /etc/ssh/moduli /etc/ssh/moduli.tmp; then
mv /etc/ssh/moduli.tmp /etc/ssh/moduli
fi
notify: restart ssh service
register: moduli_changed
changed_when: "'differ:' in moduli_changed.stdout"