App::Puppet::Environment::Updater - Update a Puppet environment in a Git branch
version 0.001002
use App::Puppet::Environment::Updater; App::Puppet::Environment::Updater->new_with_options()->run();
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:
There is one Git repository with four branches, each of which represents a Puppet environment:
development
test
staging
production
Each branch contains a site.pp with the Puppet nodes that are present in the environment represented by the branch.
site.pp
Puppet modules are included as Git submodules, usually below modules. It's not necessary to use Git submodules, but it simplifies reuse of the Puppet modules in other projects.
modules
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. development to testing, one can usually simply merge the development branch into the testing branch and update the submodules. This application tries to automate this and work around some of the pitfalls that exist on the way.
testing
Constructor, creates new instance of the application.
This method expects its parameters as a hash reference. See --usage to see which parameters can be passed on the command line.
--usage
The branch to merge from.
The branch to merge to.
The Git remote where changes can be fetched from and should be pushed to. This application does currently not push any changes. Defaults to origin.
origin
Directory with the Git sandbox that should be used. Defaults to the current directory, but should point to the toplevel of the working tree.
The Git::Wrapper instance to use.
The Log::Dispatchouli instance to use.
Get a proxy logger with a given prefix.
This method expects positional parameters.
A prefix which should be set in the proxy logger.
A Log::Dispatchouli::Proxy instance.
Run the application.
Nothing on success, an exception otherwise.
Get a list with local branches.
The local branches.
Construct the name of a remote branch given a branch name.
Name of the branch the remote branch name should be constructed for.
The name of the remote branch.
Create a local branch starting at the corresponding remote branch and switch to it.
Name of the branch.
Update a local branch from the corresponding remote branch, using a fast-forward merge.
The name of the branch which should be updated.
Merge a given branch into another branch.
Update the submodules.
http://www.puppetlabs.com/ - Puppet
http://docs.puppetlabs.com/guides/environment.html - How to configure Puppet environments.
http://git-scm.com/ - Git
Manfred Stock <mstock@cpan.org>
This software is copyright (c) 2022 by Manfred Stock.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::Puppet::Environment::Updater, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Puppet::Environment::Updater
CPAN shell
perl -MCPAN -e shell install App::Puppet::Environment::Updater
For more information on module installation, please visit the detailed CPAN module installation guide.