Created
June 5, 2011 22:34
-
-
Save tsmith/1009502 to your computer and use it in GitHub Desktop.
node-control cluster and fallback config concept
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
/*global console, require, process */ | |
var path = require('path'), | |
control = require('control'), | |
task = control.task; | |
function configure(addresses) { | |
var config; | |
config = { | |
user: 'mylogin' | |
}; | |
return control.hosts(config, addresses); | |
} | |
task('cluster', 'Config for my cluster', function () { | |
var addresses; | |
addresses = [ 'a.mydomain.com', | |
'b.mydomain.com', | |
'c.mydomain.com' ]; | |
return configure(addresses); | |
}); | |
task('subset', 'Quick fallback for less than full cluster', function () { | |
return configure(['b.mydomain.com']); | |
}); | |
task('dummy', undefined, function (host) {}); | |
control.begin(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment