Skip to content

Commit

Permalink
Merge f49cee6 into 8a956af
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjfisher committed Jul 30, 2020
2 parents 8a956af + f49cee6 commit 143759a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions manifests/exception.pp
Expand Up @@ -82,12 +82,12 @@
Enum['allow', 'block'] $action = 'allow',
Boolean $enabled = true,
Optional[Enum['TCP', 'UDP', 'ICMPv4', 'ICMPv6']] $protocol = undef,
Optional[Variant[Integer[1, 65535], Enum['any']]] $local_port = undef,
Optional[Variant[Integer[1, 65535], Enum['any']]] $remote_port = undef,
Optional[Variant[Stdlib::Port, Enum['any']]] $local_port = undef,
Optional[Variant[Stdlib::Port, Enum['any']]] $remote_port = undef,
Optional[String] $remote_ip = undef,
Optional[String] $program = undef,
Optional[Stdlib::Windowspath] $program = undef,
String[0, 255] $display_name = '',
String $description = '',
String[0, 255] $description = '',
Boolean $allow_edge_traversal = false,
) {
# Check if we're allowing a program or port/protocol and validate accordingly
Expand Down Expand Up @@ -124,11 +124,8 @@
} else {
$fw_command = 'allowedprogram'
$allow_context = "program=\"${program}\""
validate_absolute_path($program)
}

validate_slength($description,255)

# Set command to check for existing rules
$netsh_exe = "${facts['os']['windows']['system32']}\\netsh.exe"
$check_rule_existance= "${netsh_exe} advfirewall firewall show rule name=\"${display_name}\""
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Expand Up @@ -4,7 +4,7 @@

# == Class: windows_firewall
#
# Module to manage the windows firewall and it's configured exceptions
# Module to manage the windows firewall and its configured exceptions
#
# === Requirements/Dependencies
#
Expand All @@ -23,7 +23,7 @@
# include ::windows_firewall
#
class windows_firewall (
String $ensure = 'running',
Stdlib::Ensure::Service $ensure = 'running',
) {
$firewall_name = 'MpsSvc'

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Expand Up @@ -21,7 +21,7 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.6.0 < 7.0.0"
"version_requirement": ">= 4.25.1 < 7.0.0"
},
{
"name": "puppetlabs/registry",
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/windows_firewall/windows_firewall_spec.rb
Expand Up @@ -88,7 +88,7 @@
it do
expect do
is_expected.to contain_registry_value('EnableFirewall')
end.to raise_error(Puppet::Error, %r{expects a String value})
end.to raise_error
end
end
end

0 comments on commit 143759a

Please sign in to comment.