From 08b457f75279927d4a023d5d73e2d78aa18fdf9a Mon Sep 17 00:00:00 2001 From: Patrick Schaumburg Date: Mon, 30 Mar 2020 10:28:43 +0200 Subject: add existing examples to code Signed-off-by: Patrick Schaumburg --- lib/chef/resource/windows_firewall_rule.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'lib/chef') 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, -- cgit v1.2.1