Docs
[p5sagit/Oyster.git] / lib / Oyster / Provision.pm
CommitLineData
3ded6347 1package Oyster::Provision;
2
3use Moose;
4
5sub config {
6 return {provision_backend => 'Oyster::Provision::Rackspace'};
7}
8
9sub BUILD {
10
11 my $self = shift;
12
13 my $role = $self->config()->{provision_backend};
14
1d534f17 15 eval "use $role";
3ded6347 16 "$role"->meta->apply($self);
17}
c9ecd647 18
191;
7a55dd61 20
21__END__
22
23=head1 NAME
24
25Oyster::Provision - Provision an Oyster
26
27=head1 SYNOPSIS
28
29 my $server = Oyster::Provision->new(
30 name => 'Ostrica',
31 size => '256',
32 image => 'Meerkat',
33 pub_ssh => "$ENV{HOME}/.ssh/id_rsa.pub",
34 );
35 $server->create;
36
37=head1 BACKENDS
38
39By default, the L<Oyster::Provision::Rackspace> backend
40will be used.
41
42Each backend needs to accept at least the C<name>,
43C<size>, C<image> and C<pub_ssh> parameters. The meaning
44of these parameters may differ from one backend to another.
45
46=head1 METHOS
47
48Each backend usually implements the following C<required>
49methods:
50
51=over
52
53=item create
54
55Creates a new server by given name, if such server does
56not exist.
57
58Installs the required packages for the distribution
59
60=item delete
61
62Gets rid of the server instance
63
64=item resize
65
66Hopefully scales the server
67
68=back
69
70=cut