main.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: Loosen up systemd-oomd defaults
  30. lineinfile:
  31. path: /etc/systemd/oomd.conf
  32. regexp: '^DefaultMemoryPressureLimit='
  33. insertafter: '^#DefaultMemoryPressureLimit='
  34. line: DefaultMemoryPressureLimit=80%
  35. - name: Install fail2ban
  36. package:
  37. name: fail2ban
  38. state: present
  39. - name: Configure fail2ban
  40. template:
  41. src: ssh.local.j2
  42. dest: /etc/fail2ban/jail.d/ssh.local
  43. owner: root
  44. group: root
  45. mode: '0644'
  46. notify: Restart fail2ban
  47. - name: Start/enable fail2ban
  48. systemd:
  49. name: fail2ban
  50. state: started
  51. enabled: yes