main.yml 800 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. - name: Fix timezone
  3. file:
  4. src: /usr/share/zoneinfo/America/Los_Angeles
  5. dest: /etc/zoneinfo
  6. state: link
  7. - name: Disable cockpit
  8. systemd:
  9. name: cockpit.socket
  10. state: stopped
  11. enabled: no
  12. - name: Close cockpit port
  13. firewalld:
  14. zone: FedoraServer
  15. service: cockpit
  16. state: disabled
  17. permanent: yes
  18. immediate: yes
  19. - name: Remove cockpit motd banner
  20. file:
  21. path: /etc/motd.d/cockpit
  22. state: absent
  23. - name: Install fail2ban
  24. dnf:
  25. name: fail2ban
  26. state: present
  27. - name: Configure fail2ban
  28. template:
  29. src: ssh.local.j2
  30. dest: /etc/fail2ban/jail.d/ssh.local
  31. owner: root
  32. group: root
  33. mode: '0644'
  34. notify: Restart fail2ban
  35. - name: Start/enable fail2ban
  36. systemd:
  37. name: fail2ban
  38. state: started
  39. enabled: yes