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

pgbouncer (1) Versions 1.0.0

Installs/Configures pgbouncer

Policyfile
Berkshelf
Knife
cookbook 'pgbouncer', '~> 1.0.0', :supermarket
cookbook 'pgbouncer', '~> 1.0.0'
knife supermarket install pgbouncer
knife supermarket download pgbouncer
README
Dependencies
Quality 0%

PGBouncer Cookbook Build Status

This cookbook provides a Chef LWRP that sets up
a basic PGBouncer connection pool that
fronts a Postgresql database. It has example configuration for integration on client machines,
exposing a local *nix socket that routes to a downstream database on another host.

Requirements

Chef 0.7+

Platform

Tested:
* Ubuntu

Untested:
* Debian (should work)
* RHEL, Centos, etc

Dependencies

'apt' cookbook

Resources/Providers

This cookbook exposes a single resource/provider pair, referred as pgbouncer_connection. A basic
example of its use can be found in recipes/example.rb, and is outlined below.

pgbouncer_connection

Sets up an Upstart service for pgbouncer against a single database alias, then starts the service.
Multiple aliases may be supported on a single host.

Actions

  • :setup: configure a pgbouncer service for the specified database alias (default action)
  • :start: start the configured pgbouncer service
  • :stop: stop the configured pgbouncer service
  • :teardown: delete the configuration (FIXME: may not be comprehensive)

Examples

# setup and start a read-only connection pool
pgbouncer_connection "database_example_com_ro" do
  db_host "database.example.com"
  db_port "6432"
  db_name "test_database"
  userlist "readonly_user" => "md500000000000000000000000000000000"
  max_client_conn 100
  default_pool_size 20
  action [:setup, :start]
end

# setup and start a read-write connection pool
pgbouncer_connection "database_example_com_rw" do
  db_host "database.example.com"
  db_port "6432"
  db_name "test_database"
  userlist "readwrite_user" => "md500000000000000000000000000000000", "readonly_user" => "md500000000000000000000000000000000"
  max_client_conn 100
  default_pool_size 20
  action [:setup, :start]
end

# stop a connection pool
pgbouncer_connection "database_example_com_ro" do
  action :stop
end

# TODO: include more examples

Recipes

default

Empty: this is a resource-only cookbook

example

Example of how to use the resource; also exercised in the spec/ tests

Testing

This cookbook has been "Tested in Production"™, but also has some basic RSpec tests.

NOTE: because Chef 10 has cookbook naming expectations, the root repo expects to be in a folder
named 'pgbouncer'.

  bundle install
  bundle exec rake spec

The cookbook is clean under FoodCritic.

  bundle install
  bundle exec rake foodcritic

To see the installation end to end, we've also got a rake task that spins up a chef-zero
local instance, uploads the cookbooks via berkshelf, and spins up a vagrant instance that pulls the data down. This is using a new
Vagrant plugin, created here at Whitepages, called vagrant-chefzero.

  vagrant plugin install vagrant-chefzero
  bundle install
  bundle exec rake vagrant_startup

License and Author(s)

Copyright 2010-2013, Whitepages Inc.

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

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

1.0.0 failed this metric

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

Contributing File Metric
            

1.0.0 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
            

1.0.0 failed this metric

FC064: Ensure issues_url is set in metadata: pgbouncer/metadata.rb:1
FC065: Ensure source_url is set in metadata: pgbouncer/metadata.rb:1
FC066: Ensure chef_version is set in metadata: pgbouncer/metadata.rb:1
FC069: Ensure standardized license defined in metadata: pgbouncer/metadata.rb:1
FC085: Resource using new_resource.updated_by_last_action to converge resource: pgbouncer/providers/connection.rb:128
FC085: Resource using new_resource.updated_by_last_action to converge resource: pgbouncer/providers/connection.rb:143
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

1.0.0 failed this metric

Failure: Cookbook should not contain binaries. Found:
pgbouncer/test/Berksfile

Testing File Metric
            

1.0.0 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
            

1.0.0 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