Puppet Cloudflare

Cloudflare is a provider of CDN, Security, DNS and other infrastructure services. We utilize cloudflare not only to speed things up but also to serve our DNS records.

Cloudkick, who we use to use as our monitor server until Rackspace aquired them, had an great feature that created DNS records on-the-fly each time a new VM was spun up. Now that Cloudkick is no longer, we wanted to still be able to implement that same functionality but using CloudFlare. Luckily Cloudflare provides for this feature through their API. We utilize their API calls to create a new A Record in the DNS each time new instance is spun up.

Get the Module

Module Installation

  • Add the 'cloudflare' folder into your module path
  • Include the class and configure the relevant variables for your CloudFlare account:
  • email - your cloudflare email
  • tkn - found under Your Account > API key: https://www.cloudflare.com/my-account
  • domain - the domain for which your managing

EXAMPLE

class { 'cloudflare':
email => 'xxxxx@xxxxxxx.com',
tkn  => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
domain  => 'www.yourdomain.com',
}

Add a DNS Record

class{'cloudflare::dns':
rec_type => "A",
recname => "$hostname",
}
blog comments powered by Disqus
· By: