---
- name: installs setups security components for server
  hosts: aws
  become: true
  tasks:
    - name: install fail2ban
      apt:
        name: fail2ban
        state: latest

    - name: enable the service
      systemd:
        name: fail2ban
        state: started
        enabled: true