Last active
February 16, 2017 22:26
-
-
Save omar-yassin/b746ffa05f385923e612eee4006949d4 to your computer and use it in GitHub Desktop.
chef node search + create cluster ssh file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # gsplit for OSX - brew install coreutils | |
| # usage | |
| # ./script_name aws-live prod-core-web | |
| # will create files prod-core-web.00..x with 9 prod-core-web hosts in each. Then can feed to i2cssh or what ever cluster ssh tool you use | |
| env=$1 | |
| name_prefix=$2 | |
| knife search "chef_environment:${env} AND name:${name_prefix}*" -Fjson | jq -r .rows[].automatic.fqdn | sort > $name_prefix | |
| gsplit -d -l 9 $name_prefix $name_prefix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment