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


cloudflare (7) Versions 0.1.0

Registers your server with Cloudflare's DNS service

cookbook 'cloudflare', '= 0.1.0', :supermarket
cookbook 'cloudflare', '= 0.1.0'
knife supermarket install cloudflare
knife supermarket download cloudflare
Quality -%


This Chef! cookbook defines one LWRP that you can easily use in your own cookbook to create and delete Cloudflare DNS records.

It is built on top of B4k3r's Ruby wrapper for the Cloudflare API. (


Requires Chef-client version 11.x or later.


To be able to use the clouflare_dns_record resource, you must define two nodes attributes: ['cloudflare']['credentials']['email'] and ['cloudflare']['credentials']['api_key'].

I strongly recommend storing your Cloudflare credentials in an encrypted data bag, and then decrypting them in your own cookbook.


To use the clouflare_dns_record resource in your own cookbook, simply tell Chef! that your cookbook depends on this one, by adding depends 'cloudflare' in your metadata.rb file.

clouflare_dns_record Resource

This resource defines the following attributes (they're all Strings unless otherwise specified):

  • name (required): the name of the Chef! resource. It is also the name of the DNS record, unless the record_name attribute is set
  • record_name (optional): as said above, you can set that attribute to override the name of the DNS record (useful for registering several records with the same name - e.g. in different zones - during the same Chef! run)
  • zone (required): the zone of the DNS record
  • content (optional - defaults to node.ipaddress): the content of the DNS record
  • type (one of 'A' or 'CNAME' - defaults to 'A'): the type of the DNS record. Please let me know if you'd like other record types supported
  • ttl (must be a Fixnum - defaults to 1, which, according to Cloudflare doc, means 'automatic'): the ttl of the DNS record

For instance, the following code in your cookbook's recipe would create an A DNS record pointing to with an automatic TTL:

cloudflare_dns_record 'server_name' do
    zone ''
    content ''

The clouflare_dns_record resource defines two different actions: :create and :delete (pretty self-explanatory); :create is the default one.

Another example:

cloudflare_dns_record 'resource_name' do
    zone ''
    record_name 'server_name'
    action :delete

would delete the record from your Cloudflare account.


  • 0.1.0 (Oct 3, 2013)
    • Initial release

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

No quality metric results found