Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

haproxy_lwrp (3) Versions 2.0.3

Installs and configures haproxy

Policyfile
Berkshelf
Knife
cookbook 'haproxy_lwrp', '~> 2.0.3', :supermarket
cookbook 'haproxy_lwrp', '~> 2.0.3'
knife supermarket install haproxy_lwrp
knife supermarket download haproxy_lwrp
README
Dependencies
Quality 17%

Description

Implementation free resource and provider to configure haproxy instances. Example below is a very rough example, you can load settings from roles, environments, data bags and or recipes themselves (like below).

Sometimes design changes, we don't want to rewrite a whole new recipe and template for each change that is not productive.

Changes

v2.0.0:

  • Add Basic LWRP

Requirements

Platform

Tested on Ubuntu 8.10 and higher.

Cookbooks:

Usage

See tests or recipe/lwrp_example.rb for working examples.

frontend_temp=Array.new  
frontend_temp << {"name" => "http-in *:80", "acl" => "acl bob-acl path_beg /status\nacl bob-acl2 path_beg /status2 if bob-acl\n", "default_backend" => "www" }  
frontend_temp << {"name" => "https-in *:443", "default_backend" => "www" }  
backend_temp=Array.new  
backend_temp << { "name" => "www", "mode" => "http", "balance" => "leastconn" , "option" => "option httpclose\noption redispatch\noption httpchk GET / HTTP/1.1\\r\\nHost: wwww\noption redispatch\n", "other" => "check", "server" => ["172.29.11.3","172.29.11.4"], "start_port" => 80, "instance_count" => 1}  
backend_temp << { "name" => "https", "mode" => "tcp", "balance" => "leastconn" , "option" => "option httpclose\noption redispatch\noption httpchk GET / HTTP/1.1\\r\\nHost: wwww\noption redispatch\n", "other" => "check", "server" => ["127.0.0.1"], "maxconn" => 2, "start_port" => 443, "instance_count" => 1}  
backend_temp << { "name" => "unicorn", "mode" => "tcp", "balance" => "leastconn" , "option" => "option httpclose\noption redispatch\noption httpchk GET / HTTP/1.1\\r\\nHost: wwww\noption redispatch\n", "other" => "check", "server" => ["127.0.0.1"], "maxconn" => 20, "start_port" => 8080, "instance_count" => 1}  
backend_temp << { "name" => "manythins", "mode" => "tcp", "balance" => "leastconn" , "option" => "option httpclose\noption redispatch\noption httpchk GET / HTTP/1.1\\r\\nHost: wwww\noption redispatch\n", "other" => "check", "server" => ["127.0.0.1"], "maxconn" => 20, "start_port" => 3000, "instance_count" => 4}  
listen_temp=Array.new  
listen_temp <<   {"name" => "fart 0.0.0.0:22002", "mode" => "http", "stats" => "stats uri /"}  
include_recipe "haproxy::install"  
include_recipe "runit"  
haproxy_lwrp_lb "adserver" do  
frontend(frontend_temp)  
backend(backend_temp)  
listen(listen_temp)  
action :create  
end  

Another example

listen_temp=Array.new  
listen_temp << { "name" => "carbon-relay-plain 0.0.0.0:2003", "mode" => "tcp", "server" => ["127.0.0.1"], "start_port" => 2031, "instance_count" => 3}
listen_temp << { "name" => "carbon-relay-pickle 0.0.0.0:2004", "mode" => "tcp", "server" => ["127.0.0.1"], "start_port" => 2041, "instance_count" => 3}
haproxy_lwrp_lb "haproxy" do
  global({"maxconn" => 65535, "ulimit-n" => 160000, "user" => "haproxy", "group" => "haproxy", "stats" => "socket /var/run/haproxy.sock mode 0600 level admin user root" })
  defaults({ "log" => "global", "mode" => "http", "option" => "dontlognull", "balance" => "leastconn", "srvtimeout" => 60000, "contimeout" => 5000, "retries" => 3,"option" => "redispatch\noption contstats"})
  listen(listen_temp)
    action :create
end

License and Author

Author:: Scott M. Likens (scott@likens.us)

Copyright:: 2013, Scott M. Likens.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

runit >= 0.0.0

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

2.0.3 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

2.0.3 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
            

2.0.3 failed this metric

FC064: Ensure issues_url is set in metadata: haproxy_lwrp/metadata.rb:1
FC065: Ensure source_url is set in metadata: haproxy_lwrp/metadata.rb:1
FC066: Ensure chef_version is set in metadata: haproxy_lwrp/metadata.rb:1
FC069: Ensure standardized license defined in metadata: haproxy_lwrp/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: haproxy_lwrp/resources/lb.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: haproxy_lwrp/providers/lb.rb:24
FC109: Use platform-specific package resources instead of provider property: haproxy_lwrp/recipes/test_carbontest.rb:9
FC109: Use platform-specific package resources instead of provider property: haproxy_lwrp/recipes/test_haproxy_basictest.rb:9
FC109: Use platform-specific package resources instead of provider property: haproxy_lwrp/recipes/test_haproxy_not_running.rb:9
FC120: Do not set the name property directly on a resource: haproxy_lwrp/recipes/test_haproxy_basictest.rb:27
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

2.0.3 passed this metric

Testing File Metric
            

2.0.3 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
            

2.0.3 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