https://github.com/ymichael/ansible-ubuntu-box
Simple Ansible plays to configure a Ubuntu Server (14.04).
https://github.com/ymichael/ansible-ubuntu-box
Last synced: 4 months ago
JSON representation
Simple Ansible plays to configure a Ubuntu Server (14.04).
- Host: GitHub
- URL: https://github.com/ymichael/ansible-ubuntu-box
- Owner: ymichael
- License: mit
- Created: 2015-05-26T11:02:43.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-27T13:54:26.000Z (about 11 years ago)
- Last Synced: 2025-08-19T09:58:35.363Z (10 months ago)
- Size: 145 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible Ubuntu Box
Simple Ansible plays to configure a Ubuntu Server (14.04).
I find myself having to do the same setup each time I start a new server. Simple
things like adding my public key to the authorized key file and configuring UFW
to allow some ports.
Here are somethings that are automated now:
- Creates and sets up a new user (`newuser.yml`)
- Creates new user
- Configures passwordless ssh access
- Adds user to sudoers
- Disable root ssh access
- Disable ssh access via passwords
- Installs various things (`main.yml`)
- Apt (`tasks/apt.yml`)
- Updates and upgrades apt-cache and installed packages
- Installs [Fail2ban](http://www.fail2ban.org/wiki/index.php/Main_Page)
- Installs [unattended-upgrades](https://wiki.debian.org/UnattendedUpgrades)
- UFW (`tasks/ufw.yml`)
- Reject all incoming connections by default
- Allow all outgoing connections by default
- Allow 22, 80, 443
- Nodejs (`tasks/nodejs.yml`)
- Docker (`tasks/docker.yml`)
- Git
- pip (Python)
## Usage
1. Add node ip to hosts file.
echo NODE_ID > hosts
2. Create new user on the droplet
ansible-playbook -i hosts newuser.yml -u root
3. Enter prompt for username and public key file.
4. Update hosts file to reflect new user
// hosts
NODE_ID ansible_ssh_private_key_file=PATH_TO_PRIVATE_KEY ansible_ssh_user=USERNAME
// Alternatively, update your ~/.ssh/config file.
5. Run the main play.
// Edit to exclude/include relevant tasks.
ansible-playbook -i hosts main.yml
## TODO
- Add more tasks to install various things/dependencies
## Credits
-
-
-