X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FOyster%2FProvision.pm;h=af3aac844f4722e7c197b805d18120b4a86579d7;hb=cd23eeafa4313746d63966f13129282abd2e49bd;hp=36cd7cc4769d9149c33a9164110bc03c40a10c5e;hpb=10d26b8dcd7ce5a0a6ecdb76e2ac361964f272b2;p=p5sagit%2FOyster.git diff --git a/lib/Oyster/Provision.pm b/lib/Oyster/Provision.pm index 36cd7cc..af3aac8 100644 --- a/lib/Oyster/Provision.pm +++ b/lib/Oyster/Provision.pm @@ -2,21 +2,23 @@ package Oyster::Provision; use Moose; -has 'name' => ( is => 'ro', isa => 'Str', required => 1 ); -has 'size' => ( is => 'ro', isa => 'Str', required => 1 ); -has 'image' => ( is => 'ro', isa => 'Str', required => 1 ); -has 'pub_ssh' => ( is => 'ro', isa => 'Str', required => 1 ); - - -sub config { - return {provision_backend => 'Oyster::Provision::Rackspace'}; -} +has 'api_username' => ( is => 'ro', isa => 'Str'); +has 'api_password' => ( is => 'ro', isa => 'Str'); +has 'name' => ( is => 'ro', isa => 'Str'); +has 'size' => ( is => 'ro', isa => 'Str'); +has 'image' => ( is => 'ro', isa => 'Str'); +has 'pub_ssh' => ( is => 'ro', isa => 'Str'); +has 'provision_backend' => (is => 'rw', isa => 'Str', required => 1, default => 'Oyster::Provision::Rackspace' ); + +# TODO after provision, add the server's name with "oyster-" prefixed to the +# user's ~/.ssh/ssh_config file so any part of Oyster can ssh there +# passwordlessly for deploying or whatnot sub BUILD { my $self = shift; - my $role = $self->config()->{provision_backend}; + my $role = $self->provision_backend; eval "use $role"; "$role"->meta->apply($self);