Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
agent_service => 'puppet',
agent_service_conf => '/etc/default/puppet',
default_method => 'cron',
server_package => 'puppetserver',
server_service => 'puppetserver',
master_package => 'puppetmaster',
master_service => 'puppetmaster',
puppet_cmd => '/usr/bin/puppet',
Expand Down
11 changes: 9 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@
include puppet::server::config

if $manage_package and ($puppet::agent::package != $package) {
package { $package:
$package_real = $servertype ? {
'server' => $puppet::params::server_package,
default => $package,
}
package { $package_real:
ensure => $ensure;
}
}
Expand Down Expand Up @@ -103,8 +107,11 @@
'standalone': {
include puppet::server::standalone
}
'server': {
include puppet::server::server
}
default: {
err('Only "passenger", "thin", and "unicorn" are valid options for servertype')
err('Only "passenger", "thin", "serverr", and "unicorn" are valid options for servertype')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is vaporware ;)
i'll rebase @danieldreier's and go with that one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another fragment from another effort I'd made:
https://github.com/puppetlabs-operations/puppet-puppet/blob/2653e222bf1275ea1426eed694a5716f58524d00/manifests/server/puppetserver/webserver.pp

The docs I'm aware of that may be interesting to you for this are:

basic setup:
https://github.com/puppetlabs/puppet-server/blob/master/documentation/install_from_packages.markdown

external SSL termination (probably not needed for most cases)
https://github.com/puppetlabs/puppet-server/blob/master/documentation/external_ssl_termination.markdown

https://github.com/puppetlabs/puppet-server/blob/master/documentation/configuration.markdown

  • where JRuby will look for gems
  • path to puppet conf dir
  • path to puppet var dir
  • maximum number of JRuby instances to allow; defaults to +2
  • enable/disable the CA service via trapperkeeper settings
  • configure logging via logback

Basic parameters:
https://github.com/puppetlabs/puppet-server/blob/master/documentation/configuration.markdown
[memory] - (optional) set JVM memory use; 2gb recommended by default
format is "2gb", "512m", etc.
[max_active_instances] - (optional) maximum number of JRuby instances to allow
[logging_config] - (optional) Path to logback logging configuration file
http://logback.qos.ch/manual/configuration.html
[gem_home] - (optional) determines where JRuby will look for gems. Also
used by the puppetserver gem command line tool.
[master_conf_dir] - (optional) path to puppet conf dir
[master_var_dir] - (optional) path to puppet var dir
[enable_profiler] - (optional) enable or disable profiling for the Ruby code
(true|false)
[*allow_header_cert_info - (optional) Allows the "ssl_client_header" and
(true|false) "ssl_client_verify_header" options set in
puppet.conf to work. These headers will be
ignored unless "allow-header-cert-info" is true

Also note that puppetserver.conf is in HOCON format, which is a (somewhat odd strange) superset of JSON (https://github.com/puppetlabs/puppet-server/blob/master/documentation/configuration.markdown, https://github.com/typesafehub/config#using-hocon-the-json-superset)
I'd suggest that puppet-puppet simply create pure JSON puppetserver.conf files because
that's way easier to work with, until we get a proper augeas provider for HOCON.

The most common failure cases for very basic puppetserver use are:

  • insufficient memory allocated for JVM (it's 2gb by default, vagrant is 512mb by default)
  • init script will return success even if the service didn't really succeed starting
  • service starts but doesn't respond to requests for a few minutes while the JVM starts and threads come up

We may want to help manage gems inside of jruby (see https://github.com/puppetlabs/puppet-server/blob/master/documentation/gems.markdown) because the gem path is different, and many modules/report processors/providers/etc require gems, and system gems won't be available.

One significant and little-noted change is that puppetserver has environment caches which improve performance but lead to confusing behavior if you redeploy environments frequently via r10k. This was introduced in Puppet 3.6 but I've only noticed the impact on puppetserver systems for whatever reason. See https://docs.puppetlabs.com/puppet/latest/reference/environments_limitations.html for more information; the key setting to manage is environment_timeout.

Sorry about the wall of text - I just spent a lot of time researching all the settings we might want to manage while I was going about adding puppetserver support, then never got around to implementing it fully.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note -

The puppetlabs-hocon module appears to be intended as the standard way to manage hocon-format configuration files in puppet server and other trapperkeeper projects. It provides approximately the same functionality as the ini_setting resource from puppetlabs/inifile.

fail('Servertype "$servertype" not implemented')
}
}
Expand Down
11 changes: 11 additions & 0 deletions manifests/server/server.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class puppet::server::server {
class { 'puppet::server::standalone': enabled => false }

# configure
# lol, no idea, really :(

service { $puppet::params::server_service:
ensure => $puppet::server::ensure
}

}