This Puppet module manages the installation of the Puppet Dashboard web interface.
This is a Puppet module to manage the Puppet Dashboard that is compatible with the Puppetlabs Apache Module and the NeSI Puppet Module.
The purpose of this module is to install the Puppet Dashboard using the Puppetlabs Apache Module, but without explicitly installing or configuring any other services or resources. This separation of concerns should allow the Puppet Dashboard to be installed independently of puppet and puppet-master services and should allow the Puppet Dashboard to not interfere with the web server and database if they are used by other applications or services.
The following Puppet snippet will do a default install of the Puppet Dashboard as the default site on port 80:
class{'ruby':
version => '1.8.7',
latest_release => true,
}
class { 'ruby::dev': }
class {'mysql::server':
override_options => {
'mysqld' => {
'max_allowed_packet' => '32M',
}
}
}
class {'mysql::bindings':
ruby_enable => true,
ruby_package_ensure => 'latest',
client_dev => true,
client_dev_package_ensure => 'latest',
}
class {'apache':
default_vhost => false,
}
class { 'apache::mod::passenger':
passenger_high_performance => 'on',
passenger_max_pool_size => 12,
passenger_pool_idle_time => 1500,
passenger_stat_throttle_rate => 120,
rails_autodetect => 'on',
}
class { 'puppetdashboard':
require => Class['apache::mod::passenger'],
}
The Puppet-Dashboard Module has been written such that its component classes can be installed on different servers. Hence the dependencies are not across all classes and allows the installation of the database on a database server without a web service, while the web application can be installed on a web server with without a database service. The current version of the Puppet Dashboard does not yet support a remote database.
The included PuppetFile can be used with librarian-puppet to set up the module dependencies.
In all cases, these modules should be installed and be available on the Puppet Master, though not necessarily installed on each host using classes and resources from the Puppet-Dashboard Module.
puppetdashboard::db::mysql
class.puppetdashboard::db::mysql
class is used, or if the manage_db
parameter is true
when calling the puppetdashboard
class with the mysql
or mysql2
database adapter (this is the default behaviour). This module can be used to set up the database on a remote server. This module is required with the git
provider to install the development library dependencies. Currently this requires the master version from the Puppetlabs MySQL github repository
puppetdashboard::db::postgresql
class is used, or if the manage_db
parameter is true
when calling the puppetdashboard
class with the postgresql
database adapter. This module could be used to set up the database on a remote server.These modules can make using the puppetdashboard module easier, and some are required for the git provider (check the git provider documentation for details) :
This module requires that the Apache web server is installed and configured to run with Passenger. The following Puppet snippet is the recommended minimal configuration for Apache running the Puppet Dashboard that produces a virtual host configuration that matches the Puppet Dashboard documentation:
class {'apache':
default_vhost => false,
}
class { 'apache::mod::passenger':
passenger_high_performance => 'on',
passenger_max_pool_size => 12,
passenger_pool_idle_time => 1500,
passenger_stat_throttle_rate => 120,
rails_autodetect => 'on',
}
This module does not require the MySQL server to be running or configured locally.
This module does not install or manage the MySQL server. This is in order to maintain isolation of the MySQL service and the Dashboard application so that the Puppet Dashboard does not interfere with the installation and configuration of a MySQL server. Puppet Dashboard requires that the MySQL server is configured to allow large (at least 32MB) packet sizes using the max_allowed_packet
setting. A minimal MySQL server configuration using the Puppetlabs Mysql Module is given below:
class {'mysql::server':
override_options => {
'mysqld' => {
'max_allowed_packet' => '32M',
}
}
}
class {'mysql::bindings':
ruby_enable => true,
ruby_package_ensure => 'latest',
client_dev => true,
client_dev_package_ensure => 'latest',
}
This module does not require the PostgreSQL server to be running or configured locally.
This module does not install or manage the PostgreSQL server. This is in order to maintain isolation of the PostgreSQL service and the Dashboard application so that the Puppet Dashboard does not interfere with the installation and configuration of a PostgreSQL server.
Using the Puppetlabs PostgreSQL Module the following puppet snippet will set up a local PostgreSQL for the Puppet Dashboard:
class {'postgresql::server':
listen_addresses => 'localhost',
}
class {'postgresql::lib::devel':
link_pg_config => false,
}
The base class can be used to manage all the other classes provided by this module. It does provide the option to not manage some classes so that those classes can be instanced separately, or the resources that they manage can be defined independently.
The parameters are described in the base class and the default values given are the same in the other classes. As the parameter names are consistent across classes the other classes will simply list the parameters they can use.
Some classes have been created as sub-classes to simplify the addition of future classes to support alternative services (e.g. PosgreSQL or Ngnix) or operating systems (e.g. RedHat). For example, the database class has been created as puppetdashboard::db::mysql
to allow for the future creation of a puppetdashboard::db::posgres
class.
puppetdashboard
classpackage
ensure statement including latest
and specifying a version. The default value is installed
.git
. The default value is undefined which will use the default package provider. NOTE: The git provider installs the Dashboard version 2.0.0-beta2
by default, which may require additional parameter changes to work correctly./usr/share/puppet-dashboard
.true
then an Apache virtual host will be defined using the Puppetlabs Apache Module. The default value is true
.true
then a database will be created according to the adapter defined with db_adapter
and initialised with the Puppet Dashboard database schema. The default value is true
.puppetdashboard
.puppetdashboard
.db_adapter
. By default this is undefined, which will result in localhost
being used.mysql
,mysql2
, and postgresql
. Note that the mysql
adapter is only supported by version 1.2.23 (installed by the package
provider), and mysql2
and postgresql
are supported by later versions (installed by the git
provider). The default is mysql
.veryunsafeword
.db_passwd_hash
parameter will override the db_password
parameter. The default value is undefined.file
resource, that is used to supply a settings.yml
file. The default value is undefined.mysql
. Note: The package install of the Dashboard currently only supports MySQL.file
resource, that is used to supply a database.yml
file. The default value is undefined.file
resource, that is used to supply a settings.yml
file. The default value is undefined.file
resource, that is used to supply a database.yml
file. The default value is undefined.rake time:zones:local
in the Puppet Dashboard install directory. The default is undefined.true
will put the Puppet Dashboard in to read-only mode. The default value is undefined.true
enables the legacy report upload mode. The default value is true
.cn_name
of the puppet dashboard in the settings.yml
file. The default value is dashboard
.ca_server
for the puppet dashboard in the settings.yml
file. The default value is puppet
.inventory_server
for the puppet dashboard in the settings.yml
file. The default value is puppet
.file_bucket_server
for the puppet dashboard in the settings.yml
file. The default value is puppet
./usr/share/puppet-dashboard/public
.80
.servername
passed to the Puppet Dashboard site Apache virtual host configuration. It is not passed to the webrick service if that is enabled. The default value is the fully qualified domain name of the node as provided by the fqdn
fact.fqdn
fact, in the form of dashboard.${fqdn}_error.log
.fqdn
fact, in the form of dashboard.${fqdn}_access.log
.::processorcount
fact.true
the Puppet Dashboard webrick service is disabled. Enabling this service is not recommended. Using both webrick and Apache is probably dangerous. The default value is true
.true
then the Puppet Dashboard Worker process management service will be enabled and configured. The default value is true.echo "secret_token: '$(bundle exec rake secret)'" >> config/settings.yml
) as this ensures consistency when installing the Dashboard. The default is to leave this undefined, which results in no secret token being specified in the settings file.puppetdashboard
class will generate certificates using the cn_name
and request they are signed by the ca_server
(usually the puppetmaster) and try and retrieve them. This will require the CA to sign the certificate request and make the certificate available to be retrieved (i.e. the process of signing the certificate must be completed). This may cause a puppet manifest using the puppetdashboard
class to fail until the certificate is signed and made available to be retrieved. It is recommended that instead of using this that certificates are delivered as file resources to the Puppet Dashboard node. The default is false.puppetdashboard
class will try and sign a certificate generated when request_certs
is true. This will only work when the puppet dashboard is run on the puppetmaster.certs
directory. The default is certs/dashboard.ca_crl.pem
.certs
directory. The default is certs/dashboard.ca_cert.pem
.certs
directory. The default is certs/dashboard.cert.pem
.certs
directory. The default is certs/dashboard.private_key.pem
.certs
directory. The default is certs/dashboard.public_key.pem
.puppetdashboard::config
class/usr/share/puppet-dashboard/config
.puppetdashboard::db
classpuppetdashboard::db::mysql
classpuppetdashboard::db::postgresql
classpuppetdashboard::db::postgresql
classpuppetdashboard::install::git
class2.0.0-beta2
.puppetdashboard::install::package
classpuppetdashboard::site::apache
classpuppetdashboard::site::webrick
classpuppetdashboard::workers::debian
classThe git provisioner installs the puppet-dashboard from the Puppet Dashboad git repository on GitHub. This allows the dashboard installation from unpackaged versions and onto Linux distributions that do not have packages available to them. Using the git provisioner requires the git package to be installed, and that the Puppetlabs vcsrepo module is installed.
The git provider requires that:
Puppetfile
)A working manifest that can do this is given in tests/git_install.pp
, a Puppetfile
for librarian-puppet
is provided that will install the dependent Puppet Modules required to make this work. The script and Puppetfile have been tested on Ubuntu 12.04 LTS.
Currently the git provider requires 3 puppet runs to complete the install. There is some issues with specifying the ordering of the install of a PPA repository, installing packages, and executing commands than need resolving.
It is recommended that the git provisioner is used as it is not dependent on end-of-life versions of Ruby, and can install the latest version of the Dashboard. It currently works for the Puppet Dashboard version 2.0.0-beta2
.
The Puppet Dashboard application supports the use of a PostgreSQL database. This is only supported with the later versions that can be installed with the git
provider, hence has the same dependencies and configuration requirements.
A working manifest that can do this is given in tests/postgres_git.pp
, a Puppetfile
for librarian-puppet
is provided that will install the dependent Puppet Modules required to make this work. The script and Puppetfile have been tested on Ubuntu 12.04 LTS. Note that this is still dependant on some MySQL development libraries being installed by the Puppetlabs MySQL module.
This module can be used to set up the Puppet Dashboard on webrick, though this is not recommended and not well tested. Use the following Puppet snippet:
class {'mysql::server':
override_options => {
'mysqld' => {
'max_allowed_packet' => '32M',
}
}
}
class {'mysql::bindings':
ruby_enable => true,
ruby_package_ensure => 'latest',
client_dev => true,
client_dev_package_ensure => 'latest',
}
class { 'puppetdashboard':
manage_vhost => false,
disable_webrick => false,
}
Make sure the installed Ruby, Ruby development libraries, and Rubygems are all compatible. Using a module to manage Ruby is recommended.
This module is derived from the puppet-blank module by Aaron Hicks ([email protected])
This module has been developed for the use with Open Source Puppet (Apache 2.0 license) for automating server & service deployment.
This file is part of the puppetdashboard Puppet module.
The puppetdashboard Puppet module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The puppetdashboard Puppet module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the puppetdashboard Puppet module. If not, see http://www.gnu.org/licenses/.