summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Schaumburg <pschaumburg@tecracer.de>2020-03-30 10:28:43 +0200
committerPatrick Schaumburg <pschaumburg@tecracer.de>2020-03-30 10:28:43 +0200
commit08b457f75279927d4a023d5d73e2d78aa18fdf9a (patch)
tree6be8c47c0fbc0fcb96afa824e58a58dfdb4bdde8
parent64ee547b9f8aa9c9508db42a2ca19e7de54c3ee5 (diff)
downloadchef-08b457f75279927d4a023d5d73e2d78aa18fdf9a.tar.gz
add existing examples to code
Signed-off-by: Patrick Schaumburg <pschaumburg@tecracer.de>
-rw-r--r--lib/chef/resource/windows_firewall_rule.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/chef/resource/windows_firewall_rule.rb b/lib/chef/resource/windows_firewall_rule.rb
index 1777ccad37..1f4dac4937 100644
--- a/lib/chef/resource/windows_firewall_rule.rb
+++ b/lib/chef/resource/windows_firewall_rule.rb
@@ -28,6 +28,34 @@ class Chef
description "Use the windows_firewall_rule resource to create, change or remove windows firewall rules."
introduced "14.7"
+ examples <<~DOC
+ Allowing port 80 access
+ ```ruby
+ windows_firewall_rule 'IIS' do
+ local_port '80'
+ protocol 'TCP'
+ firewall_action :allow
+ end
+ ```
+
+ Blocking WinRM over HTTP on a particular IP
+ ```ruby
+ windows_firewall_rule 'Disable WinRM over HTTP' do
+ local_port '5985'
+ protocol 'TCP'
+ firewall_action :block
+ local_address '192.168.1.1'
+ end
+ ```
+
+ Deleting an existing rule
+ ```ruby
+ windows_firewall_rule 'Remove the SSH rule' do
+ rule_name 'ssh'
+ action :delete
+ end
+ ```
+ DOC
property :rule_name, String,
name_property: true,