App-Puppet-Environment-Updater

 view release on metacpan or  search on metacpan

lib/App/Puppet/Environment/Updater.pm  view on Meta::CPAN

=head1 NAME

App::Puppet::Environment::Updater - Update a Puppet environment in a Git branch

=head1 VERSION

version 0.001002

=head1 SYNOPSIS

	use App::Puppet::Environment::Updater;

	App::Puppet::Environment::Updater->new_with_options()->run();

=head1 DESCRIPTION

App::Puppet::Environment::Updater is intended to update Puppet environments which
are in Git branches. There are many ways to organize a Puppet setup and Puppet
environments, and this application supports the following approach:

=over

=item *

There is one Git repository with four branches, each of which represents a
Puppet environment:

=over

=item *

C<development>

=item *

C<test>

=item *

C<staging>

=item *

C<production>

=back

=item *

Each branch contains a C<site.pp> with the Puppet nodes that are present in the
environment represented by the branch.

=item *

Puppet modules are included as Git submodules, usually below C<modules>. It's not
necessary to use Git submodules, but it simplifies reuse of the Puppet modules in
other projects.

=back

The sandbox of the Git repository usually looks about as follows:

	.
	|-- modules
	|   |-- module1
	|   |   |-- manifests
	|   |   |   `-- init.pp
	|   |   `-- templates
	|   |       `-- template1.erb
	|   `-- module2
	|       |-- files
	|       |   `-- file1.pl
	|       `-- manifests
	|           `-- init.pp
	`-- site.pp

In order to move a change from eg. C<development> to C<testing>, one can usually
simply merge the C<development> branch into the C<testing> branch and update the
submodules. This application tries to automate this and work around some of the
pitfalls that exist on the way.

=head1 METHODS

=head2 new

Constructor, creates new instance of the application.

=head3 Parameters

This method expects its parameters as a hash reference. See C<--usage> to see
which parameters can be passed on the command line.

=over

=item from

The branch to merge from.

=item environment

The branch to merge to.

=item remote

The Git remote where changes can be fetched from and should be pushed to. B<This
application does currently not push any changes.> Defaults to C<origin>.

=item workdir

Directory with the Git sandbox that should be used. Defaults to the current
directory, but should point to the toplevel of the working tree.

=item git

The L<Git::Wrapper|Git::Wrapper> instance to use.

=item logger

The L<Log::Dispatchouli|Log::Dispatchouli> instance to use.

=back



( run in 2.417 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )