--- # This playbook sets up a new server by creating your user account, hardening # OpenSSH's configuration, and installing ufw and fail2ban. - name: create user hosts: all remote_user: root roles: - user - name: harden OpenSSH hosts: all remote_user: "{{ username }}" become: yes roles: - harden-openssh - name: install ufw hosts: all remote_user: "{{ username }}" become: yes roles: - ufw - name: install fail2ban hosts: all remote_user: "{{ username }}" become: yes roles: - fail2ban