Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d71e25c0ae | ||
|
|
be537ee29b | ||
|
|
8e00da08a5 | ||
|
|
582b6a1788 | ||
|
|
344ed1dbbb | ||
|
|
1f2c9a8e8e | ||
|
|
ceff3a4ed5 | ||
|
|
32fcff31f8 | ||
|
|
2c4731e5c9 | ||
|
|
5eba942fcf |
33
.travis.yml
33
.travis.yml
@@ -1,22 +1,33 @@
|
||||
---
|
||||
language: ruby
|
||||
rvm:
|
||||
- 1.8.7
|
||||
- 1.9.3
|
||||
script:
|
||||
- "rake spec SPEC_OPTS='--format documentation'"
|
||||
- 2.0.0
|
||||
script: "bundle exec rake spec SPEC_OPTS='--format documentation'"
|
||||
branches:
|
||||
only:
|
||||
master
|
||||
env:
|
||||
- PUPPET_VERSION="~> 2.6.0"
|
||||
- PUPPET_VERSION="~> 2.7.0"
|
||||
- PUPPET_VERSION="~> 3.0.0"
|
||||
- PUPPET_VERSION="~> 3.1.0"
|
||||
matrix:
|
||||
- PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.0.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.1.0"
|
||||
- PUPPET_GEM_VERSION="~> 3.2.0"
|
||||
matrix:
|
||||
allow_failures:
|
||||
# - rvm: ruby-head
|
||||
exclude:
|
||||
- rvm: 1.8.7
|
||||
env: PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- rvm: 1.9.3
|
||||
env: PUPPET_VERSION="~> 2.6.0"
|
||||
gemfile: .gemfile
|
||||
- rvm: 1.9.3
|
||||
env: PUPPET_VERSION="~> 2.7.0"
|
||||
gemfile: .gemfile
|
||||
env: PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- rvm: 2.0.0
|
||||
env: PUPPET_GEM_VERSION="~> 2.7.0"
|
||||
- rvm: 2.0.0
|
||||
env: PUPPET_GEM_VERSION="~> 3.0.0"
|
||||
- rvm: 2.0.0
|
||||
env: PUPPET_GEM_VERSION="~> 3.1.0"
|
||||
gemfile: .gemfile
|
||||
notifications:
|
||||
email:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name 'netmanagers-fail2ban'
|
||||
version '1.2.0'
|
||||
version '1.2.1'
|
||||
author 'Javier Bertoli'
|
||||
license 'Apache2'
|
||||
project_page 'http://www.netmanagers.com.ar'
|
||||
|
||||
@@ -92,7 +92,10 @@ define fail2ban::filter (
|
||||
|
||||
$manage_file_content = $filtertemplate ? {
|
||||
'' => undef,
|
||||
default => template($filtertemplate),
|
||||
default => $filtersource ? {
|
||||
'' => template($filtertemplate),
|
||||
default => undef,
|
||||
}
|
||||
}
|
||||
|
||||
file { "${real_filtername}.local":
|
||||
|
||||
@@ -29,8 +29,9 @@ class fail2ban::params {
|
||||
}
|
||||
|
||||
$process = $::operatingsystem ? {
|
||||
/(?i:Debian|Ubuntu|Mint)/ => 'fail2ban-server',
|
||||
default => 'fail2ban',
|
||||
/(?i:Debian|Ubuntu|Mint)/ => 'fail2ban-server',
|
||||
/(?i:RedHat|Centos|Scientific|Fedora|OracleLinux)/ => 'fail2ban-server',
|
||||
default => 'fail2ban',
|
||||
}
|
||||
|
||||
$process_args = $::operatingsystem ? {
|
||||
|
||||
@@ -97,12 +97,10 @@ enabled = true/) }
|
||||
describe 'Test customizations - template' do
|
||||
let(:params) { {:template => "fail2ban/spec.erb" , :options => { 'opt_a' => 'value_a' } } }
|
||||
it 'should generate a valid template' do
|
||||
content = catalogue.resource('file', 'fail2ban.local').send(:parameters)[:content]
|
||||
content.should match "fqdn: rspec.example42.com"
|
||||
should contain_file('fail2ban.local').with_content(/fqdn: rspec.example42.com/)
|
||||
end
|
||||
it 'should generate a template that uses custom options' do
|
||||
content = catalogue.resource('file', 'fail2ban.local').send(:parameters)[:content]
|
||||
content.should match "value_a"
|
||||
should contain_file('fail2ban.local').with_content(/value_a/)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -136,8 +134,7 @@ enabled = true/) }
|
||||
}
|
||||
end
|
||||
it 'should not automatically restart the service, when service_autorestart => false' do
|
||||
content = catalogue.resource('file', 'fail2ban.local').send(:parameters)[:notify]
|
||||
content.should be_nil
|
||||
should contain_file('fail2ban.local').with_notify(nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ b = 2
|
||||
not c
|
||||
"
|
||||
end
|
||||
|
||||
|
||||
it { should contain_file('sample2.local').with_path('/etc/fail2ban/filter.d/sample2.local').with_content(expected) }
|
||||
it { should contain_file('sample2.local').without_source }
|
||||
end
|
||||
@@ -75,6 +75,7 @@ not c
|
||||
end
|
||||
|
||||
it { should contain_file('sample3.local').with_path('/etc/fail2ban/filter.d/sample3.local').with_source('puppet:///some/path/to/source') }
|
||||
it { should contain_file('sample3.local').with_content(nil) }
|
||||
it { should contain_file('sample3.local').without_template }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user