This repository contains a basic Ansible role used for bootstrapping an Ubuntu server.
The included tasks are:
- Copy configuration files
- Configure locale
- Install and update Ubuntu packages
- Create users, assigning groups and public keys
- Basic security configuration:
- Disable SSH root access
- Disable password authentication
- Install Fail2ban
- Configure UFW Firewall
- Install and configure Nullmailer with Mandrill
- Install and configure NewRelic server monitoring
Only tested against Vagrant Trusty64 box, it should also work in Precise
ansible.cfg and hosts are configured to connect to a Vagrant server running with a default configuration (localhost in port 2222). If you are using Vagrant 1.7 or greater, update private_file_key path in ansible.cfg as explained in Ansible documentation
First of all, install Ansible, in Ubuntu:
sudo add-apt-repository ppa:rquillo/ansible
sudo apt-get update
sudo apt-get install ansible
Install Vagrant and create a server
vagrant init ubuntu/trusty64
vagrant up
Now, check the connection from Ansible to the server. From the project root you can ping to the server
ansible dev -m ping
And check the setup
ansible dev -m setup
Once checked, update the file development.yml with your own configuration, if not configured properly, the installation will not work.
Finally, the role can be executed using
ansible-playbook bootstrap.yml
If you don't need any of the tasks, just comment them in the main.yml file of the role.
Released under the MIT License, Copyright (c) 2014-15 - Diego Rodríguez