X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=.build%2F0ey2IQdAX1%2Flib%2FOyster%2FProvision.pm;fp=.build%2F0ey2IQdAX1%2Flib%2FOyster%2FProvision.pm;h=0c1aaa6f8101642b9c656880c5399b0b4c6218fe;hb=6b832bd6eabfef633627b14a5252110b8653e310;hp=0000000000000000000000000000000000000000;hpb=83928564ffca265f67e17d34adc15d12d5319537;p=p5sagit%2FOyster.git diff --git a/.build/0ey2IQdAX1/lib/Oyster/Provision.pm b/.build/0ey2IQdAX1/lib/Oyster/Provision.pm new file mode 100644 index 0000000..0c1aaa6 --- /dev/null +++ b/.build/0ey2IQdAX1/lib/Oyster/Provision.pm @@ -0,0 +1,77 @@ +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 ); + +has 'config' => (is => 'rw', isa => 'HashRef', required => 1 ); + +sub BUILD { + + my $self = shift; + + if(!exists($self->config()->{provision_backend})) { + $self->config()->{provision_backend} = 'Oyster::Provision::Rackspace'; + } + + my $role = $self->config()->{provision_backend}; + + eval "use $role"; + "$role"->meta->apply($self); +} + +1; + +__END__ + +=head1 NAME + +Oyster::Provision - Provision an Oyster + +=head1 SYNOPSIS + + my $server = Oyster::Provision->new( + name => 'Ostrica', + size => '256', + image => 'Meerkat', + pub_ssh => "$ENV{HOME}/.ssh/id_rsa.pub", + ); + $server->create; + +=head1 BACKENDS + +By default, the L backend +will be used. + +Each backend needs to accept at least the C, +C, C and C parameters. The meaning +of these parameters may differ from one backend to another. + +=head1 METHOS + +Each backend usually implements the following C +methods: + +=over + +=item create + +Creates a new server by given name, if such server does +not exist. + +Installs the required packages for the distribution + +=item delete + +Gets rid of the server instance + +=item resize + +Hopefully scales the server + +=back + +=cut