1 package Oyster::Provision;
5 has 'api_username' => ( is => 'ro', isa => 'Str');
6 has 'api_password' => ( is => 'ro', isa => 'Str');
7 has 'name' => ( is => 'ro', isa => 'Str');
8 has 'size' => ( is => 'ro', isa => 'Str');
9 has 'image' => ( is => 'ro', isa => 'Str');
10 has 'pub_ssh' => ( is => 'ro', isa => 'Str');
11 has 'config' => ( is => 'rw', isa => 'HashRef', required => 1 );
12 has 'provision_backend' => (is => 'rw', isa => 'Str', required => 1, default => 'Oyster::Provision::Rackspace' );
14 # TODO after provision, add the server's name with "oyster-" prefixed to the
15 # user's ~/.ssh/ssh_config file so any part of Oyster can ssh there
16 # passwordlessly for deploying or whatnot
22 my $role = $self->provision_backend;
25 "$role"->meta->apply($self);
34 Oyster::Provision - Provision an Oyster
38 my $server = Oyster::Provision->new(
42 pub_ssh => "$ENV{HOME}/.ssh/id_rsa.pub",
48 By default, the L<Oyster::Provision::Rackspace> backend
51 Each backend needs to accept at least the C<name>,
52 C<size>, C<image> and C<pub_ssh> parameters. The meaning
53 of these parameters may differ from one backend to another.
57 Each backend usually implements the following C<required>
64 Creates a new server by given name, if such server does
67 Installs the required packages for the distribution
71 Gets rid of the server instance
75 Hopefully scales the server