Created
January 9, 2016 18:48
-
-
Save kacole2/cbed7d374de05ed625fa to your computer and use it in GitHub Desktop.
Install REX-Ray on Multiple Hosts Created With Docker Machine
This file contains 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 | |
# Read more about REX-Ray storage persistance: | |
# https://github.com/emccode/rexray | |
# change the filter and grep to anything you want to search for. | |
# This example shows searching for the name of machines beginning with "dev" | |
# You can sort by driver or swarm instance, just change the awk column as well | |
ALLHOSTS=$(docker-machine ls --filter name=dev* | grep dev* | awk '{print $1}') | |
# This is the location of the REX-Ray Configuration file. ie, Your desktop | |
# Learn more about configuration files: http://rexray.readthedocs.org/en/latest/ | |
REXCONFIG="/Users/kcoleman/Desktop/rexconfig.yml" | |
for host in $ALLHOSTS | |
do | |
echo "$host: Installing REX-Ray" | |
docker-machine ssh $host "curl -sSL https://dl.bintray.com/emccode/rexray/install | sh -" | |
echo "$host: Setting Permissions for REX-Ray Config File" | |
docker-machine ssh $host "sudo chmod 777 /etc/rexray" | |
echo "$host: SCPing REX-Ray Config File from $REXCONFIG" | |
docker-machine scp $REXCONFIG $host:/etc/rexray/config.yml | |
echo "$host: Starting REX-Ray Service" | |
docker-machine ssh $host "sudo rexray start" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would probably be best to set permissions to 700 on that directory after transferring.