You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
541 B
35 lines
541 B
3 years ago
|
---
|
||
|
# 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
|