1 package Oyster::Provision;
5 has 'name' => ( is => 'ro', isa => 'Str');
6 has 'size' => ( is => 'ro', isa => 'Str');
7 has 'image' => ( is => 'ro', isa => 'Str');
8 has 'pub_ssh' => ( is => 'ro', isa => 'Str');
9 has 'config' => ( is => 'rw', isa => 'HashRef', required => 1 );
10 has 'provision_backend' => (is => 'rw', isa => 'Str', required => 1, default => 'Oyster::Provision::Rackspace' );
12 # TODO after provision, add the server's name with "oyster-" prefixed to the
13 # user's ~/.ssh/ssh_config file so any part of Oyster can ssh there
14 # passwordlessly for deploying or whatnot
20 my $role = $self->provision_backend;
23 "$role"->meta->apply($self);
32 Oyster::Provision - Provision an Oyster
36 my $server = Oyster::Provision->new(
40 pub_ssh => "$ENV{HOME}/.ssh/id_rsa.pub",
46 By default, the L<Oyster::Provision::Rackspace> backend
49 Each backend needs to accept at least the C<name>,
50 C<size>, C<image> and C<pub_ssh> parameters. The meaning
51 of these parameters may differ from one backend to another.
55 Each backend usually implements the following C<required>
62 Creates a new server by given name, if such server does
65 Installs the required packages for the distribution
69 Gets rid of the server instance
73 Hopefully scales the server