Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple data types #140

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Boolean $service_enable = true,

String[1] $action = 'action_mb',
Integer[0] $bantime = 432000,
Variant[Integer[0], String[1]] $bantime = 432000,
String[1] $email = "fail2ban@${facts['networking']['domain']}",
String[1] $sender = "fail2ban@${facts['networking']['fqdn']}",
String[1] $iptables_chain = 'INPUT',
Expand Down
15 changes: 15 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@
end
end

context 'when bantime provided as string' do
let(:params) do
{
config_file_template: config_file_template,
bantime: '12h'
}
end

it do
is_expected.to contain_file('fail2ban.conf').with_content(
%r{^bantime = 12h$}
)
end
end

context 'when custom banaction is provided' do
let(:params) do
{
Expand Down