main.yml 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. when:
  13. - ansible_os_family == 'Fedora'
  14. - name: Close cockpit port
  15. firewalld:
  16. zone: FedoraServer
  17. service: cockpit
  18. state: disabled
  19. permanent: yes
  20. immediate: yes
  21. when:
  22. - ansible_os_family == 'Fedora'
  23. - name: Remove cockpit motd banner
  24. file:
  25. path: /etc/motd.d/cockpit
  26. state: absent
  27. when:
  28. - ansible_os_family == 'Fedora'
  29. - name: Install fail2ban
  30. package:
  31. name: fail2ban
  32. state: present
  33. - name: Configure fail2ban
  34. template:
  35. src: ssh.local.j2
  36. dest: /etc/fail2ban/jail.d/ssh.local
  37. owner: root
  38. group: root
  39. mode: '0644'
  40. notify: Restart fail2ban
  41. - name: Start/enable fail2ban
  42. systemd:
  43. name: fail2ban
  44. state: started
  45. enabled: yes