Fix filter with a specified source
This commit is contained in:
1 parent
ceff3a4ed5
commit
1f2c9a8e8e
2 files changed
+6
-2
No files matched your search
+4
-1
@@ -92,7 +92,10 @@ define fail2ban::filter (
|
|||||||
|
|
||||||
$manage_file_content = $filtertemplate ? {
|
$manage_file_content = $filtertemplate ? {
|
||||||
'' => undef,
|
'' => undef,
|
||||||
default => template($filtertemplate),
|
default => $filtersource ? {
|
||||||
|
'' => template($filtertemplate),
|
||||||
|
default => undef,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${real_filtername}.local":
|
file { "${real_filtername}.local":
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ b = 2
|
|||||||
not c
|
not c
|
||||||
"
|
"
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_file('sample2.local').with_path('/etc/fail2ban/filter.d/sample2.local').with_content(expected) }
|
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 }
|
it { should contain_file('sample2.local').without_source }
|
||||||
end
|
end
|
||||||
@@ -75,6 +75,7 @@ not c
|
|||||||
end
|
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_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 }
|
it { should contain_file('sample3.local').without_template }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user