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 errors caught by the puppet-lint-unquoted_string-check and puppet-lint-absolute_classname-check gems. Change-Id: I9d74d25d2f2c95ec52a6db3bf070903240e1b933
This commit is contained in:
parent
eedc2abb66
commit
17430b7507
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
||||
.pkg
|
||||
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
|
@ -12,7 +12,7 @@
|
||||
# Sample Usage:
|
||||
#
|
||||
class httpd::dev {
|
||||
include httpd::params
|
||||
include ::httpd::params
|
||||
|
||||
package { 'apache_dev_package':
|
||||
ensure => installed,
|
||||
|
@ -13,7 +13,7 @@
|
||||
# Sample Usage:
|
||||
#
|
||||
class httpd {
|
||||
include httpd::params
|
||||
include ::httpd::params
|
||||
|
||||
package { 'httpd':
|
||||
ensure => installed,
|
||||
|
@ -12,7 +12,7 @@
|
||||
# Sample Usage:
|
||||
#
|
||||
class httpd::mod::python {
|
||||
include httpd
|
||||
include ::httpd
|
||||
|
||||
package { 'mod_python_package':
|
||||
ensure => installed,
|
||||
|
@ -12,7 +12,7 @@
|
||||
# Sample Usage:
|
||||
#
|
||||
class httpd::mod::wsgi {
|
||||
include httpd
|
||||
include ::httpd
|
||||
|
||||
package { 'mod_wsgi_package':
|
||||
ensure => installed,
|
||||
|
@ -24,8 +24,8 @@ class httpd::params {
|
||||
$ssl = true
|
||||
$template = 'httpd/vhost-default.conf.erb'
|
||||
$priority = '25'
|
||||
$servername = ''
|
||||
$serveraliases = ''
|
||||
$servername = undef
|
||||
$serveraliases = undef
|
||||
$auth = false
|
||||
$redirect_ssl = false
|
||||
$options = 'Indexes FollowSymLinks MultiViews'
|
||||
|
@ -13,7 +13,7 @@
|
||||
# Sample Usage:
|
||||
#
|
||||
class httpd::php {
|
||||
include httpd::params
|
||||
include ::httpd::params
|
||||
|
||||
package { 'apache_php_package':
|
||||
ensure => present,
|
||||
|
@ -13,8 +13,8 @@
|
||||
# Sample Usage:
|
||||
#
|
||||
class httpd::python {
|
||||
include httpd::params
|
||||
include httpd
|
||||
include ::httpd::params
|
||||
include ::httpd
|
||||
|
||||
package { 'apache_python_package':
|
||||
ensure => present,
|
||||
|
@ -14,7 +14,7 @@
|
||||
#
|
||||
class httpd::ssl {
|
||||
|
||||
include httpd
|
||||
include ::httpd
|
||||
|
||||
case $::operatingsystem {
|
||||
'centos', 'fedora', 'redhat', 'scientific': {
|
||||
|
@ -44,16 +44,16 @@ define httpd::vhost(
|
||||
$vhost_name = $httpd::params::vhost_name
|
||||
) {
|
||||
|
||||
include httpd
|
||||
include ::httpd
|
||||
|
||||
if $servername == '' {
|
||||
if $servername == undef {
|
||||
$srvname = $name
|
||||
} else {
|
||||
$srvname = $servername
|
||||
}
|
||||
|
||||
if $ssl == true {
|
||||
include httpd::ssl
|
||||
include ::httpd::ssl
|
||||
}
|
||||
|
||||
# Since the template will use auth, redirect to https requires mod_rewrite
|
||||
|
@ -23,24 +23,24 @@ define httpd::vhost::proxy (
|
||||
$dest,
|
||||
$priority = '10',
|
||||
$template = 'httpd/vhost-proxy.conf.erb',
|
||||
$servername = '',
|
||||
$serveraliases = '',
|
||||
$servername = undef,
|
||||
$serveraliases = undef,
|
||||
$ssl = false,
|
||||
$vhost_name = '*'
|
||||
) {
|
||||
|
||||
include httpd
|
||||
include ::httpd
|
||||
|
||||
$apache_name = $httpd::params::apache_name
|
||||
$ssl_path = $httpd::params::ssl_path
|
||||
if $servername == '' {
|
||||
if $servername == undef {
|
||||
$srvname = $name
|
||||
} else {
|
||||
$srvname = $servername
|
||||
}
|
||||
|
||||
if $ssl == true {
|
||||
include httpd::ssl
|
||||
include ::httpd::ssl
|
||||
}
|
||||
|
||||
file { "${priority}-${name}":
|
||||
|
@ -21,12 +21,12 @@ define httpd::vhost::redirect (
|
||||
$port,
|
||||
$dest,
|
||||
$priority = '10',
|
||||
$serveraliases = '',
|
||||
$serveraliases = undef,
|
||||
$template = 'httpd/vhost-redirect.conf.erb',
|
||||
$vhost_name = '*'
|
||||
) {
|
||||
|
||||
include httpd
|
||||
include ::httpd
|
||||
|
||||
$srvname = $name
|
||||
|
||||
|
@ -8,7 +8,7 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
||||
ServerName <%= @srvname %>
|
||||
<% if @serveraliases.is_a? Array -%>
|
||||
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
||||
<% elsif @serveraliases != '' -%>
|
||||
<% elsif @serveraliases != nil -%>
|
||||
<%= " ServerAlias #{@serveraliases}" -%>
|
||||
<% end -%>
|
||||
DocumentRoot <%= @docroot %>
|
||||
|
@ -8,7 +8,7 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
||||
ServerName <%= @srvname %>
|
||||
<% if @serveraliases.is_a? Array %>
|
||||
<% @serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
|
||||
<% elsif @serveraliases != '' %>
|
||||
<% elsif @serveraliases != nil %>
|
||||
<%= " ServerAlias #{@serveraliases}" %>
|
||||
<% end %>
|
||||
ProxyRequests Off
|
||||
|
@ -3,7 +3,7 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
||||
ServerName <%= @srvname %>
|
||||
<% if @serveraliases.is_a? Array %>
|
||||
<% @serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
|
||||
<% elsif @serveraliases != '' %>
|
||||
<% elsif @serveraliases != nil %>
|
||||
<%= " ServerAlias #{@serveraliases}" %>
|
||||
<% end %>
|
||||
Redirect / <%= @dest %>/
|
||||
|
Loading…
x
Reference in New Issue
Block a user