virtualmin / Virtualmin-Config

A modern rewrite of the Virtualmin postinstall configuration script
Other
11 stars 9 forks source link

=pod

=encoding utf8

=head1 NAME

Virtualmin::Config - A collection of plugins to initialize the configuration of services that Virtualmin manages, and a command line tool called config-system to run them. It can be thought of as a very specialized configuration management system (e.g. puppet, chef, whatever) for doing just one thing (setting up a system for Virtualmin). It has basic dependency resolution (via topological sort), logging, and ties into the Webmin API to make some common tasks (like starting/stopping services, setting them to run on boot) simpler to code.

=head1 SYNOPSIS

my $bundle = Virtualmin::Config->new(bundle => 'LAMP');
$bundle->run();

You can also call it with specific plugins, rather than a whole bundle of plugins.

my $plugin = Virtualmin::Config->new(include => 'Apache');
$plugin->run();

Adding new features to the installer, or modifying installer features, should be done by creating new plugins or by adding to existing ones.

=head1 DESCRIPTION

This is a mini-framework for configuring elements of a Virtualmin system. It uses Webmin as a library to abstract common configuration tasks, provides a friendly status indicator, and makes it easy to pick and choose the kind of configuration you want (should you choose to go that route). The Virtualmin install script chooses either the LAMP (with Apache) or LEMP (with nginx) bundle, and performs the configuration for the whole stack.

It includes plugins for all of the common tasks in a Virtualmin system, such as Apache, MySQL/MariaDB, Postfix, SpamAssassin, etc.

=head1 INSTALLATION

The recommended installation method is to use native packages for your distribution. We provide packages for Debian, Ubuntu, CentOS/RHEL, and Fedora in our repositories.

You can use the standard Perl process to install from the source tarball or git clone:

perl Makefile.PL
make
make test
make install

Or, use your system native package manager. The followin assumes you have all of the packages needed to build native packages installed.

To build a dpkg for Debian/Ubuntu:

dpkg-buildpackage -b -rfakeroot -us -uc

And, for CentOS/Fedora/RHEL/etc. RPM distributions:

dzil build # Creates a tarball
cp Virtualmin-Config-*.tar.gz ~/rpmbuild/SOURCES
rpmbuild -bb virtualmin-config.spec

=head1 ATTRIBUTES

=over

=item bundle

Selects the plugin bundle to be installed. A bundle is a list of plugins configured in a C<Virtualmin::Config::*> class.

=item include

One or more additional plugins to include in the C<run()>. This can be used alongside C or by itself. Dependencies will also be run, and there is no way to disable dependencies (because they're depended on!).

=item exclude

One or more plugins to remove from the selected C. Plugins that are needed to resolve dependencies will be re-added automatically.

=back

=head1 METHODS

=over

=item run

This method figures out which plugins to run (based on the C, C, and C attributes.

=back

=head1 LICENSE AND COPYRIGHT

Licensed under the GPLv3. Copyright 2017 Virtualmin, Inc. joe@virtualmin.com

=cut