Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

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)
    • 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

About

Simple Ansible plays to configure a Ubuntu Server (14.04).

Resources

License

Releases

No releases published

Packages

No packages published