Giter Site home page Giter Site logo

voxpupuli / puppet-puppetboard Goto Github PK

View Code? Open in Web Editor NEW
53.0 48.0 165.0 619 KB

Puppet module to install and manage puppetboard

Home Page: https://forge.puppet.com/puppet/puppetboard

License: Apache License 2.0

Ruby 38.12% Puppet 56.91% HTML 3.97% Python 1.00%
linux-puppet-module puppet hacktoberfest bsd-puppet-module debian-puppet-module freebsd-puppet-module ubuntu-puppet-module

puppet-puppetboard's Introduction

puppetboard

License Build Status Puppet Forge Puppet Forge downloads Puppet Forge - endorsement Puppet Forge score

Table of Contents

  1. Overview
  2. Setup
  3. Usage
  4. Number of Reports
  5. Offline Mode
  6. Set Default Environment
  7. Disable SELinux Management
  8. Apache
  9. RedHat/CentOS 7 with Python 3
  10. Using SSL to the PuppetDB host
  11. Development

Overview

Puppet module for installing and managing Puppetboard.

Puppetboard is a web interface to PuppetDB aiming to replace the reporting functionality of Puppet Enterprise console (previously: Puppet Dashboard) for the open source Puppet.

Setup

Installation

puppet module install puppet-puppetboard

Dependencies

Note that this module no longer explicitly requires the puppetlabs apache module. If you want to use the apache functionality of this module you will have to specify that the apache module is installed with:

puppet module install puppetlabs-apache

In most cases the module requires the virtualenv package. This can be enabled in the module with the manage_virtualenv flag set to true:

class { 'puppetboard':
  manage_virtualenv => true,
  secret_key        => fqdn_rand_string(32),
}

If the virtualenv is managed by this module, the voxpupuli/python will be used. That module uses voxpupuli/epel on RHEL based platforms.

Usage

Declare the base puppetboard manifest with the below required parameter(s), set to the values you want to use:

class { 'puppetboard':
  python_version => '3.8',
  secret_key     => fqdn_rand_string(32),
}

This will install the latest stable version of the app from a PyPI package in a virtualenv created using the requested Python version and keep it up to date. This example secret key is fine if you have a single-node deployment of the app. If you have a multi-node deployment, you should generate a secret key and use the same one on all nodes.

Number of Reports

NOTE: In order to have reports present in the dashboard, report storage must be enabled on the Puppet master node. This is not the default behavior, so it must be enabled.

See https://puppet.com/docs/puppetdb/latest/connect_puppet_server.html#enabling-report-storage for instructions on report storage.

By default, puppetboard displays only 10 reports. This number can be controlled to set the number of reports to show.

class { 'puppetboard':
  python_version => '3.8',
  secret_key     => fqdn_rand_string(32),
  reports_count  => 40,
}

Offline Mode

If you are running puppetboard in an environment which does not have network access to public CDNs, puppet board can load static assets (jquery, semantic-ui, tablesorter, etc) from the local web server instead of a CDN:

class { 'puppetboard':
  python_version => '3.8',
  secret_key     => fqdn_rand_string(32),
  offline_mode   => true,
}

Set Default Environment

By default, puppetboard defaults to "production" environment. This can be set to default to a different environment.

class { 'puppetboard':
  python_version      => '3.8',
  secret_key          => fqdn_rand_string(32),
  default_environment => 'customers',
}

or to default to "All environments":

class { 'puppetboard':
  python_version      => '3.8',
  secret_key          => fqdn_rand_string(32),
  default_environment => '*',
}

Disable SELinux Management

class { 'puppetboard':
  python_version => '3.8',
  secret_key     => fqdn_rand_string(32),
  manage_selinux => false,
}

If manage_selinux is true, manage policies related to SELinux. If false, do nothing. By default, this module will try to determine if SELinux is enabled, and manage the policies if it is.

Apache

If you want puppetboard accessible through Apache and you're able to use the official puppetlabs/apache Puppet module, this module contains two classes to help configuration.

The first, puppetboard::apache::vhost, will use the apache::vhost defined-type to create a full virtual host. This is useful if you want puppetboard to be available under an address like http://pboard.example.com:

(The following is generic code used in our tests, it works on Debian 9 and 10, also on Ubuntu 16.04 and 18.04. It will talk to PuppetDB on localhost via http)

# Configure Apache on this server
class { 'apache':
  default_vhost => false,
}

# Configure Puppetboard
class { 'puppetboard':
  python_version    => '3.8',
  secret_key        => fqdn_rand_string(32),
  manage_virtualenv => true,
}

# Access Puppetboard through pboard.example.com
class { 'puppetboard::apache::vhost':
  vhost_name => 'pboard.example.com',
  port       => 80,
}

The second, puppetboard::apache::conf, will create an entry in /etc/apache2/conf.d (or /etc/httpd/conf.d, depending on your distribution). This is useful if you simply want puppetboard accessible from http://example.com/puppetboard:

# Configure Puppetboard
class { 'puppetboard':
  python_version => '3.8',
  secret_key     => fqdn_rand_string(32),
}

# Access Puppetboard from example.com/puppetboard
class { 'puppetboard::apache::conf': }

Apache (with Reverse Proxy)

You can also relocate puppetboard to a sub-URI of a Virtual Host. This is useful if you want to reverse-proxy puppetboard, but are not planning on dedicating a domain just for puppetboard:

class { 'puppetboard::apache::vhost':
  vhost_name => 'dashes.acme',
  wsgi_alias => '/pboard',
}

In this case puppetboard will be available (on the default) on http://dashes.acme:5000/pboard. You can then reverse-proxy to it like so:

Redirect /pboard /pboard/
ProxyPass /pboard/ http://dashes.acme:5000/pboard/
ProxyPassReverse /pboard/ http://dashes.acme:5000/pboard/

Using the puppetlabs/apache module:

apache::vhost { 'example.acme':
  port            => '80',
  docroot         => '/var/www/html',
  redirect_source => [ '/pboard' ],
  redirect_dest   => [ '/pboard/' ],
  proxy_pass      => [
    {
      'path' => '/pboard/',
      'url'  => 'http://dashes.acme:5000/pboard/',
    },
  ],
}

RedHat/CentOS 7 with Python 3

CentOS/RedHat 7 is pretty old. Python 3 got added after the initial release and a lot of packages are missing. For example python3.6 is available as a package, but no matching wsgi module for apache is available. Because of that, we don't test on CentOS 7 anymore. However, it's still possible to setup Puppetboard on CentOS with gunicorn as a webserver and nginx/apache forwarding to it.

Using SSL to the PuppetDB host

If you would like to use certificate auth into the PuppetDB service you must configure puppetboard to use a client certificate and private key.

You have two options for the source of the client certificate & key:

  1. Generate a new certificate, signed by the puppetmaster CA
  2. Use the existing puppet client certificate

If you choose option 1, generate the new certificates on the CA puppet master as follows:

sudo puppet cert generate puppetboard.example.com

Note: this name cannot conflict with an existing certificate name.

The new certificate and private key can be found in $certdir/.pem and $privatekeydir/.pem on the CA puppet master. If you are not running puppetboard on the CA puppet master you will need to copy the certificate and key to the node running puppetboard.

Here's an example, using new certificates:

$ssl_dir = '/var/lib/puppetboard/ssl'
$puppetboard_certname = 'puppetboard.example.com'
class { 'puppetboard':
  python_version      => '3.8',
  secret_key          => fqdn_rand_string(32),
  manage_virtualenv   => true,
  puppetdb_host       => 'puppetdb.example.com',
  puppetdb_port       => 8081,
  puppetdb_key        => "${ssl_dir}/private_keys/${puppetboard_certname}.pem",
  puppetdb_ssl_verify => "${ssl_dir}/certs/ca.pem",
  puppetdb_cert       => "${ssl_dir}/certs/${puppetboard_certname}.pem",
}

If you are re-using the existing puppet client certificates, they will already exist on the node (assuming puppet has been run and the client cert signed by the puppet master). However, the puppetboaard user will not have permission to read the private key unless you add it to the puppet group.

Here's a complete example, re-using the puppet client certs:

$ssl_dir = $::settings::ssldir
$puppetboard_certname = $::certname
class { 'puppetboard':
  python_version      => '3.8',
  secret_key          => fqdn_rand_string(32),
  manage_virtualenv   => true,
  groups              => 'puppet',
  puppetdb_host       => 'puppetdb.example.com',
  puppetdb_port       => 8081,
  puppetdb_key        => "${ssl_dir}/private_keys/${puppetboard_certname}.pem",
  puppetdb_ssl_verify => "${ssl_dir}/certs/ca.pem",
  puppetdb_cert       => "${ssl_dir}/certs/${puppetboard_certname}.pem",
}

Note that both the above approaches only work if you have the Puppet CA root certificate added to the root certificate authority file used by your operating system. If you want to specify the location to the Puppet CA file ( you probably do) you have to use the syntax below. Currently this is a bit of a gross hack, but it's an open issue to resolve it in the Puppet module:

$ssl_dir = $::settings::ssldir
$puppetboard_certname = $::certname
class { 'puppetboard':
  python_version      => '3.8',
  secret_key          => fqdn_rand_string(32),
  manage_virtualenv   => true,
  groups              => 'puppet',
  puppetdb_host       => 'puppetdb.example.com',
  puppetdb_port       => 8081,
  puppetdb_key        => "${ssl_dir}/private_keys/${puppetboard_certname}.pem",
  puppetdb_ssl_verify => "${ssl_dir}/certs/ca.pem",
  puppetdb_cert       => "${ssl_dir}/certs/${puppetboard_certname}.pem",
}

Using SSL to PuppetDB >= 6.9.1

As of PuppetDB 6.9.1 the /metrics/v2 API is only accessible on the loopback/localhost interface of the PuppetDB server. This requires you to run puppetboard locally on that host and configure puppetdb_host to 127.0.0.1:

$ssl_dir = $::settings::ssldir
$puppetboard_certname = $::certname
class { 'puppetboard':
  python_version      => '3.8',
  secret_key          => fqdn_rand_string(32),
  manage_virtualenv   => true,
  groups              => 'puppet',
  puppetdb_host       => '127.0.0.1',
  puppetdb_port       => 8081,
  puppetdb_key        => "${ssl_dir}/private_keys/${puppetboard_certname}.pem",
  puppetdb_ssl_verify => "${ssl_dir}/certs/ca.pem",
  puppetdb_cert       => "${ssl_dir}/certs/${puppetboard_certname}.pem",
}

NOTE In order for SSL to verify properly in this setup, you'll need your Puppet SSL certificate to have an IP Subject Alternative Name setup for 127.0.0.1, otherwise the certificate verification will fail. You can set this up in your puppet.conf with the dns_alt_names configuration option, documented here.

[main]
dns_alt_names = puppetdb,puppetdb.domain.tld,puppetboard,puppetboard.domain.tld,IP:127.0.0.1

NOTE If you need to regenerate your existing cert to add DNS Alt Names follow the documentation here:

# remove the existing agent certs
puppetserver ca clean --certname <CERTNAME_OF_YOUR_PUPPETDB>
puppet ssl clean

# stop our services
puppet resource service puppetserver ensure=stopped
puppet resource service puppetdb ensure=stopped

# regenerate our cert
puppetserver ca generate --certname <CERTNAME> --subject-alt-names puppetdb,puppetdb.domain.tld,puppetboard,puppetboard.domain.tld,IP:127.0.0.1 --ca-client
# copy the cert into the PuppetDB directory
cp /etc/puppetlabs/puppet/ssl/certs/<CERTNAME>.pem /etc/puppetlabs/puppetdb/ssl/public.pem
cp /etc/puppetlabs/puppet/ssl/private_keys/<CERTNAME>.pem /etc/puppetlabs/puppetdb/ssl/private.pem

# restart our services
puppet resource service puppetdb ensure=running
puppet resource service puppetserver ensure=running

Development

This module is maintained by Vox Pupuli. Vox Pupuli welcomes new contributions to this module, especially those that include documentation and rspec tests. We are happy to provide guidance if necessary.

Please see CONTRIBUTING for more details.

Please log tickets and issues on github.

Authors

  • Spencer Krum [email protected]
  • Vox Pupuli Team
  • The core of this module was based on Hunter Haugen's puppetboard-vagrant repo.

puppet-puppetboard's People

Contributors

alexjfisher avatar bastelfreak avatar blkperl avatar c33s avatar cmurphy avatar dhoppe avatar ekohl avatar elmobp avatar gdubicki avatar ghoneycutt avatar h0tw1r3 avatar igalic avatar jtopjian avatar jyaworski avatar kenyon avatar lukebigum avatar mergwyn avatar mterzo avatar nibalizer avatar nmaludy avatar ogdensan avatar pjonesidbs avatar rnelson0 avatar robinbowes avatar smortex avatar swenske avatar towo avatar waipeng avatar wyardley avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-puppetboard's Issues

No module named flask

I've just installed puppet board by following the instructions at https://forge.puppet.com/puppet/puppetboard, but I can't start it. Apache error log repeats:

[Thu May 12 16:37:31.278737 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] mod_wsgi (pid=6946): Target WSGI script '/srv/puppetboard/puppetboard/wsgi.py' cannot be loaded as Python module.
[Thu May 12 16:37:31.278829 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] mod_wsgi (pid=6946): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
[Thu May 12 16:37:31.278876 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] Traceback (most recent call last):
[Thu May 12 16:37:31.278918 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]   File "/srv/puppetboard/puppetboard/wsgi.py", line 15, in <module>
[Thu May 12 16:37:31.279046 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]     from puppetboard.app import app as application
[Thu May 12 16:37:31.279074 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]   File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 13, in <module>
[Thu May 12 16:37:31.279628 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801]     from flask import (
[Thu May 12 16:37:31.279674 2016] [:error] [pid 6946:tid 139904046110464] [remote 10.1.200.2:55801] ImportError: No module named flask

Honestly I don't know anything about python, so can you suggest what to do? Workaround?

Thanks!

Documentation: Instruction for setting up nginx version?

I spent few hours trying to figure out how to install puppetboard. more than 50% of the time is there are no clear instruction and i have been reading the source code into puppetboard module, puppetboard main repo, python modules, and apache modules. the setup is quite simple but may need better documentation.

There are 2 sections need to mention:

The following is my profile code. For nginx part i just add the template from https://github.com/voxpupuli/puppetboard into my nginx site-available. so whole part in nginx is very straight forward.

class profiles::puppetboard {
    $user           = 'puppetboard'
    $group          = 'puppetboard'
    $basedir        = '/opt/voxpupuli'
    $docroot        = "${basedir}/puppetboard"
    $wsgi_script    = "${docroot}/wsgi.py"

    package { 'uwsgi':
        ensure   => installed,
        provider => 'pip',
    }

    class { '::puppetboard':
        user              => $user,
        group             => $group,
        basedir           => $basedir,
        revision          => 'v0.0.5',
        manage_virtualenv => true,
        reports_count     => 100,
    }

    file { $wsgi_script:
        ensure  => present,
        content => template('puppetboard/wsgi.py.erb'),
        owner   => $user,
        group   => $group,
        require => [
            User[$user],
            Vcsrepo[$docroot],
        ],
    }
}

Add Ability to pass OFFLINE_MODE to settings.py

In environments where the user machine is unable to reach out to CDN's for remote assets, puppetboard has OFFLINE_MODE = True in settings.py to load those assets from disk.

I will be adding the ability to manage this config setting in a future PR.

Add git package dependency

Please add a dependency for git if not already declared. With the plain usage on a clean node I'm getting this:

Notice: /Stage[main]/Puppetboard/Vcsrepo[/srv/puppetboard/puppetboard]/ensure: Creating repository from present
Error: Command git is missing
Error: /Stage[main]/Puppetboard/Vcsrepo[/srv/puppetboard/puppetboard]/ensure: change from absent to present failed: Command git is missing

I'm using v1.3.0 with vcsrepo v0.2.0.

NEEDHELP: spec tests doesn't run

Not a real issue. More a question.

Have checkout latest master and run

bundle install --path vendor/bundle
bundle exec rake spec

but some test failed (vhost doesn't contains concat anymore)

How should I contribute now - because can not verify my change do not break any other function.

New install, puppetboard start error

Fresh install on 16.04 LTS
I installed a fresh puppetmaster a few days ago and it was working direct, and i don't see anything i have done differently this time.

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: server 2.7.2 agent 4.9.4
  • Ruby: 2.3.1p112
  • Distribution: Ubuntu 16.04 LTS
  • Module version: 2.9.0

How to reproduce (e.g Puppet code you use)

node puppet01 {

class { 'puppetdb':
manage_dbserver => true,
database => 'postgres',
postgres_version => '9.5',
manage_package_repo => false,
}
class { 'puppetdb::master::config':
manage_report_processor => true,
enable_reports => true,
}
class { 'puppetboard':
manage_git => 'latest',
manage_virtualenv => 'latest',
}
class { 'apache': }
class { 'apache::mod::wsgi': }
class { 'puppetboard::apache::vhost':
vhost_name => 'sth-puppetboard.internal.int',
port => 80,
}
}

What are you seeing

In /var/log/apache2/sth-puppetboard.internal.int_error.log
[Mon Mar 13 15:36:38.655244 2017] [wsgi:error] [pid 3964:tid 140468569270016] /srv/puppetboard/puppetboard/puppetboard/forms.py:4: ExtDeprecationWarning: Importing flask.ext.wtf is deprecated, use flask_wtf instead.
[Mon Mar 13 15:36:38.655276 2017] [wsgi:error] [pid 3964:tid 140468569270016] from flask.ext.wtf import Form
[Mon Mar 13 15:36:38.774101 2017] [wsgi:error] [pid 3964:tid 140468569270016] /srv/puppetboard/puppetboard/puppetboard/forms.py:11: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0.
[Mon Mar 13 15:36:38.774137 2017] [wsgi:error] [pid 3964:tid 140468569270016] class QueryForm(Form):
[Mon Mar 13 15:36:38.774227 2017] [wsgi:error] [pid 3964:tid 140468569270016] /srv/puppetboard/puppetboard/puppetboard/forms.py:33: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0.
[Mon Mar 13 15:36:38.774235 2017] [wsgi:error] [pid 3964:tid 140468569270016] class CatalogForm(Form):
[Mon Mar 13 15:36:38.780769 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] mod_wsgi (pid=3964): Target WSGI script '/srv/puppetboard/puppetboard/wsgi.py' cannot be loaded as Python module.
[Mon Mar 13 15:36:38.780793 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] mod_wsgi (pid=3964): Exception occurred processing WSGI script '/srv/puppetboard/puppetboard/wsgi.py'.
[Mon Mar 13 15:36:38.780822 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] Traceback (most recent call last):
[Mon Mar 13 15:36:38.780845 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] File "/srv/puppetboard/puppetboard/wsgi.py", line 15, in
[Mon Mar 13 15:36:38.780905 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] from puppetboard.app import app as application
[Mon Mar 13 15:36:38.780918 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 130, in
[Mon Mar 13 15:36:38.781233 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] abort.mapping[204] = NoContent
[Mon Mar 13 15:36:38.781259 2017] [wsgi:error] [pid 3964:tid 140468569270016] [remote 172.16.149.6:21098] AttributeError: 'function' object has no attribute 'mapping'

manage_* out of scope?

Do manage_git and manage_virtualenv even make sense in this module? I would argue that they don't, and should be managed by some other module (for example, python or git).

Cut a new release

Hi,

Features have been added to master but without a corresponding release. Could you please cut a new tag?

Thanks,
-g

Documentation wrong on SSL

The frontpage references the parameter "puppetdb_ssl". It was replaced with "puppetdb_ssl_verify". At the same time it appears the type was changed from string to bool. So there isn't a way any longer to specify the CA for the puppetmaster.

pip 9.0 fail with puppetboard ?

Running puppetboard (latest as of today - from git) - gives me these errors on a centos 7 server:

Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/File[/srv/puppetboard/virtenv-puppetboard]/ensure: created
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: New python executable in /srv/puppetboard/virtenv-puppetboard/bin/python
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Installing Setuptools..............................................................................................................................................................................................................................done.
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Running virtualenv with interpreter /bin/python
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Usage:   
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   pip install [options] <requirement specifier> ...
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   pip install [options] -r <requirements file> ...
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   pip install [options] [-e] <vcs project url> ...
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   pip install [options] [-e] <local project path> ...
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   pip install [options] <archive url/path> ...
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: no such option: --no-use-wheel
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Downloading/unpacking pip from https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   Running setup.py egg_info for package pip
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:       warnings.warn(msg)
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching '.coveragerc'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching '.mailmap'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching '.travis.yml'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching '.landscape.yml'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching 'pip/_vendor/Makefile'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching 'tox.ini'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching 'dev-requirements.txt'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     warning: no previously-included files found matching 'appveyor.yml'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     no previously-included directories found matching '.github'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     no previously-included directories found matching '.travis'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     no previously-included directories found matching 'docs/_build'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     no previously-included directories found matching 'contrib'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     no previously-included directories found matching 'tasks'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     no previously-included directories found matching 'tests'
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Downloading/unpacking setuptools from https://pypi.python.org/packages/d5/b7/e52b7dccd3f91eec858309dcd931c1387bf70b6d458c86a9bfcb50134fbd/setuptools-34.3.3.zip#md5=696941b10b15f0717be957a4d6cfc12e
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   Running setup.py egg_info for package setuptools
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     Traceback (most recent call last):
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:       File "<string>", line 3, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:       File "setuptools/__init__.py", line 12, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:         import setuptools.version
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:       File "setuptools/version.py", line 1, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:         import pkg_resources
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:       File "pkg_resources/__init__.py", line 70, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:         import packaging.version
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     ImportError: No module named packaging.version
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     Complete output from command python setup.py egg_info:
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     Traceback (most recent call last):
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   File "<string>", line 3, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   File "setuptools/__init__.py", line 12, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     import setuptools.version
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   File "setuptools/version.py", line 1, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     import pkg_resources
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:   File "pkg_resources/__init__.py", line 70, in <module>
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns:     import packaging.version
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: ImportError: No module named packaging.version
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: 
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: ----------------------------------------
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Cleaning up...
Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: Command python setup.py egg_info failed with error code 1 in /srv/puppetboard/virtenv-puppetboard/build/setuptools

dependency error when specifying manage_virtualenv

Puppet run returns the following dependency error:

Error: Failed to apply catalog: Cannot alias Package[virtualenv] to ["python-virtualenv", :apt] at /etc/puppetlabs/code/environments/production/modules/python/manifests/install.pp:53; resource ["Package", "python-virtualenv", :apt] already declared at /etc/puppetlabs/code/environments/production/modules/puppetboard/manifests/init.pp:268

This is caused by a duplicate declaration of the python-virtualenv package in both puppetboard and python module.

module tries to install non-existing dependencies

puppet module install nibalizer/puppetboard --modulepath modules
Notice: Downloading from https://forge.puppetlabs.com ...
Error: Could not install module 'nibalizer-puppetboard' (latest: v0.1.0)
  No version of 'stankevich-python' will satisfy dependencies
    'nibalizer-puppetboard' (v0.1.0) requires 'stankevich-python' (>= 1.1.4)
    Use `puppet module install --ignore-dependencies` to install only this module

Default vhost configuration causes Apache to fail to start

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.3.3
  • Ruby: 2.4.0 (bundled with puppet)
  • Distribution: CentOS 7.3
  • Module version: 3.0.0
  • python module version: 1.18.2
  • apache module version: 2.3.0

How to reproduce (e.g Puppet code you use)

  • Clean machine if pre-existing install exists:
    yum erase httpd httpd-tools httpd-devel ; rm -rf /etc/httpd
  • Manifest (taken directly from the Readme, plus "manage_virtualenv => true" because otherwise pip and virtualenv are not installed and I get an error from puppet):
     class { 'apache':
     	purge_configs => false,
     	mpm_module    => 'prefork',
     	default_vhost => true,
     	default_mods  => false,
     }
    
     class { 'apache::mod::wsgi': }
    
     class { 'puppetboard':
     	manage_virtualenv => true,}
    
     class { 'puppetboard::apache::conf': }
        
        
    

What are you seeing

Apache fails to start via puppet or when run via "httpd -e debug"

What behaviour did you expect instead

Apache should start

Output log

Info: Class[Apache::Service]: Scheduling refresh of Service[httpd] [0/9136]
Error: Systemd start for httpd failed!
journalctl log for httpd:
-- Logs begin at Mon 2017-11-06 01:21:41 PST, end at Tue 2017-11-07 09:14:40 PST. --
Nov 07 09:13:23 hostname systemd[1]: Stopping The Apache HTTP Server...
Nov 07 09:13:24 hostname systemd[1]: Stopped The Apache HTTP Server.
Nov 07 09:14:40 hostname systemd[1]: Starting The Apache HTTP Server...
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.491482 2017] [so:warn] [pid 17297] AH01574: module alias_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.492250 2017] [so:warn] [pid 17297] AH01574: module authz_core_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.492452 2017] [so:warn] [pid 17297] AH01574: module authz_host_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.493910 2017] [so:warn] [pid 17297] AH01574: module filter_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.494196 2017] [so:warn] [pid 17297] AH01574: module log_config_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.495612 2017] [so:warn] [pid 17297] AH01574: module unixd_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.497062 2017] [so:warn] [pid 17297] AH01574: module mpm_prefork_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.499032 2017] [so:warn] [pid 17297] AH01574: module systemd_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.499240 2017] [so:warn] [pid 17297] AH01574: module wsgi_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.501211 2017] [alias:warn] [pid 17297] AH00671: The Alias directive in /etc/httpd/conf.d/autoindex.conf at line 21 will probably n
ever match because it overlaps an earlier Alias.
Nov 07 09:14:40 hostname systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 07 09:14:40 hostname kill[17299]: kill: cannot find process ""
Nov 07 09:14:40 hostname systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 07 09:14:40 hostname systemd[1]: Failed to start The Apache HTTP Server.
Nov 07 09:14:40 hostname systemd[1]: Unit httpd.service entered failed state.
Nov 07 09:14:40 hostname systemd[1]: httpd.service failed.

Error: /Stage[main]/Apache::Service/Service[httpd]/ensure: change from 'stopped' to 'running' failed: Systemd start for httpd failed!
journalctl log for httpd:
-- Logs begin at Mon 2017-11-06 01:21:41 PST, end at Tue 2017-11-07 09:14:40 PST. --
Nov 07 09:13:23 hostname systemd[1]: Stopping The Apache HTTP Server...
Nov 07 09:13:24 hostname systemd[1]: Stopped The Apache HTTP Server.
Nov 07 09:14:40 hostname systemd[1]: Starting The Apache HTTP Server...
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.491482 2017] [so:warn] [pid 17297] AH01574: module alias_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.492250 2017] [so:warn] [pid 17297] AH01574: module authz_core_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.492452 2017] [so:warn] [pid 17297] AH01574: module authz_host_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.493910 2017] [so:warn] [pid 17297] AH01574: module filter_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.494196 2017] [so:warn] [pid 17297] AH01574: module log_config_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.495612 2017] [so:warn] [pid 17297] AH01574: module unixd_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.497062 2017] [so:warn] [pid 17297] AH01574: module mpm_prefork_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.499032 2017] [so:warn] [pid 17297] AH01574: module systemd_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.499240 2017] [so:warn] [pid 17297] AH01574: module wsgi_module is already loaded, skipping
Nov 07 09:14:40 hostname httpd[17297]: [Tue Nov 07 09:14:40.501211 2017] [alias:warn] [pid 17297] AH00671: The Alias directive in /etc/httpd/conf.d/autoindex.conf at line 21 will probably n
ever match because it overlaps an earlier Alias.
Nov 07 09:14:40 hostname systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Nov 07 09:14:40 hostname kill[17299]: kill: cannot find process ""
Nov 07 09:14:40 hostname systemd[1]: httpd.service: control process exited, code=exited status=1
Nov 07 09:14:40 hostname systemd[1]: Failed to start The Apache HTTP Server.
Nov 07 09:14:40 hostname systemd[1]: Unit httpd.service entered failed state.
Nov 07 09:14:40 hostname systemd[1]: httpd.service failed.

Notice: /Stage[main]/Apache::Service/Service[httpd]: Triggered 'refresh' from 2 events

Any additional information you'd like to impart

Output is the same when running "httpd -e trace8". Exit code is 1. There are no errors (only warnings).

Apache starts if I change the manifest to simply read:

	class { 'apache':}
	class { 'apache::mod::wsgi': }

and start clean as described.

Reduce dependency on other modules

It feels like setting up this module its over complicated and so is maintaining its code due to its dependency on some other modules.

  • EPEL: Only needed by EL 6 and a simple Yumrepo resource can take care of that, no need for a module.
  • stankevich/python: The module cannot keep up with all the changes done to pip and Python 3 so lets call use pip directly in this module. (Remember that Puppet's Package resource can use pip as a provider)
  • vcsrepo: It should be optional and the latest puppetboard release should be installed from pip by default.

No unit tests?

I notice that we have acceptance tests for PCCI but no rspec-puppet based unit tests. Was this a concious decision?

The apache service is not notified when settings.py is updated

While changing some configuration elements, I noticed that changes to settings.py do not notify the apache service to restart. Until that is done manually, the old settings are still used. Here's the agent run:

# sudo puppet agent -t --environment puppetboardpe
Info: Using configured environment 'puppetboardpe'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for puppetboard.example.com
Info: Applying configuration version '1489274497'
Notice: /Stage[main]/Profile::Puppetboard/File[/etc/puppetlabs/puppet/ssl/private_keys]/mode: mode changed '0750' to '0755'
Notice: /Stage[main]/Profile::Puppetboard/File[/etc/puppetlabs/puppet/ssl/private_keys/puppetboard.example.com.pem]/mode: mode changed '0640' to '0644'
Notice: /Stage[main]/Puppetboard/File[/srv/puppetboard/puppetboard/settings.py]/content:
--- /srv/puppetboard/puppetboard/settings.py    2017-03-11 23:20:54.296005740 +0000
+++ /tmp/puppet-file20170311-8162-zqcf25        2017-03-11 23:21:54.849171311 +0000
@@ -2,8 +2,10 @@
 DEV_LISTEN_PORT = 5000
 LOGLEVEL = 'info'
 PUPPETDB_HOST = 'puppet.example.com'
-PUPPETDB_PORT = 8080
-PUPPETDB_SSL_VERIFY = False
+PUPPETDB_PORT = 8081
+PUPPETDB_SSL_VERIFY = True
+PUPPETDB_KEY = '/etc/puppetlabs/puppet/ssl/private_keys/puppetboard.example.com.pem'
+PUPPETDB_CERT = '/etc/puppetlabs/puppet/ssl/certs/puppetboard.example.com.pem'
 PUPPETDB_TIMEOUT = 20
 UNRESPONSIVE_HOURS = 3
 ENABLE_CATALOG = False

Info: Computing checksum on file /srv/puppetboard/puppetboard/settings.py
Info: FileBucket got a duplicate file {md5}74a09228c99782c8abf70b3dfc024c12
Info: /Stage[main]/Puppetboard/File[/srv/puppetboard/puppetboard/settings.py]: Filebucketed /srv/puppetboard/puppetboard/settings.py to puppet with sum 74a09228c99782c8abf70b3dfc024c12
Notice: /Stage[main]/Puppetboard/File[/srv/puppetboard/puppetboard/settings.py]/content: content changed '{md5}74a09228c99782c8abf70b3dfc024c12' to '{md5}76e62b1e6dd1a3b4186ff32e58c49d52'
Notice: Applied catalog in 6.92 seconds

Subsequently, accessing the site returned a 500 and logs showed port 8080 was still being used:

[Sat Mar 11 23:03:43.883756 2017] [:error] [pid 18276] INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (28): puppet.example.com
[Sat Mar 11 23:03:43.885765 2017] [:error] [pid 18276] ERROR:pypuppetdb.api:Could not reach PuppetDB on puppet.example.com:8080 over HTTP.

I would expect that changes to settings.py, and possibly other settings-related changes, would notify the apache service to restart.

Module version differences

Hi,

How is this module different from nibalizer-puppetboard module? Does this one supersede it or is it just that it supports PE?

regards
Paul

Apache 2.4 Compatibility

The templates file (/templates/apache/conf.erb) uses the pre-2.4 syntax. This is a very easy fix to just change the template file to:

WSGIDaemonProcess puppetboard user=<%= @user -%> group=<%= @user -%> threads=<%= @threads %> maximum-requests=<%= @max_reqs %>
WSGIScriptAlias <%= @wsgi_alias -%> <%= @docroot -%>/wsgi.py

 <Directory <%= @docroot -%>>
    WSGIProcessGroup puppetboard
    WSGIApplicationGroup %{GLOBAL}
      <IfVersion < 2.4>
        Order allow,deny
        Allow from all
      </IfVersion>
      <IfVersion >= 2.4>
        Require all granted
      </IfVersion>
 </Directory>

Submitting a pull request to that effect.

Option to control homedir for puppetboard user

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.6.1
  • Ruby: (doesn't seem to be installed)
  • Distribution: Ubuntu 6.04.1 LTS (Xenial Xerus)
  • Module version: 2.8.2

How to reproduce (e.g Puppet code you use)

Classes:
- 'puppetboard'
- 'puppetboard::apache::vhost'
- 'apache'
puppetboard::manage_virtualenv: 'true'
puppetboard::default_environment: '*'
puppetboard::apache::vhost::vhost_name: 'puppetboard000.example.com'
puppetboard::apache::vhost::port: '80'

What are you seeing

Error: Could not create user puppetboard: Execution of '/usr/sbin/useradd -g puppetboard -s /bin/bash -m -r puppetboard' returned 12: useradd: cannot create directory /home/puppetboard
Error: /Stage[main]/Puppetboard/User[puppetboard]/ensure: change from absent to present failed: Could not create user puppetboard: Execution of '/usr/sbin/useradd -g puppetboard -s /bin/bash -m -r puppetboard' returned 12: useradd: cannot create directory /home/puppetboard

What behaviour did you expect instead

My /home is actual an NFS target, so this is why it's failing. The module doesn't have a way to specify $homedir. I'd expect a way to control home dir for user puppetboard.

Output log

Any additional information you'd like to impart

Quoting default_settings.py

Some attributes in the puppetboard class are not quoted properly when their values are written out to default_settings.py.

This is my calling syntax, and for some variables I have had to double-encapsulate strings in single quotes and double quotes, so they are written out to default_settings.py with single quotes.

  class { 'puppetboard':
    manage_virtualenv => true,
    puppetdb_host => 'puppet.example.com',
    puppetdb_port => "'8081'",
    puppetdb_key  => "'/var/lib/puppet/ssl/private_keys/${::fqdn}.pem'",
    puppetdb_ssl  => "'true'",
    puppetdb_cert => "'/var/lib/puppet/ssl/public_keys/${::fqdn}.pem'",
  }

When these variables are not double-quoted, this happens in the apache log because config values are written without quotes:

[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x]      PUPPETDB_KEY = /var/lib/puppet/ssl/private_keys/node.example.com.pem
[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x]                     ^
[Mon Jun 09 08:57:12 2014] [error] [client x.x.x.x]  SyntaxError: invalid syntax

I'm using nibalizer-puppetboard 2.4.0 with Puppet 3.6.1. Thanks.

Using with packaged puppetboard

Hello,

I can not see a method of using this module with a packaged version of puppetboard due to the close coupling with Vcsrepo module.

We have no external access to PIP so even if I mirror the puppetboard source the issue still exists.

Ideally I would like to be able to specify package_src = 'git' or for me 'pkg' which changes the way the module handles Vcsrepo and Virtualenv/pip.

Adding puppetboard::apache::ldapauth?

Hi,

Is there interest in having LDAP authentication setup baked in to puppetboard, e.g. in ::puppetboard::apache::ldapauth. Basically one has to enable the authnz_ldap module, which puppetlabs/apache can surely handle. Then an apache2 configuration fragment such as this needs to be put to /etc/apache2/conf-enabled or equivalent:

<LocationMatch ^/puppetboard>
   AuthType Basic
   AuthName "Login to puppetboard with LDAP credentials"
   # These two are valid for Apache 2.2, but not really for 2.4
   Order Allow,Deny
   Allow from All

   AuthBasicProvider ldap
   AuthLDAPBindDN cn=proxy,dc=domain,dc=com
   AuthLDAPBindPassword secret_password
   AuthLDAPURL ldap://ldap.domain.com:389/ou=People,dc=domain,dc=com?cn
   AuthLDAPBindAuthoritative on

   Require valid-user
</LocationMatch>

Of course the above will eventually be need to extended to support different types of LDAP setups (e.g. anonymous binds), but I think it's a good starting point.

If you think this would be useful to having in this module I'm more than happy to implement it. Let me know what you think.

Problem with installing puppetboard.

I had to reinstall puppetdb & puppetboard. I have all of my stuff in gitlab. When I tried to reinstall puppetboard I got the below error. The only fix is to copy over /srv/puppetboard from another machine :-(

Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: ValueError: I/O operation on closed file

Error: true && virtualenv --system-site-packages -p python /srv/puppetboard/virtenv-puppetboard && /srv/puppetboard/virtenv-puppetboard/bin/pip wheel --help > /dev/null 2>&1 && { /srv/puppetboard/virtenv-puppetboard/bin/pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { /srv/puppetboard/virtenv-puppetboard/bin/pip --log /srv/puppetboard/virtenv-puppetboard/pip.log install $wheel_support_flag --upgrade pip setuptools || /srv/puppetboard/virtenv-puppetboard/bin/pip --log /srv/puppetboard/virtenv-puppetboard/pip.log install --upgrade pip setuptools ;} returned 1 instead of one of [0]
pip.txt

make static/ really static

Serve EVERYTHING from static -- images, css, whatever it is that's being pulled from other websites. This way, as long as a client can reach the puppetboard box, it'll show the site properly.

Install problem

I tried install puppetboard on CentOS with module puppetboard but when I put this config:

  class { 'puppetboard':
    manage_git        => 'lastest',
    manage_virtualenv => 'lastest',
  }

This module install python-virtualenv but after that it uninstall python-devel.

I fix it putting this in module:

  if $manage_virtualenv and !defined(Package[$::puppetboard::params::virtualenv]) {
    class { '::python':
      virtualenv => 'present',
      **dev => 'present**',
    }
  }

ssl parameter name confusion

The parameters used to configure the ssl certificate used by puppetboard mention puppetdb in their name:

  • puppetdb_key
  • puppetdb_cert
  • puppetdb_ssl_verify

However, these should contain the path to puppetboard-specific key and cert. Hence I propose to rename them in accordance with the puppetlabs/puppetdb module:

  • ssl_key_path
  • ssl_cert_path

The final parameter (puppetdb_ssl_verify) might be split to improve its meaning, however this is also caused by puppetboard itself.

  • ssl_ca_cert_path
  • ssl_verify

More flexibility with apache::vhost

Hi there,

I wonder if there is a way for your puppetboard::apache::vhost class to accept a hash of extra attributes to pass through to ::apache::vhost? In my environment I need to configure SSL and a bunch of other options for my organisation's single sign-on system. Doesn't make sense for your to reimplement most of the options in apache::vhost so maybe passing through a hash is easiest.

Thanks,
Jonathan

SSL Cert permissions with managed user

When using SSL to PuppetDB with client certificates (and using the local puppet agent's certificate), the default permissions don't allow the puppetboard user created by the module to read the files in /var/lib/puppet/ssl/private_keys; this causes a vague error:

[:error] [pid 32070] ERROR:pypuppetdb.api:Could not reach PuppetDB on puppetdb-host:8081 over HTTPS.

Adding the puppetboard user to the puppet group gives the PuppetBoard process access to read the private key, and everything starts working.

It's probably not a good idea to add the managed user to a specific named group by default, since it might not exist on some systems and might be named differently on others. A parameter to enable this behavior (plus an update to the relevant part of the docs) seems like the way to go. Let me know if this sounds good and I'll submit a PR.

Puppet CA certificate not configured correctly

Currently if you do not have the Puppet CA root certificate added to the root certificate authority file used by your operating system. You have to specific the puppet CA root certificate via the hack mentioned in the documentation, a.k.a:

$ssl_dir = $::settings::ssldir
$puppetboard_certname = $::certname
class { 'puppetboard':
  ...
  puppetdb_ssl      => "${ssl_dir}/certs/ca.pem",
  ...
}

Puppetboard 2.8.2 does not allow the usage of puppetdb_ssl and currently even just uses the puppetdb_ssl_verify => true/false toggle as the value to the generated settings.py of puppet board.

cat settings.py 
PUPPETDB_SSL_VERIFY = true 
PUPPETDB_KEY = '/etc/puppetlabs/puppet/ssl/private_keys/puppetdb.sott.sleepscan.equilli.com.pem'
PUPPETDB_CERT = '/etc/puppetlabs/puppet/ssl/certs/puppetdb.sott.sleepscan.equilli.com.pem'

Once the value of PUPPETDB_SSL_VERIFY is changed to PUPPETDB_SSL_VERIFY='/etc/puppetlabs/puppet/ssl/certs/ca.pem' manually, the SSL verification works as expected.

Is the provided documentation incorrect? Or is this documentation for a future release?

apache config dir wrong in Ubuntu

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10
  • Ruby: 2.1.5
  • Distribution: Ubuntu 16.04
  • Module version: 4.0.0

How to reproduce (e.g Puppet code you use)

Use the following example

class { 'apache':
  purge_configs => false,
  mpm_module    => 'prefork',
  default_vhost => true,
  default_mods  => false,
}
class { 'apache::mod::wsgi': }
class { 'puppetboard': }
class { 'puppetboard::apache::conf': }

What are you seeing

Error in running

Error: Could not set 'present' on ensure: No such file or directory @ dir_s_mkdir - /etc/apache2/conf.d/puppetboard.conf20180314-16269-1bzq3a.lock at /etc/puppetlabs/code/environments/production/modules/puppetboard/manifests/apache/conf.pp:88

What behaviour did you expect instead

Use /etc/apache2/conf-enabled instead of /etc/apache2/conf.d

Output log

Any additional information you'd like to impart

In Ubuntu 16.04, apache2 config dir is

root@puppet:~# dpkg -L apache2 | grep conf
/etc/apache2/conf-enabled

Seems that conf.d is in 12.04, and 14.04 onwards is conf-enabled

Setting 'PUPPETDB_SSL_VERIFY' via Hiera Fails

I am setting the PUPPETDB_SSL_VERYIFY via Hiera like so:

puppetboard::puppetdb_ssl_verify: '/var/lib/puppet/ssl/certs/ca.pem'

However this is being ignored for some reason I can't quite see looking at the code.

For reference this is the full Hiera code for this node (separate node currently to my PuppetDB server):

---
classes:
        - apache
        - apache::mod::wsgi
        - puppetboard
        - puppetboard::apache::vhost
apache::mod::wsgi::wsgi_socket_prefix: '/var/run/wsgi'
puppetboard::manage_virtualenv: true
puppetboard::manage_git: true
puppetboard::unresponsive: '6'
puppetboard::puppetdb_host: 'puppetdb.example.com'
puppetboard::puppetdb_port: '8081'
puppetboard::puppetdb_key: "/var/lib/puppet/ssl/private_keys/%{clientcert}.pem"
puppetboard::puppetdb_ssl_verify: '/var/lib/puppet/ssl/certs/ca.pem'
puppetboard::puppetdb_cert: "/var/lib/puppet/ssl/certs/%{clientcert}.pem"
puppetboard::apache::vhost::vhost_name: 'puppetboard.example.com'
puppetboard::apache::vhost::port: 80

This creates a settings.py of:

DEV_LISTEN_HOST = '127.0.0.1'
DEV_LISTEN_PORT = 5000
LOGLEVEL = 'info'
PUPPETDB_HOST = 'puppetdb.example.com'
PUPPETDB_PORT = 8081
PUPPETDB_SSL_VERIFY = False
PUPPETDB_KEY = '/var/lib/puppet/ssl/private_keys/puppetboard.example.com.pem'
PUPPETDB_CERT = '/var/lib/puppet/ssl/certs/puppetboard.example.com.pem'
PUPPETDB_TIMEOUT = 20
UNRESPONSIVE_HOURS = 6
ENABLE_QUERY = True
LOCALISE_TIMESTAMP = True
PUPPETDB_EXPERIMENTAL = False
REPORTS_COUNT = 10

I am using the latest 2.5.0 version of the module from Puppet Forge.

Any way to install without access to GitHub?

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:
  • Ruby:
  • Distribution:
  • Module version:

How to reproduce (e.g Puppet code you use)

 class { 'puppetboard':
   manage_git => false,
   manage_virtualenv => false,
 }

What are you seeing

Module tries to clone git repository.

What behaviour did you expect instead

Puppet module voxpupuli-puppetboard is already installed in my modules path. I don't need it [re]installed as I don't have access to the Internet from the Puppetboard server.

Output log

Any additional information you'd like to impart

'vcsrepo' is trying to git clone the puppetboard repository. I don't have access to the Internet from this server.

DSL 4 issue: 'versioncmp' parameter 'a' expects a String value

I think this is a DSL 4 issue if virtualenv is not already installed:

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 'versioncmp' parameter 'a' expects a String value, got Undef at /etc/puppetlabs/code/environments/production/modules/python/manifests/virtualenv.pp:121:11 at /etc/puppetlabs/code/environments/production/modules/puppetboard/manifests/init.pp:250

Add DEFAULT_ENVIRONMENT to settings.py

puppetboard default environment is 'production', however there are use cases where production should not be the default (absence of a production environment, or the desire to see all environments '*').

I will be submitting a PR to add this functionality

Add a virtualenv dependency. Getting "Error: sh: 1: virtualenv: not found"

On a clean system after dealing with #21 locally:

Notice: /Stage[main]/Puppetboard/Vcsrepo[/srv/puppetboard/puppetboard]/ensure: Creating repository from present
Notice: /Stage[main]/Puppetboard/Vcsrepo[/srv/puppetboard/puppetboard]/ensure: created
Error: sh: 1: virtualenv: not found
sh: 1: /srv/puppetboard/virtenv-puppetboard/bin/pip: not found
sh: 1: /srv/puppetboard/virtenv-puppetboard/bin/pip: not found

Error: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard]/returns: change from notrun to 0 failed: sh: 1: virtualenv: not found
sh: 1: /srv/puppetboard/virtenv-puppetboard/bin/pip: not found
sh: 1: /srv/puppetboard/virtenv-puppetboard/bin/pip: not found

Notice: /Stage[main]/Puppetboard/Python::Virtualenv[/srv/puppetboard/virtenv-puppetboard]/Python::Requirements[/srv/puppetboard/puppetboard/requirements.txt_/srv/puppetboard/virtenv-puppetboard]/File[/srv/puppetboard/puppetboard/requirements.txt]: Dependency Exec[python_virtualenv_/srv/puppetboard/virtenv-puppetboard] has failures: true

I guess we need a dependency like class { python::install: virtualenv => true, pip => true }?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.