raczylo.com blog ~ #

Mass - DevOPS tool to work in cloud environment

Created on 2015-01-10 in categories dev , projects , tools
Tagged as: ruby , cloud , aws , google cloud , github

Mass - ruby tool to make your work with cloud environment easier, especially when you have more than 10+ servers and environments to support.

Mass? Whaaat?

In one of my previous roles I’ve met Kevin - incredibly bright mind and creator of MASS. It was a tool which all of us embraced and used on daily basis. Unfortunately - it uses PHP, Achel ( language invented by Kevin ) and it’s pretty difficult to modify - at least for me. To make my life easier I decided to spent few hours and create ruby version of mass, doing what “needs to be done” with similar functionality to the original project. Here it is - mass at github.

What does it do?

Current status ( 03/2015 ) - nothing too fancy.

  • Lists all your instances
  • Allows you to filter results by every field present
  • Allows “raw” output to make it easier to parse for your scripts
  • Allows to open multiple ssh sessions to multiple hosts in one go

Usage examples

Filtering by field ( woohoo, regexp power! )

mass --account potato --filter "size::.*micro"
mass --account banana --filter "hostname::^master.*" -d

Filtering by multiple fields

mass --account minions --filter "size::.*micro,,hostname::natbox"

SSH to the hosts using their internal IP

./mass --account=pq_prod --filter 'hostname::(front).*staging.*' --ssh --internal

bonus If you need to tunnel your ssh connection via certain host - create following tag for each host you need to tunnel to bastion:IP address or hostname

Available options

-a, --all                        Show all the accounts, no filtering, no accounts and clouds separation.
-c, --account=<s>                Cloud account set in your configuration file
-l, --cloud=<s>                  Cloud service you'd like to use. Must comply with your settings file.
-o, --config=<s>                 Configuration file path. If non specified - using ~/.config.yaml
-d, --debug=<i>                  Debug and its level. Lower debug level equals to less information printed. (Default: 0)
-f, --filter=<s>                 Filtering results. Please refer to README.md for filters documentation.
-r, --raw=<s>                    Printing out without tables, separator of your choice. (Default: ;;)
-e, --region=<s>                 Cloud account region to use
-b, --bastion=<s>                Bastion host to tunnel through
-x, --external                   Use external IP ( for SSH and listing )
-i, --internal, --no-internal    Use internal IP ( for SSH ) (default: true)
-s, --ssh                        Open SSH connection to all the results
-u, --update                     Flush cache for specified result set
-w, --width=<i>                  Max columng width (default: 120)
-v, --version                    Print version and exit
-h, --help                       Show this message

Want to know more?

Please see the project README for always up-to-date information.

* Table of contents *

* Check other posts *

* Categories *

aws(1) cloud(2) dev(2) gems(1) howto(3) mac(1) ops(7) projects(2) script(1) tools(1) tutorial(4)

* Tags *

api(1) apple(2) aws(3) bash(1) cloud(4) cluster(1) ec2(1) elasticsearch(1) gem(1) github(1) google-authenticator(1) google-cloud(1) iptables(1) linux(2) logging(1) mac(2) opensource(1) openvpn(1) osx(2) pci-compliance(1) ruby(2) security(2) ssh(1) ubuntu(1) wykop(1) yubikey(1)
comments powered by Disqus