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(3) dev(3) gems(1) howto(3) insights(1) internet(1) learning(1) lesson(1) mac(1) ops(8) post(1) projects(3) script(1) social(1) tools(1) tutorial(5)

* Tags *

api(2) apple(2) aws(3) bash(1) cloud(5) cluster(1) devices(1) docker(1) ec2(1) elasticsearch(1) gcp(1) gem(1) github(2) go(1) golang(2) google-authenticator(1) google-cloud(3) internet(1) iptables(1) kubernetes(1) linux(2) littleguardian(1) logging(1) mac(2) netgear(1) network(1) opensource(1) openvpn(1) osx(2) pci-compliance(1) review(1) ruby(2) security(2) ssh(1) tethering(1) tplink(1) ubuntu(1) wykop(1) yubikey(1)
comments powered by Disqus