- installs python2 and aptitude
- upgrades all software
- creates user with sudo rights
- configures sshd: disables root login and password authentication, also allows to login only user created on prev step
- installs
- git
- ntp
- vim
- tmux
- htop
- curl
- configures automatic security updates (do not reloads server, only installs updates)
- setups timezone
- configures iptables and fail2ban
- create swap file
Create inventory
file. Its content is something like this
[web]
46.101.210.137
ansible-galaxy install -r requirements.yml
By default on ubuntu 16.04 there is no python 2 and aptitude. To fix it run:
ansible-playbook initial-setup.yml
Beside it this playbook also creates user and configures ssh server.
Copy vars/main.yml.example
to vars/main.yml
and change
variable values for your needs.
To generate password use
sudo apt-get install -y whois
mkpasswd --method=SHA-512
ansible-playbook main.yml
To run only specific roles
ansible-playbook main.yml --roles=user