Git Product home page Git Product logo

dofaucet's Introduction

dofaucet

tl;dr

Read YAML-formatted ansible inventory, create digitalocean droplets accordingly.

Neat tricks:

  • creates DNS records for both internal and external droplet IPs
  • adds ssh pubkeys to droplets (only keys already uploaded to DO)
  • adds all created droplets to a project so they're easy to identify

Example usage

Inventory

foo.yml

all:
  vars:
    do_ssh_key_names: ['my_key', 'my_friends_key']
    dofaucet_dnsroot: example.com
    do_project: test_webstack_ansible
    do_image_slug: fedora-29-x64

foohosts:
  vars:
    do_tags: foohosts
  hosts:
    foo.infra.example.com

barhosts:
  vars:
    do_tags: barhosts
    # the bar app needs more ram
    do_size_slug: s-1vcpu-2gb
  hosts:
    bar.infra.example.com

dofaucet CLI

dofaucet --token 23234242 --project foo --inventory foo.yml

future ideas

Ansible is python3, so we could use the native ansible functionality to parse the inventory. Example code:

from ansible.parsing.dataloader import DataLoader
from ansible.vars.manager import VariableManager
from ansible.inventory.manager import InventoryManager

loader = DataLoader()
inventory = InventoryManager(loader=loader, sources='~/inventory.yml')
variable_manager = VariableManager(loader=loader, inventory=inventory)

dofaucet's People

Contributors

avollmerhaus avatar

Watchers

 avatar  avatar

dofaucet's Issues

entry points broken

dofaucet --help
Traceback (most recent call last):
  File ".venv/bin/dofaucet", line 6, in <module>
    from cli import dofaucet
ModuleNotFoundError: No module named 'cli'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.