--- - hosts: servers - became: true tasks: - name: Installs fail2ban apt: pkg=fail2ban state=installed update_cache=true handlers: - name: start fail2ban service: name=fail2ban state=started