Version information
This version is compatible with:
- Puppet Enterprise 3.x
- Puppet 3.x
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'sgnl05-racktables', '0.2.1'
Learn more about managing modules with a PuppetfileDocumentation
racktables
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with racktables
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
This Puppet module installs RackTables, along with Apache, PHP, MySQL.
Module Description
RackTables is nifty and robust solution for datacenter and server room asset management. It helps document hardware assets, network addresses, space in racks, networks configuration and much much more.
Use this module to install a new instance of RackTables. The module will also install Apache, PHP, MySQL and some other dependencies for RackTables (php packages mostly).
WARNING: Use this module on NEW servers! Existing databases, webserver configs and RackTables installations will be replaced or purged.
Setup
What racktables affects
- Apache - Any existing config will be replaced or purged.
- MySQL - Existing databases and settings might be replaced.
- RackTables - Existing RackTable files might be replaced
Beginning with RackTables module
To install RackTables version 0.20.10 with the default parameters:
class { '::racktables':
vhost => 'racktables.example.com',
release => 'RackTables-0.20.10',
}
As soon as Puppet is done installing, go to vhost address and append ?module=installer to the vhost URL (Example URL: https://racktables.example.com/?module=installer). From there follow the RackTables installation steps (7 in total).
Default database settings are:
- database: racktables_db
- username: racktables_user
- password: racktables_pass
These values can be changed by adding parameters 'mysqldb', 'mysqluser' and 'mysqluserpw' to the ::racktables class (See more examples).
Handling the permissions of secret.php at installation step 3 and 4 of can be assisted by Puppet. Use an attribute named 'secretfile' on the ::racktables class and set it to "writable" on step 3 and "readonly" on step 4. Remember to run "puppet agent -t" on the target server after each of these steps.
Examples
Set a root password for your mysql installation (default password is "strongpassword" if undefined):
class { '::racktables':
vhost => 'racktables.example.com',
release => 'RackTables-0.20.10',
mysqlrootpw => 'newstrongpassword',
}
Proper installation with recommended parameters:
class { '::racktables':
vhost => 'racktables.example.com',
release => 'RackTables-0.20.10',
mysqlrootpw => 'make_a_strong_password',
mysqldb => 'racktables',
mysqluser => 'racktables',
mysqluserpw => 'make_another_strong_password',
mysqlhost => 'localhost',
}
When installation is complete, dont forget to set the attribute 'secretfile' to "readonly". You can also remove the 'mysqlrootpw' attribute, as it is now stored in /root/.my.cnf on the target server.
In other words, after installation is done your class should look like this:
class { '::racktables':
vhost => 'racktables.example.com',
release => 'RackTables-0.20.10',
mysqldb => 'racktables',
mysqluser => 'racktables',
mysqluserpw => 'make_another_strong_password',
mysqlhost => 'localhost',
secretfile => 'readonly',
}
Usage
###Classes and Defined Types
####Class: racktables
#####secretfile
Sets permissions to the inc/secret.php file for apache during setup. Set this attribute to "writable" while installing racktables and "readonly" after installation step 4. Setting this attibute to "absent" removes the file. Defaults to "undef", which results in permissions not being modified.
#####vhost
The virtual host address to use for your racktables installation. Requires a valid DNS entry. Defaults to 'racktables.example.com'.
#####release
Selects what RackTables version to download. The version is pulled from https://github.com/RackTables/racktables/tree/REVISION (Revision = Git revision TAG). The RackTables project on GitHub has (so far) tagged every release with "RackTables-[version]". You can automatically upgrade the racktables version by modifying this attribute to a higher version number. Defaults to 'undef', which results in the default repo being downloaded. After first download, 'undef' setting will not modify local files even if the remote repo is updated.
#####mysqlrootpw
Sets the root password on MySQL. Defaults to 'strongpassword'.
#####mysqluser
Sets the mysql user for the racktables database. Defaults to 'racktables_user'.
#####mysqluserpw
Sets the password for the "mysqluser". Defaults to 'racktables_pass'.
#####mysqldb
Sets the name of the database for racktables. Defaults to 'racktables_db'.
#####mysqlhost
Sets the name of the database to connect to. Defaults to 'localhost'.
#####datadir
Specifies the installation path of RackTables. Defaults to '/usr/local/share/RackTables'.
#####apacheuser
Specifies the apache user. Used for setting permissions to inc/secret.php. Defaults to 'apache' for RedHat/CentOS and 'www-data' for Debian/Ubuntu.
#####vcsprovider
Defines what vcs system to use for downloading RackTables. Defaults to 'git'.
#####source
Path to RackTables source. Defaults to 'https://github.com/RackTables/racktables.git'.
Reference
###Classes
####Public Classes
racktables
: Starts the module and calls racktables::apache, racktables::mysql and racktables::installracktables::apache
: Installs Apache and a spesified vhostracktables::mysql
: Installs MySQL and sets up an empty databaseracktables::install
: Pulls and installs RackTables from GitHub (or other specified source)
####Private Classes
racktables::params
: Default parameters
Limitations
#####RHEL/CentOS 7
Should work, but has not been tested.
Development
###Contributing
Please use the issue tracker (https://github.com/sgnl05/sgnl05-racktables/issues) for any type of contribution.
2015-03-04 Release 0.2.1
###Bugfix
Root password for MySQL was always set to '$mysqlrootpw'.
###Updates
Use public classes for apache, mysql and racktables install
2015-02-05 Release 0.2.0
###Updates
Added ability to select what RackTables version to download.
Changed secret file handling.
Updated puppetlabs-mysql requirements to version 3.1.0. This should fix CentOS 7 support (not tested).
2014-09-05 Release 0.1.4
###Updates
php5-curl dependency for Debian/Ubuntu.
2014-09-05 Release 0.1.3
###Updates
php5-ldap dependency for Debian/Ubuntu. Jens Rosenbloom (#2)
Changed attribute name 'secretwriteable' to 'secretfile' and changed the installation routine to be more intuitive regarding this file.
2014-08-01 Release 0.1.2
###Updates
Added support for Debian 7 by setting 'mpm_module' to "prefork" when calling apache install.
Removed Redhat/CentOS 7 support in metadata.json as current puppetlabs-mysql version is broken on CentOS 7.
2014-07-31 Release 0.1.1
###Summary
Updated documentation.
2014-07-30 Release 0.1.0
###Summary
First release.
Dependencies
- puppetlabs/stdlib (>= 2.4.0)
- puppetlabs/apache (>= 1.1.1)
- puppetlabs/mysql (>= 3.1.0)
- puppetlabs/vcsrepo (>= 1.1.0)
Copyright 2014 Gjermund Jensvoll Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.