debugging of cleanup code for create_ami, stub implementation of copying up of SSL and proxy restart as part of initial VM creation
This commit is contained in:
Родитель
cc635b5c41
Коммит
33f01d08e1
13
awsbox.js
13
awsbox.js
|
@ -140,7 +140,16 @@ verbs['create'] = function(args) {
|
|||
var postcreate = (awsboxJson.hooks && awsboxJson.hooks.postcreate) || null;
|
||||
ssh.runScript(deets.ipAddress, postcreate, function(err, r) {
|
||||
checkErr(err);
|
||||
printInstructions(name, deets);
|
||||
|
||||
if (opts.p && opts.s) {
|
||||
console.log(" ... copying up SSL cert");
|
||||
ssh.copySSL(deets.ipAddress, opts.p, opts.s, function(err) {
|
||||
checkErr(err);
|
||||
printInstructions(name, deets);
|
||||
});
|
||||
} else {
|
||||
printInstructions(name, deets);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -162,8 +171,8 @@ verbs['create_ami'] = function(args) {
|
|||
console.log("restoring to a pristine state, and creating AMI image from " + name);
|
||||
|
||||
vm.describe(name, function(err, deets) {
|
||||
console.log("instance found, ip " + deets.ipAddress + ", restoring");
|
||||
checkErr(err);
|
||||
console.log("instance found, ip " + deets.ipAddress + ", restoring");
|
||||
ssh.makePristine(deets.ipAddress, function(err) {
|
||||
console.log("instance is pristine, creating AMI");
|
||||
checkErr(err);
|
||||
|
|
|
@ -25,14 +25,13 @@ exports.copyUpConfig = function(host, config, cb) {
|
|||
});
|
||||
};
|
||||
|
||||
// XXX: out of date! fixme!
|
||||
exports.copySSL = function(host, pub, priv, cb) {
|
||||
var cmd = 'scp -o "StrictHostKeyChecking no" ' + pub + ' ec2-user@' + host + ":/etc/ssl/certs/hacksign.in.crt";
|
||||
var cmd = 'scp -o "StrictHostKeyChecking no" ' + pub + ' proxy@' + host + ":.";
|
||||
child_process.exec(cmd, function(err, r) {
|
||||
if (err) return cb(err);
|
||||
var cmd = 'scp -o "StrictHostKeyChecking no" ' + priv + ' ec2-user@' + host + ":/etc/ssl/certs/hacksign.in.key";
|
||||
var cmd = 'scp -o "StrictHostKeyChecking no" ' + priv + ' proxy@' + host + ":.";
|
||||
child_process.exec(cmd, function(err, r) {
|
||||
var cmd = 'ssh -o "StrictHostKeyChecking no" ec2-user@' + host + " 'sudo /etc/init.d/nginx restart'";
|
||||
var cmd = 'ssh -o "StrictHostKeyChecking no" proxy@' + host + " 'forever restartall'";
|
||||
child_process.exec(cmd, cb);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@ jsel = require('JSONSelect'),
|
|||
key = require('./key.js'),
|
||||
sec = require('./sec.js');
|
||||
|
||||
const TEMPLATE_IMAGE_ID = 'ami-10852479';
|
||||
const TEMPLATE_IMAGE_ID = 'ami-ac8524c5';
|
||||
|
||||
function extractInstanceDeets(horribleBlob) {
|
||||
var instance = {};
|
||||
|
|
Загрузка…
Ссылка в новой задаче