This playbook will execute a initial server setup for Ubuntu systems.
The included tasks are following:
- Create a new regular user with sudo privileges
- Set authorized key for remote user
- Disable password authentication for root
- Update apt and install required system packages
- Configure and enable UFW
First of all, install the latest version of Ansible, in Ubuntu:
sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansiblegit clone https://github.com/beglov/ansible-bootstrap-ubuntu.git
cd ansible-bootstrap-ubuntucp hosts.sample hosts
nano hostsansible-playbook bootstrap.yml -i hosts -l [target] -u [remote user]