Skip to content

Commit

Permalink
Merge pull request voxpupuli#28 from liamjbennett/master
Browse files Browse the repository at this point in the history
updating Gemfile, Rakefile, fixing lint and fixing tests
  • Loading branch information
Liam Bennett committed Jun 5, 2014
2 parents cf819b1 + dca178d commit c1ea807
Show file tree
Hide file tree
Showing 16 changed files with 83 additions and 26 deletions.
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.*.sw?
pkg
spec/fixtures
.rspec_system
.vagrant
*.iml
Gemfile.lock
/.idea/*
.idea/
.bundle/
29 changes: 18 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# A sample Gemfile
source "http://rubygems.org"

gem 'puppet-lint'
gem 'test-unit'
gem 'rake'
gem 'rspec', '2.13.0'
gem 'rspec-core', '2.13.1'
gem 'rspec-expectations', '2.13.0'
gem 'rspec-mocks', '2.13.1'
gem 'puppet', '3.2.1'
gem 'rspec-puppet', '0.1.6'
gem 'puppetlabs_spec_helper', '0.4.1'
group :test do
gem "rake"
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.4.0'
gem "puppet-lint"
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppet-syntax"
gem "puppetlabs_spec_helper"
gem "rspec", "2.99.0"
end

group :development do
gem "travis"
gem "travis-lint"
gem "beaker"
gem "beaker-rspec"
gem "vagrant-wrapper"
gem "puppet-blacksmith"
gem "guard-rake"
end
43 changes: 40 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'

# These two gems aren't always present, for instance
# on Travis with --without development
begin
require 'puppet_blacksmith/rake_tasks'
rescue LoadError
end

PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.send("disable_documentation")
PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
PuppetLint.configuration.fail_on_warnings = true

# Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
# http://puppet-lint.com/checks/class_parameter_defaults/
PuppetLint.configuration.send('disable_class_parameter_defaults')
# http://puppet-lint.com/checks/class_inherits_from_params_class/
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
# http://puppet-lint.com/checks/quoted_booleans/
PuppetLint.configuration.send('disable_quoted_booleans')

exclude_paths = [
"pkg/**/*",
"vendor/**/*",
"spec/**/*",
]
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths

desc "Run acceptance tests"
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end

desc "Run syntax, lint, and spec tests."
task :test => [
:syntax,
:lint,
:spec,
]
1 change: 1 addition & 0 deletions manifests/createpath.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
define iis::createpath($site_path = undef) {
include 'iis::param::powershell'

Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
class iis {
iis::manage_app_pool {'www.internalapi.co.uk':
enable_32_bit => true,
Expand Down
1 change: 1 addition & 0 deletions manifests/manage_app_pool.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
define iis::manage_app_pool($app_pool_name = $title, $enable_32_bit = false, $managed_runtime_version = 'v4.0', $managed_pipeline_mode = 'Integrated', $ensure = 'present') {

validate_bool($enable_32_bit)
Expand Down
1 change: 1 addition & 0 deletions manifests/manage_binding.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
define iis::manage_binding($site_name, $protocol, $port, $host_header = '', $ip_address = '*', $certificate_thumbprint = '', $ensure = 'present') {
include 'iis::param::powershell'

Expand Down
1 change: 1 addition & 0 deletions manifests/manage_site.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
define iis::manage_site($site_path, $app_pool, $host_header = '', $site_name = $title, $port = '80', $ip_address = '*', $ensure = 'present', $ssl = 'false') {
include 'iis::param::powershell'

Expand Down
1 change: 1 addition & 0 deletions manifests/manage_site_state.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
define iis::manage_site_state($site_name, $ensure = 'running') {
include 'iis::param::powershell'

Expand Down
1 change: 1 addition & 0 deletions manifests/manage_virtual_application.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
define iis::manage_virtual_application($site_name, $site_path, $app_pool, $virtual_application_name = $title, $ensure = 'present') {
include 'iis::param::powershell'

Expand Down
1 change: 1 addition & 0 deletions manifests/param/powershell.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#
class iis::param::powershell {
$executable = 'powershell.exe'
$exec_policy = '-ExecutionPolicy RemoteSigned'
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/manage_app_pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
let(:title) { 'myAppPool.example.com' }
let(:params) { { :enable_32_bit => true, :managed_runtime_version => 'v4.0' } }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('Create-myAppPool.example.com').with( {
:command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\"\"",
Expand All @@ -30,7 +30,7 @@
describe 'when managing the iis application pool without passing parameters' do
let(:title) { 'myAppPool.example.com' }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('Create-myAppPool.example.com').with( {
:command => "#{powershell} -Command \"Import-Module WebAdministration; New-Item \\\"IIS:\\AppPools\\myAppPool.example.com\\\"\"",
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/manage_binding_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:port => '80',
} }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('CreateBinding-myWebSite-port-80').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; New-WebBinding -Name \\\"myWebSite\\\" -Port 80 -Protocol \\\"http\\\" -HostHeader \\\"myHost.example.com\\\" -IPAddress \\\"*\\\"\"",
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/manage_site_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:site_path => 'C:\inetpub\wwwroot\myWebSite',
} }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('CreateSite-myWebSite').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; $id = (Get-WebSite | foreach {$_.id} | sort -Descending | select -first 1) + 1; New-WebSite -Name \\\"myWebSite\\\" -Port 80 -IP * -HostHeader \\\"myHost.example.com\\\" -PhysicalPath \\\"C:\\inetpub\\wwwroot\\myWebSite\\\" -ApplicationPool \\\"myAppPool.example.com\\\" -Ssl:$false -ID $id \"",
Expand Down Expand Up @@ -40,7 +40,7 @@
:ensure => 'present',
}}

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('CreateSite-myWebSite').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; $id = (Get-WebSite | foreach {$_.id} | sort -Descending | select -first 1) + 1; New-WebSite -Name \\\"myWebSite\\\" -Port 1080 -IP 127.0.0.1 -HostHeader \\\"myHost.example.com\\\" -PhysicalPath \\\"C:\\inetpub\\wwwroot\\path\\\" -ApplicationPool \\\"myAppPool.example.com\\\" -Ssl:$false -ID $id \"",
Expand Down
8 changes: 4 additions & 4 deletions spec/defines/manage_site_state_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:ensure => 'running',
} }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('StartSite-DefaultWebsite').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; Start-Website -Name \\\"DefaultWebsite\\\"\"",
Expand All @@ -25,7 +25,7 @@
:ensure => 'true',
} }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('StartSite-DefaultWebsite').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; Start-Website -Name \\\"DefaultWebsite\\\"\"",
Expand All @@ -40,7 +40,7 @@
:ensure => 'stopped',
} }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('StopSite-DefaultWebsite').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; Stop-Website -Name \\\"DefaultWebsite\\\"\"",
Expand All @@ -55,7 +55,7 @@
:ensure => 'false',
} }

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('StopSite-DefaultWebsite').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; Stop-Website -Name \\\"DefaultWebsite\\\"\"",
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/manage_virtual_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:app_pool => 'myAppPool.example.com',
}}

it { should include_class('iis::param::powershell') }
it { should contain_class('iis::param::powershell') }

it { should contain_exec('CreateVirtualApplication-myWebSite-mySite').with({
'command' => "#{powershell} -Command \"Import-Module WebAdministration; New-WebApplication -Name mySite -Site myWebSite -PhysicalPath C:\\inetpub\\wwwroot\\myHost -ApplicationPool myAppPool.example.com\"",
Expand Down

0 comments on commit c1ea807

Please sign in to comment.