Add Gemfile and puppet 4 checks
In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. Also fix lint errors caught by the puppet-lint-empty_string-check gem as well as arrow alignment errors raised by the newer version of puppet-lint. Change-Id: I541aff1e4848e46918f7d6e1750c2afa26fb2f3a
This commit is contained in:
parent
fea61c6c44
commit
6d9e839729
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Gemfile.lock
|
||||||
|
.bundled_gems/
|
30
Gemfile
Normal file
30
Gemfile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
gem 'puppetlabs_spec_helper', :require => false
|
||||||
|
|
||||||
|
gem 'metadata-json-lint'
|
||||||
|
# This is nice and all, but let's not worry about it until we've actually
|
||||||
|
# got puppet 4.x sorted
|
||||||
|
# gem 'puppet-lint-param-docs'
|
||||||
|
gem 'puppet-lint-absolute_classname-check'
|
||||||
|
gem 'puppet-lint-absolute_template_path'
|
||||||
|
gem 'puppet-lint-trailing_newline-check'
|
||||||
|
|
||||||
|
# Puppet 4.x related lint checks
|
||||||
|
gem 'puppet-lint-unquoted_string-check'
|
||||||
|
gem 'puppet-lint-empty_string-check'
|
||||||
|
gem 'puppet-lint-leading_zero-check'
|
||||||
|
gem 'puppet-lint-variable_contains_upcase'
|
||||||
|
gem 'puppet-lint-spaceship_operator_without_tag-check'
|
||||||
|
gem 'puppet-lint-undef_in_function-check'
|
||||||
|
|
||||||
|
if puppetversion = ENV['PUPPET_GEM_VERSION']
|
||||||
|
gem 'puppet', puppetversion, :require => false
|
||||||
|
else
|
||||||
|
gem 'puppet', '~> 3.0', :require => false
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
# vim:ft=ruby
|
@ -11,10 +11,10 @@ class phabricator (
|
|||||||
$mysql_user_password,
|
$mysql_user_password,
|
||||||
$ssl_cert_file = "/etc/ssl/certs/${::fqdn}.pem",
|
$ssl_cert_file = "/etc/ssl/certs/${::fqdn}.pem",
|
||||||
$ssl_key_file = "/etc/ssl/private/${::fqdn}.key",
|
$ssl_key_file = "/etc/ssl/private/${::fqdn}.key",
|
||||||
$ssl_chain_file = '',
|
$ssl_chain_file = undef,
|
||||||
$ssl_cert_file_contents = '', # If left empty puppet will not create file.
|
$ssl_cert_file_contents = undef, # If left empty puppet will not create file.
|
||||||
$ssl_key_file_contents = '', # If left empty puppet will not create file.
|
$ssl_key_file_contents = undef, # If left empty puppet will not create file.
|
||||||
$ssl_chain_file_contents = '' # If left empty puppet will not create file.
|
$ssl_chain_file_contents = undef # If left empty puppet will not create file.
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$instances_dir = "${phab_dir}/instances"
|
$instances_dir = "${phab_dir}/instances"
|
||||||
@ -50,7 +50,7 @@ class phabricator (
|
|||||||
ensure => directory,
|
ensure => directory,
|
||||||
}
|
}
|
||||||
|
|
||||||
if $ssl_cert_file_contents != '' {
|
if $ssl_cert_file_contents != undef {
|
||||||
file { $ssl_cert_file:
|
file { $ssl_cert_file:
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
@ -60,7 +60,7 @@ class phabricator (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $ssl_key_file_contents != '' {
|
if $ssl_key_file_contents != undef {
|
||||||
file { $ssl_key_file:
|
file { $ssl_key_file:
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'ssl-cert',
|
group => 'ssl-cert',
|
||||||
@ -70,7 +70,7 @@ class phabricator (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $ssl_chain_file_contents != '' {
|
if $ssl_chain_file_contents != undef {
|
||||||
file { $ssl_chain_file:
|
file { $ssl_chain_file:
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
|
@ -36,7 +36,9 @@
|
|||||||
SSLProtocol All -SSLv2 -SSLv3
|
SSLProtocol All -SSLv2 -SSLv3
|
||||||
SSLCertificateFile <%= scope.lookupvar("phabricator::ssl_cert_file") %>
|
SSLCertificateFile <%= scope.lookupvar("phabricator::ssl_cert_file") %>
|
||||||
SSLCertificateKeyFile <%= scope.lookupvar("phabricator::ssl_key_file") %>
|
SSLCertificateKeyFile <%= scope.lookupvar("phabricator::ssl_key_file") %>
|
||||||
<% if scope.lookupvar("phabricator::ssl_chain_file") != "" %>
|
<%# scope.lookupvar returns nil for an undefined variable in puppet 4 -%>
|
||||||
|
<%# scope.lookupvar returns :undef for an undefined variable in puppet 3 -%>
|
||||||
|
<% unless ['', nil, :undef].include?(scope.lookupvar("phabricator::ssl_chain_file")) %>
|
||||||
SSLCertificateChainFile <%= scope.lookupvar("phabricator::ssl_chain_file") %>
|
SSLCertificateChainFile <%= scope.lookupvar("phabricator::ssl_chain_file") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user