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 'provision_backend' => (is => 'rw', isa => 'Str', required => 1, default => 'Oyster::Provision::Rackspace' );
13 # TODO after provision, add the server's name with "oyster-" prefixed to the
14 # user's ~/.ssh/ssh_config file so any part of Oyster can ssh there
15 # passwordlessly for deploying or whatnot
21 my $role = $self->provision_backend;
24 "$role"->meta->apply($self);
33 Oyster::Provision - Provision an Oyster
37 my $server = Oyster::Provision->new(
41 pub_ssh => "$ENV{HOME}/.ssh/id_rsa.pub",
47 By default, the L<Oyster::Provision::Rackspace> backend
50 Each backend needs to accept at least the C<name>,
51 C<size>, C<image> and C<pub_ssh> parameters. The meaning
52 of these parameters may differ from one backend to another.
56 Each backend usually implements the following C<required>
63 Creates a new server by given name, if such server does
66 Installs the required packages for the distribution
70 Gets rid of the server instance
74 Hopefully scales the server