All Projects → mihaitodor → wormhole

mihaitodor / wormhole

Licence: MIT license
A minimalistic Ansible-like tool for configuring remote servers via ssh

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to wormhole

pi-encrypted-boot-ssh
🔑 Raspberry Pi Encrypted Boot with Remote SSH
Stars: ✭ 96 (+336.36%)
Mutual labels:  ssh, remote
gpu-monitor
Script to remotely check GPU servers for free GPUs
Stars: ✭ 85 (+286.36%)
Mutual labels:  ssh, remote
Ipban
IPBan Monitors failed logins and bad behavior and bans ip addresses on Windows and Linux. Highly configurable, lean and powerful. Learn more at -->
Stars: ✭ 652 (+2863.64%)
Mutual labels:  configuration, remote
Sync
syncs your local folder with remote folder using scp
Stars: ✭ 293 (+1231.82%)
Mutual labels:  ssh, remote
Sshremotekeys
Managing SSH keys remotely to control access to hosts
Stars: ✭ 70 (+218.18%)
Mutual labels:  ssh, remote
Vscode Remote Release
Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
Stars: ✭ 2,256 (+10154.55%)
Mutual labels:  ssh, remote
re-mote
Re-mote operations using SSH and Re-gent
Stars: ✭ 61 (+177.27%)
Mutual labels:  ssh, remote
Simpleremote
Remote Administration Tools
Stars: ✭ 504 (+2190.91%)
Mutual labels:  ssh, remote
Ansible Ssh Hardening
This Ansible role provides numerous security-related ssh configurations, providing all-round base protection.
Stars: ✭ 746 (+3290.91%)
Mutual labels:  ssh, playbook
Getssl
obtain free SSL certificates from letsencrypt ACME server Suitable for automating the process on remote servers.
Stars: ✭ 1,687 (+7568.18%)
Mutual labels:  ssh, remote
configuration-service
Configuration Service is a distributed configuration provider for .NET Core.
Stars: ✭ 62 (+181.82%)
Mutual labels:  configuration, remote
jetrockets-standard
Standard RuboCop configuration for JetRockets with cookies
Stars: ✭ 14 (-36.36%)
Mutual labels:  configuration
zcolors
🌈 Z Colors uses your $LS_COLORS to generate a coherent theme for Git and your Zsh prompt, command line and completions.
Stars: ✭ 38 (+72.73%)
Mutual labels:  configuration
passbolt ansible
A complete (set of) playbook(s) to selfhost passbolt.
Stars: ✭ 15 (-31.82%)
Mutual labels:  playbook
tomlj
A Java parser for Tom's Obvious, Minimal Language (TOML).
Stars: ✭ 72 (+227.27%)
Mutual labels:  configuration
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+290.91%)
Mutual labels:  configuration
trezor-ssh-agent
Trezor SSH Agent for Windows (Putty, WinSCP and more) + KeepKey supported!
Stars: ✭ 54 (+145.45%)
Mutual labels:  ssh
Machfiles
The dotfiles you see in all my videos
Stars: ✭ 347 (+1477.27%)
Mutual labels:  configuration
onion
Layer based configuration for golang
Stars: ✭ 104 (+372.73%)
Mutual labels:  configuration
Project
Infrastructure
Stars: ✭ 43 (+95.45%)
Mutual labels:  configuration

Wormhole

Introduction

Wormhole is a minimalistic ansible-like tool.

It is designed to read a list of servers from inventory.yaml and run on each of them a playbook, for example wormhole.yaml.

Features

  • Connections to remote servers are performed via ssh using username/password authentication.
  • The scp protocol is used for copying files on remote servers.
  • Early playbook cancellation via SIGINT (Ctrl+C) / SIGTERM. The application will exit almost immediately.
  • Parallel execution on multiple hosts.
  • Super-fast build and execution times.

Build instructions

First, run bootstrap.sh to check dependencies and fetch the required version of Go. Afterwards, run build.sh to build and test the code. The main executable will be generated in ./wormhole.

Please note that both gcc and git need to be installed on the system.

This project has been tested on both OSX and Ubuntu.

Test against a Docker container

> sudo docker run --rm -p2222:22 -p80:80 rastasheep/ubuntu-sshd:14.04

> cat inventory.yaml
---

- host: localhost
  port: 2222
  username: root
  password: root

> ./wormhole playbooks/wormhole.yaml
INFO[0000] Running playbook on servers: localhost:2222
INFO[0000] Running task [1/6] on "localhost:2222": Install Apache and PHP
INFO[0015] Running task [2/6] on "localhost:2222": Configure Apache ServerName
INFO[0015] Running task [3/6] on "localhost:2222": Configure Apache default site
INFO[0015] Running task [4/6] on "localhost:2222": Restart Apache
INFO[0017] Running task [5/6] on "localhost:2222": Copy index.php
INFO[0017] Running task [6/6] on "localhost:2222": Validate host
INFO[0017] Playbook ran successfully on servers: localhost:2222

Code linter

Done via golangci-lint run.

Usage

For typical usage, add your servers to inventory.yaml and run ./wormhole path/to/playbook.yaml.

Use ./wormhole --help to get quick information about the rest of the parameters, which are optional.

Optional command line parameters

  • -i - The path to the server inventory file (default inventory.yaml), which is a Yaml sequence, each sequence item containing the connection details of a distinct server. Example server definition:
- host: "ec2-127-0-0-1.compute-1.amazonaws.com"
  port: 22
  username: ubuntu
  password: "Passw0rd!"
  • -c - The connection timeout for the ssh connection to the remote host

  • -e - The execution timeout for each command that will run via ssh

  • -m - The maximum number of servers on which the playbook will be executed in parallel

Playbooks

A playbook contains a list of named tasks that are executed in sequence on each server. Each task consists of a collection of actions.

For a detailed playbook example, please check wormhole.yaml.

Currently, the following actions are implemented:

File action

Copies a local file, src, to dest on a remote server with the specified owner, owner group and mode. Example playbook definition:

- name: Copy test.txt
  file:
    src:   files/test.txt
    dest:  /tmp/test.txt
    owner: root
    group: root
    mode:  "0644"

Apt action

Executes apt-get update and then apt-get <install/remove> -y <package> for each specified package on the remote server. Example playbook definition:

- name: Install Apache and PHP
  apt:
    state: install
    pkg:
      - apache2
      - php5

Service action

Executes service <service_name> <start/stop/restart> on the remote server. Example playbook definition:

- name: Restart Apache
  service:
    name: apache2
    state: restart

Shell action

Executes a shell command on the remote server. Example playbook definition:

- name: Enable servername.conf for Apache
  shell: "a2enconf -q servername"

Validate action

Validates that a remote server can be reached on a given port after at most retries attempts. Each attempt needs to respond within the specified timeout with the specified status_code and body_content. Example playbook definition:

- name: Validate host
  validate:
    scheme:       http
    port:         80
    url_path:     "/"
    retries:      3
    timeout:      3s
    status_code:  200
    body_content: "Hello, world!"

TODO

  • Integration tests against a Docker container
  • Continuous integration
  • Support for ActionFileTemplate using Go's package template
  • Verbose mode: Copy and print stdout and stderr from the remote process
  • Better user input validation for the playbook and the inventory
  • More unit tests
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].