philkry / ansible-digitalocean

DIgital Ocean Bootstrap Ansible playbooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Digital Ocean Bootstrap

Bootstrap Digital Ocean droplets using Ansible to:

  • Configure SSH key
  • Launch a droplet
  • Configure DNS domain
  • Destroy droplet

Inspired by hostmaster/ansible-digitalocean-bootstrap.

Installation

Digital Ocean configuration

Create a new API key on the API access page. Only API v1 is supported currently by Ansible. Add the client_id and api_key to vars.yml.

Playbooks

launch.yml

Launch and provision a new server on Digital Ocean.

ansible-playbook -i hosts launch.yml

What this Playbook do for you?

  • configure swap file
  • install ufw, fail2ban
  • configure ufw allow ports for SSH
  • make sshd more secure:
    • PermitRootLogin=no
    • PasswordAuthentication=no
    • AllowGroups=sudo
  • config sudoers

destroy.yml

Destroys a server on Digital Ocean.

ansible-playbook -i hosts destroy.yml

About

DIgital Ocean Bootstrap Ansible playbooks


Languages

Language:JavaScript 100.0%