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-absolute_classname-check and puppet-lint-empty_string-check gem as well as arrow alignment errors not caught before. The has_variable? function in the layout.html.erb template will return true whether $image is set to empty string or undef, so we change the template to look for nil so that the new default of undef will work correctly. Change-Id: I6738cfef08e0cf2faeabed469b9eff5e3c0bbb5a
This commit is contained in:
parent
189707396f
commit
dc1445d742
|
@ -0,0 +1,2 @@
|
||||||
|
Gemfile.lock
|
||||||
|
.bundled_gems/
|
|
@ -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
|
|
@ -10,7 +10,7 @@ class lodgeit {
|
||||||
|
|
||||||
include ::httpd
|
include ::httpd
|
||||||
|
|
||||||
include pip
|
include ::pip
|
||||||
httpd_mod { 'proxy':
|
httpd_mod { 'proxy':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@ define lodgeit::site(
|
||||||
$db_host='locahost',
|
$db_host='locahost',
|
||||||
$db_user=$name,
|
$db_user=$name,
|
||||||
$vhost_name="paste.${name}.org",
|
$vhost_name="paste.${name}.org",
|
||||||
$image='') {
|
$image=undef
|
||||||
|
) {
|
||||||
|
|
||||||
include ::httpd
|
include ::httpd
|
||||||
|
|
||||||
|
@ -31,7 +32,7 @@ define lodgeit::site(
|
||||||
source => '/tmp/lodgeit-main',
|
source => '/tmp/lodgeit-main',
|
||||||
}
|
}
|
||||||
|
|
||||||
if $image != '' {
|
if $image != undef {
|
||||||
file { "/srv/lodgeit/${name}/lodgeit/static/${image}":
|
file { "/srv/lodgeit/${name}/lodgeit/static/${image}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => "puppet:///modules/lodgeit/${image}",
|
source => "puppet:///modules/lodgeit/${image}",
|
||||||
|
@ -64,8 +65,8 @@ define lodgeit::site(
|
||||||
}
|
}
|
||||||
|
|
||||||
service { "${name}-paste":
|
service { "${name}-paste":
|
||||||
ensure => running,
|
ensure => running,
|
||||||
provider => upstart,
|
provider => upstart,
|
||||||
require => Class['httpd'],
|
require => Class['httpd'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<h1>
|
<h1>
|
||||||
<% if has_variable?("image") then %>
|
<% if @image != nil then %>
|
||||||
<img src="/static/<%= @image %>" style="padding-bottom: 10px; margin-left: 10px;" alt="<%= @name.capitalize %> Pastebin" />
|
<img src="/static/<%= @image %>" style="padding-bottom: 10px; margin-left: 10px;" alt="<%= @name.capitalize %> Pastebin" />
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= @name.capitalize %> Pastebin
|
<%= @name.capitalize %> Pastebin
|
||||||
|
|
Loading…
Reference in New Issue