Browse Source

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
Colleen Murphy 3 years ago
parent
commit
17430b7507

+ 2
- 1
.gitignore View File

@@ -1 +1,2 @@
1
-.pkg
1
+Gemfile.lock
2
+.bundled_gems/

+ 30
- 0
Gemfile View File

@@ -0,0 +1,30 @@
1
+source 'https://rubygems.org'
2
+
3
+group :development, :test do
4
+  gem 'puppetlabs_spec_helper', :require => false
5
+
6
+  gem 'metadata-json-lint'
7
+  # This is nice and all, but let's not worry about it until we've actually
8
+  # got puppet 4.x sorted
9
+  # gem 'puppet-lint-param-docs'
10
+  gem 'puppet-lint-absolute_classname-check'
11
+  gem 'puppet-lint-absolute_template_path'
12
+  gem 'puppet-lint-trailing_newline-check'
13
+
14
+  # Puppet 4.x related lint checks
15
+  gem 'puppet-lint-unquoted_string-check'
16
+  gem 'puppet-lint-empty_string-check'
17
+  gem 'puppet-lint-leading_zero-check'
18
+  gem 'puppet-lint-variable_contains_upcase'
19
+  gem 'puppet-lint-spaceship_operator_without_tag-check'
20
+  gem 'puppet-lint-undef_in_function-check'
21
+
22
+  if puppetversion = ENV['PUPPET_GEM_VERSION']
23
+    gem 'puppet', puppetversion, :require => false
24
+  else
25
+    gem 'puppet', '~> 3.0', :require => false
26
+  end
27
+
28
+end
29
+
30
+# vim:ft=ruby

+ 1
- 1
manifests/dev.pp View File

@@ -12,7 +12,7 @@
12 12
 # Sample Usage:
13 13
 #
14 14
 class httpd::dev {
15
-  include httpd::params
15
+  include ::httpd::params
16 16
 
17 17
   package { 'apache_dev_package':
18 18
     ensure => installed,

+ 1
- 1
manifests/init.pp View File

@@ -13,7 +13,7 @@
13 13
 # Sample Usage:
14 14
 #
15 15
 class httpd {
16
-  include httpd::params
16
+  include ::httpd::params
17 17
 
18 18
   package { 'httpd':
19 19
     ensure => installed,

+ 1
- 1
manifests/mod/python.pp View File

@@ -12,7 +12,7 @@
12 12
 # Sample Usage:
13 13
 #
14 14
 class httpd::mod::python {
15
-  include httpd
15
+  include ::httpd
16 16
 
17 17
   package { 'mod_python_package':
18 18
     ensure  => installed,

+ 1
- 1
manifests/mod/wsgi.pp View File

@@ -12,7 +12,7 @@
12 12
 # Sample Usage:
13 13
 #
14 14
 class httpd::mod::wsgi {
15
-  include httpd
15
+  include ::httpd
16 16
 
17 17
   package { 'mod_wsgi_package':
18 18
     ensure  => installed,

+ 2
- 2
manifests/params.pp View File

@@ -24,8 +24,8 @@ class httpd::params {
24 24
   $ssl           = true
25 25
   $template      = 'httpd/vhost-default.conf.erb'
26 26
   $priority      = '25'
27
-  $servername    = ''
28
-  $serveraliases = ''
27
+  $servername    = undef
28
+  $serveraliases = undef
29 29
   $auth          = false
30 30
   $redirect_ssl  = false
31 31
   $options       = 'Indexes FollowSymLinks MultiViews'

+ 1
- 1
manifests/php.pp View File

@@ -13,7 +13,7 @@
13 13
 # Sample Usage:
14 14
 #
15 15
 class httpd::php {
16
-  include httpd::params
16
+  include ::httpd::params
17 17
 
18 18
   package { 'apache_php_package':
19 19
     ensure => present,

+ 2
- 2
manifests/python.pp View File

@@ -13,8 +13,8 @@
13 13
 # Sample Usage:
14 14
 #
15 15
 class httpd::python {
16
-  include httpd::params
17
-  include httpd
16
+  include ::httpd::params
17
+  include ::httpd
18 18
 
19 19
   package { 'apache_python_package':
20 20
     ensure => present,

+ 1
- 1
manifests/ssl.pp View File

@@ -14,7 +14,7 @@
14 14
 #
15 15
 class httpd::ssl {
16 16
 
17
-  include httpd
17
+  include ::httpd
18 18
 
19 19
   case $::operatingsystem {
20 20
     'centos', 'fedora', 'redhat', 'scientific': {

+ 3
- 3
manifests/vhost.pp View File

@@ -44,16 +44,16 @@ define httpd::vhost(
44 44
     $vhost_name         = $httpd::params::vhost_name
45 45
   ) {
46 46
 
47
-  include httpd
47
+  include ::httpd
48 48
 
49
-  if $servername == '' {
49
+  if $servername == undef {
50 50
     $srvname = $name
51 51
   } else {
52 52
     $srvname = $servername
53 53
   }
54 54
 
55 55
   if $ssl == true {
56
-    include httpd::ssl
56
+    include ::httpd::ssl
57 57
   }
58 58
 
59 59
   # Since the template will use auth, redirect to https requires mod_rewrite

+ 5
- 5
manifests/vhost/proxy.pp View File

@@ -23,24 +23,24 @@ define httpd::vhost::proxy (
23 23
     $dest,
24 24
     $priority      = '10',
25 25
     $template      = 'httpd/vhost-proxy.conf.erb',
26
-    $servername    = '',
27
-    $serveraliases = '',
26
+    $servername    = undef,
27
+    $serveraliases = undef,
28 28
     $ssl           = false,
29 29
     $vhost_name    = '*'
30 30
   ) {
31 31
 
32
-  include httpd
32
+  include ::httpd
33 33
 
34 34
   $apache_name = $httpd::params::apache_name
35 35
   $ssl_path = $httpd::params::ssl_path
36
-  if $servername == '' {
36
+  if $servername == undef {
37 37
     $srvname = $name
38 38
   } else {
39 39
     $srvname = $servername
40 40
   }
41 41
 
42 42
   if $ssl == true {
43
-    include httpd::ssl
43
+    include ::httpd::ssl
44 44
   }
45 45
 
46 46
   file { "${priority}-${name}":

+ 2
- 2
manifests/vhost/redirect.pp View File

@@ -21,12 +21,12 @@ define httpd::vhost::redirect (
21 21
     $port,
22 22
     $dest,
23 23
     $priority      = '10',
24
-    $serveraliases = '',
24
+    $serveraliases = undef,
25 25
     $template      = 'httpd/vhost-redirect.conf.erb',
26 26
     $vhost_name    = '*'
27 27
   ) {
28 28
 
29
-  include httpd
29
+  include ::httpd
30 30
 
31 31
   $srvname = $name
32 32
 

+ 1
- 1
templates/vhost-default.conf.erb View File

@@ -8,7 +8,7 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
8 8
   ServerName <%= @srvname %>
9 9
 <% if @serveraliases.is_a? Array -%>
10 10
 <% @serveraliases.each do |name| -%><%= "  ServerAlias #{name}\n" %><% end -%>
11
-<% elsif @serveraliases != '' -%>
11
+<% elsif @serveraliases != nil -%>
12 12
 <%= "  ServerAlias #{@serveraliases}" -%>
13 13
 <% end -%>
14 14
   DocumentRoot <%= @docroot %>

+ 1
- 1
templates/vhost-proxy.conf.erb View File

@@ -8,7 +8,7 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
8 8
   ServerName <%= @srvname %>
9 9
 <% if @serveraliases.is_a? Array %>
10 10
 <% @serveraliases.each do |name| %><%= "  ServerAlias #{name}\n" %><% end %>
11
-<% elsif @serveraliases != '' %>
11
+<% elsif @serveraliases != nil %>
12 12
 <%= "  ServerAlias #{@serveraliases}" %>
13 13
 <% end %>
14 14
    ProxyRequests Off

+ 1
- 1
templates/vhost-redirect.conf.erb View File

@@ -3,7 +3,7 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
3 3
   ServerName <%= @srvname %>
4 4
 <% if @serveraliases.is_a? Array %>
5 5
 <% @serveraliases.each do |name| %><%= "  ServerAlias #{name}\n" %><% end %>
6
-<% elsif @serveraliases != '' %>
6
+<% elsif @serveraliases != nil %>
7 7
 <%= "  ServerAlias #{@serveraliases}" %>
8 8
 <% end %>
9 9
   Redirect / <%= @dest %>/

Loading…
Cancel
Save