Skip to content

Instantly share code, notes, and snippets.

@tsmith
Created June 5, 2011 22:34
Show Gist options
  • Save tsmith/1009502 to your computer and use it in GitHub Desktop.
Save tsmith/1009502 to your computer and use it in GitHub Desktop.
node-control cluster and fallback config concept
/*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