main.yml 770 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. - name: Delete old host keys
  3. ansible.builtin.file:
  4. path: "/etc/dropbear/dropbear_rsa_host_key"
  5. state: absent
  6. notify:
  7. - Save changes
  8. - name: Copy host keys
  9. template:
  10. src: templates/host_key.j2
  11. dest: /etc/dropbear/dropbear_ed25519_host_key
  12. owner: root
  13. group: root
  14. mode: 0600
  15. notify:
  16. - Save changes
  17. - name: Copy authorized keys
  18. template:
  19. src: templates/authorized_keys.j2
  20. dest: /etc/dropbear/authorized_keys
  21. owner: root
  22. group: root
  23. mode: 0600
  24. notify:
  25. - Save changes
  26. - name: Disable password authentication
  27. uci:
  28. command: section
  29. config: dropbear
  30. type: dropbear
  31. find_by:
  32. Port: 22
  33. value:
  34. PasswordAuth: off
  35. RootPasswordAuth: off
  36. notify:
  37. - Save changes