Enable puppet-lint-empty_string-check & fix errors
This patch changes the default values of params whose values were '' to undef, except for $askbot::site::ssl::site_ssl_cert_file and $askbot::site::ssl::site_ssl_key_file which were changed to use the same default provided in the askbot and askbot::config class. Also updated conditionals to look for the new undef value instead of the empty string. Change-Id: Ia3cabb5760f940cbf9c39714571b2ae5eac92a2d
This commit is contained in:
parent
a07962ba55
commit
9dee51a91b
2
Gemfile
2
Gemfile
@ -14,7 +14,7 @@ group :development, :test do
|
||||
# Puppet 4.x related lint checks
|
||||
gem 'puppet-lint-unquoted_string-check'
|
||||
# Hold off on the empty string check for now
|
||||
#gem 'puppet-lint-empty_string-check'
|
||||
gem 'puppet-lint-empty_string-check'
|
||||
gem 'puppet-lint-leading_zero-check'
|
||||
gem 'puppet-lint-variable_contains_upcase'
|
||||
gem 'puppet-lint-numericvariable'
|
||||
|
@ -21,15 +21,15 @@ class askbot::config (
|
||||
$redis_max_memory = '256m',
|
||||
$redis_bind = '127.0.0.1',
|
||||
$site_ssl_enabled = false,
|
||||
$site_ssl_cert_file_contents = '',
|
||||
$site_ssl_key_file_contents = '',
|
||||
$site_ssl_chain_file_contents = '',
|
||||
$site_ssl_cert_file_contents = undef,
|
||||
$site_ssl_key_file_contents = undef,
|
||||
$site_ssl_chain_file_contents = undef,
|
||||
$site_ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem',
|
||||
$site_ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key',
|
||||
$site_ssl_chain_file = '',
|
||||
$site_ssl_chain_file = undef,
|
||||
$site_name = 'askbot',
|
||||
$custom_theme_enabled = false,
|
||||
$custom_theme_name = '',
|
||||
$custom_theme_name = undef,
|
||||
$solr_enabled = false,
|
||||
$smtp_port = 25,
|
||||
$smtp_host = 'localhost',
|
||||
|
@ -70,15 +70,15 @@ class askbot (
|
||||
$redis_max_memory = '256m',
|
||||
$redis_bind = '127.0.0.1',
|
||||
$site_ssl_enabled = false,
|
||||
$site_ssl_cert_file_contents = '',
|
||||
$site_ssl_key_file_contents = '',
|
||||
$site_ssl_chain_file_contents = '',
|
||||
$site_ssl_cert_file_contents = undef,
|
||||
$site_ssl_key_file_contents = undef,
|
||||
$site_ssl_chain_file_contents = undef,
|
||||
$site_ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem',
|
||||
$site_ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key',
|
||||
$site_ssl_chain_file = '',
|
||||
$site_ssl_chain_file = undef,
|
||||
$site_name = 'askbot',
|
||||
$custom_theme_enabled = false,
|
||||
$custom_theme_name = '',
|
||||
$custom_theme_name = undef,
|
||||
$solr_enabled = false,
|
||||
$smtp_port = '25',
|
||||
$smtp_host = 'localhost'
|
||||
|
@ -1,17 +1,17 @@
|
||||
# == Class: askbot::site::ssl
|
||||
# This class describes the http server's SSL configuration
|
||||
class askbot::site::ssl (
|
||||
$site_ssl_cert_file_contents = '',
|
||||
$site_ssl_key_file_contents = '',
|
||||
$site_ssl_chain_file_contents = '',
|
||||
$site_ssl_cert_file = '',
|
||||
$site_ssl_key_file = '',
|
||||
$site_ssl_chain_file = '',
|
||||
$site_ssl_cert_file_contents = undef,
|
||||
$site_ssl_key_file_contents = undef,
|
||||
$site_ssl_chain_file_contents = undef,
|
||||
$site_ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem',
|
||||
$site_ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key',
|
||||
$site_ssl_chain_file = undef,
|
||||
) {
|
||||
include ::apache::ssl
|
||||
|
||||
# site x509 certificate
|
||||
if $site_ssl_cert_file_contents != '' {
|
||||
if $site_ssl_cert_file_contents != undef {
|
||||
file { $site_ssl_cert_file:
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
@ -22,7 +22,7 @@ class askbot::site::ssl (
|
||||
}
|
||||
|
||||
# site ssl key
|
||||
if $site_ssl_key_file_contents != '' {
|
||||
if $site_ssl_key_file_contents != undef {
|
||||
file { $site_ssl_key_file:
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
@ -33,7 +33,7 @@ class askbot::site::ssl (
|
||||
}
|
||||
|
||||
# site ca certificates file
|
||||
if $site_ssl_chain_file_contents != '' {
|
||||
if $site_ssl_chain_file_contents != undef {
|
||||
file { $site_ssl_chain_file:
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
|
@ -21,7 +21,7 @@ NameVirtualHost <%= @vhost_name %>:443
|
||||
SSLProtocol All -SSLv2 -SSLv3
|
||||
SSLCertificateFile <%= @site_ssl_cert_file %>
|
||||
SSLCertificateKeyFile <%= @site_ssl_key_file %>
|
||||
<% if @site_ssl_chain_file_contents != '' %>
|
||||
<% if @site_ssl_chain_file_contents != nil %>
|
||||
SSLCertificateChainFile <%= @site_ssl_chain_file %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user