cookbook 'iis-lb', '~> 0.2.5'
iis-lb (8) Versions 0.2.5 Follow5
Installs/Configures IIS as a web load-balancer
cookbook 'iis-lb', '~> 0.2.5', :supermarket
knife supermarket install iis-lb
knife supermarket download iis-lb
iis-lb
This cookbook configures IIS as a simple web load-balancer by creating an IIS Server Farm. It also allows you to add servers to the farm by passing a node['iis-lb']['members']
hash.
DISCLAIMER
This cookbook helps demonstrate the wrapper-cookbook pattern
, attribute precedence
and search
in Chef Essentials training for Windows. This cookbook does NOT describe the definitive pattern for configuring IIS as a web load-balancer. Use at your own risk.
Platforms
This cookbook was tested on:
- Windows Server 2012 R2
It may (or may not) work on other Windows Server variants.
Usage
Specify your servers by setting the node['iis-lb']['members']
attribute hash in a wrapper cookbook. Then include the 'iis-lb::default'
recipe. This creates the Server Farm and adds your servers to it. For example:
# contents of chef-repo/cookbooks/my-wrapper-cookbook/recipes/default.rb
node.default['iis-lb']['members'] = [
{
'address' => 'localhost',
'weight' => 100,
'port' => 4000,
'ssl_port' => 4000
},
{
'address' => '127.0.0.1',
'weight' => 100,
'port' => 4001,
'ssl_port' => 4001
}]
include_recipe 'iis-lb::default'
Recipes
default
Installs the necessary components and create an IIS Server Farm myServerFarm
. This also adds servers to the Server Farm, based on the node['iis-lb']['members']
attribute hash.
_arr
Installs Application Request Router (ARR) 3.0 using Microsoft Web Platform Installer (webpi). This recipe is used by the resources in this cookbook.
Resources
iis_lb_farm
Creates an IIS Server Farm, sets its load-balancing algorithm and creates the necessary URL rewrite rules.
Actions
default
= :create
-
:create
- creates the server farm, load balancing algorithm and the URL rewrite rules. -
:remove
- removes the server farm with all its servers and URL rewrite rules.
Attribute Parameters
-
farm_name
- the name of the Server Farm. -
algorithm
- sets the Server Farm's Load Balancing algorithm. Default isWeightedRoundRobin
, Valid Values are: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash'
Example
# creates a Server Farm called SuperDuperFarm with lb algorithm LeastRequests
iis_lb_farm 'SuperDuperFarm' do
action :create
algorithm 'LeastRequests'
end
# removes a Server Farm called SuperDuperFarm
iis_lb_farm 'SuperDuperFarm' do
action :remove
end
iis_lb_server
Adds a server to a Server Farm.
Actions
default
= :add
-
:add
- adds a server to a server farm. If the specified farm does not exist, it is created automagically. If the farm is not specified then servers get added to a newmyServerFarm
. -
:remove
- removes a server from a server farm. If the farm is not specified, the server is removed frommyServerFarm
.
Attribute Parameters
-
server_address
- name attribute. Specifies IP or FQDN of a server to add to the farm. -
farm
- The name of the IIS Server Farm to add the server to. Default ismyServerFarm
-
weight
- Relative weight for Weighted Round Robin load distribution. Default is100
-
port
- HTTP port that the server is listening on. Default is80
-
ssl_port
- HTTPS port that the server is listening on. Default is443
Example
# adds server webserver.superdomain.internal, with http/https ports of 8080/4443, to SuperDuperFarm
iis_lb_server 'webserver.superdomain.internal' do
port 8080
ssl_port 4443
farm 'SuperDuperFarm'
action :add
end
# removes the Server Farm called SuperDuperFarm
iis_lb_server 'webserver.superdomain.internal' do
farm 'SuperDuperFarm'
action :remove
end
Dependencies
This cookbook depends on the following Community Cookbooks:
- webpi
- iis
Dependent cookbooks
webpi = 3.0.0 |
iis >= 0.0.0 |
compat_resource >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.2.5 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.5 failed this metric
FC064: Ensure issues_url is set in metadata: iis-lb/metadata.rb:1
FC065: Ensure source_url is set in metadata: iis-lb/metadata.rb:1
FC066: Ensure chef_version is set in metadata: iis-lb/metadata.rb:1
FC069: Ensure standardized license defined in metadata: iis-lb/metadata.rb:1
FC118: Resource property setting name_attribute vs. name_property: iis-lb/resources/farm.rb:1
FC118: Resource property setting name_attribute vs. name_property: iis-lb/resources/server.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.5 passed this metric
Testing File Metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.5 failed this metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.5 failed this metric
FC064: Ensure issues_url is set in metadata: iis-lb/metadata.rb:1
FC065: Ensure source_url is set in metadata: iis-lb/metadata.rb:1
FC066: Ensure chef_version is set in metadata: iis-lb/metadata.rb:1
FC069: Ensure standardized license defined in metadata: iis-lb/metadata.rb:1
FC118: Resource property setting name_attribute vs. name_property: iis-lb/resources/farm.rb:1
FC118: Resource property setting name_attribute vs. name_property: iis-lb/resources/server.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.5 passed this metric
Testing File Metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.5 failed this metric
FC065: Ensure source_url is set in metadata: iis-lb/metadata.rb:1
FC066: Ensure chef_version is set in metadata: iis-lb/metadata.rb:1
FC069: Ensure standardized license defined in metadata: iis-lb/metadata.rb:1
FC118: Resource property setting name_attribute vs. name_property: iis-lb/resources/farm.rb:1
FC118: Resource property setting name_attribute vs. name_property: iis-lb/resources/server.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.2.5 passed this metric
Testing File Metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.5 failed this metric
0.2.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number