Giter Club home page Giter Club logo

doconsole's Introduction

DigitalOcean Console (DOConsole)

DOConsole is a command-line interface (CLI) tool that allows you to manage DigitalOcean droplets and run Ansible playbooks. The tool provides functionalities to set configurations, create and destroy droplets, add tags, run Ansible playbooks, and more.

Features

  • Manage Droplets: List, create, destroy, and tag DigitalOcean droplets.
  • Run Ansible Playbooks: Execute Ansible playbooks on your droplets.
  • SSH Access: SSH into your droplets directly from the console.
  • Customizable Settings: Configure default region, size, and image for new droplets.

Installation

  1. Clone the Repository:

    git clone https://github.com/josephberger/doconsole.git
    cd doconsole
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Ensure Ansible is Installed:

    sudo apt install ansible

Usage

  1. Run the Console:

    python doconsole.py --token YOUR_DO_TOKEN --ssh_key PATH_TO_YOUR_SSH_KEY
  2. Commands Overview:

    • Set Configurations:
      set <droplet|playbook|token|ssh_key|reigon|size|image>
      • Example: set droplet 1
    • Show Information:
      show <droplets|playbooks|tags|target|info>
      • Example: show droplets
    • Create Droplet:
      create droplet <name>
      • Example: create droplet my-new-droplet
    • Add Tag:
      add tag <tag_name>
      • Example: add tag production
    • Run Playbook:
      run playbook <playbook_path>
      • Example: run playbook setup.yml
    • Destroy Droplet:
      destroy
      • Example: destroy
    • SSH into Droplet:
      ssh
      • Example: ssh

Examples

  1. Initialize Console:

    python doconsole.py --token YOUR_DO_TOKEN --ssh_key PATH_TO_YOUR_SSH_KEY --init
  2. List Droplets and Playbooks on Startup:

    python doconsole.py --token YOUR_DO_TOKEN --ssh_key PATH_TO_YOUR_SSH_KEY --init
  3. Run a Playbook on a Droplet:

    set droplet 1
    set playbook 0
    run playbook

Command Details

  • set:

    • Set various configurations such as the target droplet, active playbook, API token, SSH key, default region, size, and image.
  • show:

    • Display information about droplets, playbooks, tags, target droplet, and console info.
  • create:

    • Create a new droplet with the specified name using default or configured settings.
  • add:

    • Add a tag to the selected droplet(s).
  • run:

    • Run the specified Ansible playbook on the target droplet.
  • destroy:

    • Destroy the selected droplet(s).
  • ssh:

    • Start an SSH session to the target droplet.

Configuration

  • API Token: Your DigitalOcean API token. Required for all operations.
  • SSH Key: Path to your SSH private key. Required for connecting to droplets and running playbooks.
  • Ansible Playbooks Directory: Directory containing your Ansible playbooks. Defaults to ./playbooks.

Contribution

Feel free to submit issues or pull requests if you have any improvements or bug fixes.

License

This project is licensed under the MIT License.

Feel free to contribute to this project by reporting issues or submitting pull requests on GitHub.

doconsole's People

Contributors

josephberger avatar

Watchers

 avatar

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.