summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2021-06-04 11:26:31 -0700
committerJohn McCrae <john.mccrae@progress.com>2021-06-14 19:01:11 -0700
commit62664fec91e4ff095c0d91e7684aa227701313f7 (patch)
tree6f207335ad0cfb04cd37b94f254548f67bcbc96d
parentb6c6c4e999f4c830bdf810c17ce4e8e4026d1231 (diff)
downloadchef-62664fec91e4ff095c0d91e7684aa227701313f7.tar.gz
Updated the firewall rule resource to allow for multiple remote addresses, updated the spec file to account for the change in data types
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r--lib/chef/resource/windows_firewall_rule.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb
index b675ddb366..e397a94670 100644
--- a/lib/chef/resource/windows_firewall_rule.rb
+++ b/lib/chef/resource/windows_firewall_rule.rb
@@ -43,11 +43,11 @@ class Chef
```ruby
windows_firewall_rule 'MyRule' do
- description "testing out remote address arrays"
+ description 'Testing out remote address arrays'
enabled false
local_port 1434
remote_address %w(10.17.3.101 172.7.7.53)
- protocol "TCP"
+ protocol 'TCP'
action :create
end
```
@@ -111,6 +111,7 @@ class Chef
description: "The local port the firewall rule applies to."
property :remote_address, [String, Array],
+ coerce: proc { |d| d.is_a?(String) ? d.split(/\s*,\s*/).sort : Array(d).sort.map(&:to_s) },
description: "The remote address(es) the firewall rule applies to."
property :remote_port, [String, Integer, Array],