Skip to content

Instantly share code, notes, and snippets.

@Jan-Bart
Jan-Bart / serverSetup.yml
Last active October 7, 2017 12:33
This will do the basic setup after getting your hands on a new server. It will create a new user, disable the root user and install/configure ufw, fail2ban, logwatch and postfix.
# Based on: https://ryaneschinger.com/blog/securing-a-server-with-ansible/
- hosts: all
gather_facts: false
pre_tasks:
- name: install python needed for ansible modules to work
raw: sudo bash -c "test -e /usr/bin/python || (apt -qqy update && apt install -qy python-minimal)"
tasks: