aws-rolling-restarter
Advanced tools
Comparing version 0.1.4 to 0.2.0
{ | ||
"name": "aws-rolling-restarter", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"description": "Progressively restarts ec2 instances under any Opsworks layer, x machines at a time", | ||
@@ -5,0 +5,0 @@ "main": "RollingRestarter.js", |
@@ -25,8 +25,8 @@ RollingRestarter | ||
restarter.init({ | ||
accessKeyId: "Your accessKeyId", | ||
secretAccessKey: "Your secretAccessKey", | ||
region: "region where your machines are hosted", | ||
layerId: "the layer under which the ec2 instances are", | ||
groupSize: 2 // the amount of ec2 instances you want to restart at a time. | ||
accessKeyId: "Your accessKeyId", | ||
secretAccessKey: "Your secretAccessKey", | ||
region: "region where your machines are hosted", | ||
layerId: "the layer under which the ec2 instances are", | ||
groupSize: 2, // the amount of ec2 instances you want to restart at a time. | ||
retryOnSetupFailed: true, // whether or not to attempt stopping and starting again if machine ends up with setup_failed status. Default: false | ||
}); | ||
@@ -33,0 +33,0 @@ |
@@ -98,8 +98,15 @@ var AWS = require("aws-sdk"); | ||
console.log("did the weird thing. attempting to start " + machine.name + " again."); | ||
startMachine(machine); | ||
startMachine(machine, machineNum); | ||
} | ||
else if (data["Instances"[0].status] == "setup failed") { | ||
else if (data["Instances"][0].Status == "setup_failed") { | ||
clearInterval(checkIfOnline); | ||
console.log("( " + machine.name + " ) setup failed. stopping then starting again." ); | ||
stopMachine(machine); | ||
console.log("( " + machine.name + " ) setup failed." ); | ||
if (global.retryOnSetupFailed) { | ||
console.log("( " + machine.name + " ) retrying" ); | ||
stopMachine(machine, machineNum); | ||
} | ||
else { | ||
global.old_machines.total -= 1; | ||
} | ||
} | ||
@@ -160,5 +167,6 @@ }); | ||
global.groupSize = config.groupSize; | ||
global.retryOnSetupFailed: config.retryOnSetupFailed || false | ||
}, | ||
start: start | ||
} | ||
} |
6866
4
143