Example Environmental Cookbook
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
attributes
recipes
test/integration/default
.gitignore
.kitchen.yml
Berksfile
Berksfile.lock
CHANGELOG.md
Gemfile
Gemfile.lock
LICENSE
README.md
Thorfile
Vagrantfile
chefignore
metadata.rb

README.md

website-example-cookbook

Example environmental cookbook for installing a webserver.

Further Reading
The Environment Cookbook Pattern by Jamie Winsor - actually covers all the cookbook patterns Suggested Environment Cookbook folder Structure - ifeltsweet - the whole thread is worth reading

Requirements

Requirement Tested Version
Chef 11.0
Ruby 2.1.1
Ubuntu 14.04

Attributes

General

Example

default['ruby']['version'] = '2.1.1

Attribute Description Default
['rsyslog']['kernel_logging'] If kernel messages are logged. false
['ruby']['version'] Ruby version installed on server '2.1.1'
['nginx']['monit_address'] URL of the monit website 'monit.example.com'
['logstash-forwarder']['hosts'] Logstash service address(es) 'x.x.x.x'

Note

  • OpenVZ has problems logging from the kernel - CPU goes to 100%. Logging should be switched off when running on an OpenVZ server.
  • ip address is a string of the ipv4 format x.x.x.x

Monit

Attributes for configuring monit - an application that polls services to see if they are responding.

Attributes

Attribute Description Default
['monit']['alert_email'] email destination alert@example.com
['monit']['web_interface']['allow'] Web access to server status. <user_name>:

Example

node['monit']['web_interface']['allow'] = %w(user:secret)

  • note: without this set you cannot perform `monit status

Firewall

Using iptables to provide the firewall. website-cookbook, which this cookbook wraps, calls bcs_simple_iptables::default which is in turn a wrapper for simple_iptables.

Attributes

Attribute Description Default
['simple_iptables']['admin_ip'] ip source for admin traffic x.x.x.x
['simple_iptables']['interface'] Interface the firewall is on 'eth0'
['simple_iptables']['out_forwarder_dest'] logstash service ip address x.x.x.x
['simple_iptables']['dns'] Allowed dns ip addresses x.x.x.x
['simple_iptables']['smtp'] Allowed smtp ip addresses x.x.x.x

Example

default['simple_iptables']['dns'] = %w{ 208.67.222.222 208.69.38.205 }

Usage

website-example::default

Include website-example in your node's run_list:

{
  "run_list": [
    "recipe[website-example::default]"
  ]
}

License and Authors

Author:: Richard Wigley (richard.wigley@github)