Update to puppet-dashboard-1.2.22.

Largely improved README to easily set it up.

ok robert@ (maintainer)
This commit is contained in:
ajacoutot 2013-03-12 10:44:50 +00:00
parent 49e75cc073
commit a8b1fd9c87
6 changed files with 2581 additions and 2641 deletions

View File

@ -1,26 +1,23 @@
# $OpenBSD: Makefile,v 1.12 2013/03/11 11:44:48 espie Exp $
# $OpenBSD: Makefile,v 1.13 2013/03/12 10:44:50 ajacoutot Exp $
COMMENT= overview of your Puppet ecosystem
V= 1.2.4
DISTNAME= puppet-dashboard-bundled-gems-${V}
PKGNAME= puppet-dashboard-${V}
REVISION= 1
DISTNAME= puppet-dashboard-1.2.22
CATEGORIES= www sysutils
HOMEPAGE= http://www.puppetlabs.com/puppet/related-projects/dashboard/
HOMEPAGE= https://puppetlabs.com/puppet/related-projects/dashboard/
# GPLv3
PERMIT_PACKAGE_CDROM = Yes
# Apache 2.0
PERMIT_PACKAGE_CDROM= Yes
MODULES= lang/ruby
MASTER_SITES= http://blade2k.humppa.hu/distfiles/ \
http://puppetlabs.com/downloads/dashboard/
MASTER_SITES= http://puppetlabs.com/downloads/dashboard/
RUN_DEPENDS= databases/ruby-mysql,${MODRUBY_FLAVOR} \
devel/ruby-rake,${MODRUBY_FLAVOR} \
devel/ruby-rdoc,${MODRUBY_FLAVOR} \
www/ruby-rack,${MODRUBY_FLAVOR} \
${MODRUBY_ICONV_DEPENDS}
PKG_ARCH= *
@ -29,12 +26,19 @@ NO_TEST= Yes
PREFIX= /var/www
INSTDIR= ${PREFIX}/puppet-dashboard
SUBST_VARS= INSTDIR V
SUBST_VARS= INSTDIR MODRUBY_BINREV
pre-configure:
cd ${WRKSRC} && grep -Elr 'env.*ruby' . | \
xargs perl -pi -e 's,/usr/bin/env ruby,${RUBY},'
perl -pi -e 's,/usr/share,${PREFIX},g' \
${WRKSRC}/examples/puppet-dashboard.cleanup_reports.cron \
${WRKSRC}/lib/data_generator.rb
do-install:
@mkdir -p ${INSTDIR}
@cd ${WRKSRC} && tar -cf - * | tar -C ${INSTDIR} -xf -
@find ${PREFIX} -type f -name "*~" -exec rm {} \;
@chown -R ${SHAREOWN}:${SHAREGRP} ${INSTDIR}
mkdir -p ${INSTDIR}
cd ${WRKSRC} && ${TAR} -cf - * | tar -C ${INSTDIR} -xf -
find ${INSTDIR} -name '*.orig' -print0 | xargs -0 rm
chown -R ${SHAREOWN}:${SHAREGRP} ${INSTDIR}
.include <bsd.port.mk>

View File

@ -1,5 +1,2 @@
MD5 (puppet-dashboard-bundled-gems-1.2.4.tar.gz) = EC0Rp2M8flUC73cagvXAtw==
RMD160 (puppet-dashboard-bundled-gems-1.2.4.tar.gz) = jtYBfzgwgWljFW3fB1f+K85RbHc=
SHA1 (puppet-dashboard-bundled-gems-1.2.4.tar.gz) = xInhT29Gp+FgWfab+Sv9c2MSXP8=
SHA256 (puppet-dashboard-bundled-gems-1.2.4.tar.gz) = fIKyrlZ22+j6tu/Xixj5paSNS3jk3PbNX72TOAeV/XI=
SIZE (puppet-dashboard-bundled-gems-1.2.4.tar.gz) = 7533062
SHA256 (puppet-dashboard-1.2.22.tar.gz) = uIjcnIgHZKqz58fuw5MpYk3apUHpRJ8IvfiUwvs2WJQ=
SIZE (puppet-dashboard-1.2.22.tar.gz) = 4846207

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-config_boot_rb,v 1.1 2012/01/16 21:11:55 robert Exp $
--- config/boot.rb.orig Mon Jan 16 20:34:01 2012
+++ config/boot.rb Mon Jan 16 20:35:07 2012
@@ -2,6 +2,7 @@
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
+ENV['GEM_PATH'] = "#{RAILS_ROOT}/vendor/full-gems"
module Rails
class << self

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-vendor_rails_actionpack_lib_action_controller_rb,v 1.1 2013/03/12 10:44:50 ajacoutot Exp $
http://projects.puppetlabs.com/issues/11669
--- vendor/rails/actionpack/lib/action_controller.rb.orig Mon Mar 11 17:09:47 2013
+++ vendor/rails/actionpack/lib/action_controller.rb Mon Mar 11 17:09:51 2013
@@ -31,7 +31,6 @@ rescue LoadError
end
end
-gem 'rack', '~> 1.1.0'
require 'rack'
require 'action_controller/cgi_ext'

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
$OpenBSD: README,v 1.1 2012/09/10 09:16:34 jasper Exp $
$OpenBSD: README,v 1.2 2013/03/12 10:44:50 ajacoutot Exp $
+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
@ -6,14 +6,83 @@ $OpenBSD: README,v 1.1 2012/09/10 09:16:34 jasper Exp $
The Puppet Dashboard has been installed into ${INSTDIR}
To configure your database you must first edit config/database.yaml
and then run the following command from ${INSTDIR}:
Configuration is done in:
${INSTDIR}/config/settings.yml
$ rake install
Database Configuration
======================
After that you can start your server by calling:
Before starting the Dashboard, a MySQL database must be configured in:
${INSTDIR}/config/database.yml
$ script/server
The following commands can be used to create the database:
# mysql -uroot -p<password>
mysql> CREATE DATABASE dashboard_production CHARACTER SET utf8;
mysql> CREATE USER 'dashboard'@'localhost' IDENTIFIED BY 'my_password';
mysql> GRANT ALL PRIVILEGES ON dashboard_production.* TO 'dashboard'@'localhost';
mysql> EXIT
This will start a Rails server on port 3000. For more information on
Puppet Dashboard, please refer to ${INSTDIR}/README.markdown
The MySQL maximum packet size needs to be increased to permit larger
rows in the database; ${SYSCONFDIR}/my.cnf must be edited to include:
max_allowed_packet = 32M
Then the server must be restarted by running:
# ${RCDIR}/mysqld restart
Once the database has been setup and MySQL is up and running, the
following command must be run to create the tables:
# cd ${INSTDIR} && sudo -u _puppet-dashboard rake${MODRUBY_BINREV} RAILS_ENV=production db:migrate
Note that this command *must* also be run after a Puppet Dashboard
upgrade.
Running the Dashboard
=====================
These commands will start a Rails server on port 3000 then start the
delayed job workers to asynchronously process resource-intensive tasks.
They can be added to rc.conf.local(5) to start Puppet Dashboard at boot
time.
# cd ${INSTDIR} && sudo -u _puppet-dashboard ./script/server -d -e production 2>/dev/null
# cd ${INSTDIR} && sudo -u _puppet-dashboard env RAILS_ENV=production script/delayed_job -p dashboard -n 4 -m start 2>/dev/null
Puppet Configuration
====================
To use the Dashboard for reports, all agent nodes must submit reports to
the master and the master must send reports to the Dashboard.
${SYSCONFDIR}/puppet/puppet.conf needs to be edited accordingly:
[agent]
report = true # this is the default
[master]
reports = store, http
reporturl = http://dashboard.domain.tld:3000/reports/upload
Maintenance
===========
To import old Puppet reports that were created before the Dashboard got
installed, the following command can be used:
# cd ${INSTDIR} && sudo -u _puppet-dashboard rake${MODRUBY_BINREV} RAILS_ENV=production reports:import
Cron Jobs
---------
The MySQL database should be optimized on a montly basis. This can be
done by adding the following entry to the root's crontab(5):
0 0 1 * * cd ${INSTDIR} && sudo -u _puppet-dashboard rake${MODRUBY_BINREV} RAILS_ENV=production db:raw:optimize
Over time, old reports will start to accumulate which can slow down the
Dashboard. Adding the following line to the root's crontab(5) will clean
up reports older than 1 month and will run every night:
0 0 * * * cd ${INSTDIR} && sudo -u _puppet-dashboard rake${MODRUBY_BINREV} RAILS_ENV=production reports:prune upto=1 unit=mon
Going further
=============
Setting up followings is out of the scope of this README but should be
considered when running Puppet Dashboard in production.
- authentication (by default, anyone can access the Dashboard)
- https (for encrypted communication)
- Passenger (with Apache or Nginx for better performance)
More information is available at:
http://docs.puppetlabs.com/dashboard/manual/1.2/index.html