Fix nodepool class parameter defaults

This patch makes the following changes to make the parameter defaults
more sensible:

- Makes $nodepool_ssh_private_key required. It is not sensible to
  create a private key file that is empty, so we opt to fail fast in
  puppet rather than confuse nodepool. The system-config repository
  passes this value so this change will not affect Infra.
- Make $statsd_host default to undef. The nodepool.default template
  where this value is used now needs to check for both nil and ""
  because system-config passes "" directly to it and we want to
  continue the same behavior.
- Make $scripts_dir and $elements_dir default to undef and update the
  logic in the manifest to handle this.

Change-Id: Ic5e9af720c334d2cf2f7a9abe7c12fb81873086c
This commit is contained in:
Colleen Murphy 2015-08-10 17:47:48 -07:00
parent 9e37efea4c
commit d4f9247be1
2 changed files with 7 additions and 7 deletions

View File

@ -20,18 +20,18 @@
class nodepool (
$mysql_root_password,
$mysql_password,
$nodepool_ssh_private_key = '',
$nodepool_ssh_private_key,
$git_source_repo = 'https://git.openstack.org/openstack-infra/nodepool',
$revision = 'master',
$statsd_host = '',
$statsd_host = undef,
$vhost_name = $::fqdn,
$image_log_document_root = '/var/log/nodepool/image',
$enable_image_log_via_http = false,
$environment = {},
# enable sudo for nodepool user. Useful for using dib with nodepool
$sudo = true,
$scripts_dir = '',
$elements_dir = '',
$scripts_dir = undef,
$elements_dir = undef,
$logging_conf_template = 'nodepool/nodepool.logging.conf.erb',
) {
@ -124,7 +124,7 @@ class nodepool (
ensure => directory,
}
if ($scripts_dir != '') {
if ($scripts_dir != undef) {
file { '/etc/nodepool/scripts':
ensure => directory,
owner => 'root',
@ -138,7 +138,7 @@ class nodepool (
}
}
if ($elements_dir != '') {
if ($elements_dir != undef) {
file { '/etc/nodepool/elements':
ensure => directory,
owner => 'root',

View File

@ -1,4 +1,4 @@
<% if @statsd_host != "" -%>
<% if @statsd_host != nil && @statsd_host != "" -%>
export STATSD_HOST=<%= @statsd_host %>
export STATSD_PORT=8125
<% end -%>