Skip to content

Cloudflare module to manage DNS entries for puppet clients

Notifications You must be signed in to change notification settings

jurgenweber/puppet-cloudflare

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

puppet-cloudflare

CloudFlare Puppet Module

Module Installation

  • Add the 'cloudflare' folder into your module path
  • Include the class and configure the relevant variables for your CloudFlare account:

EXAMPLE

You need to declare this at the top of your class so the defines can use these details at will:

class { 'cloudflare':
  cloudflare_email => "$cloudflare_email",
  cloudflare_tkn   => "$cloudflare_tkn",
}

Add a DNS Record

  cloudflare::add { 'sub.domain.com':
    domain           => 'domain.com/sub.domain.com',
    destination      => 'target.domain.com',
    type             => 'cname',
    proxy            => true,
    ttl              => 1,
    require          => Class['cloudflare'],
  }

Edit a DNS Record - placeholder class in progress

  cloudflare::edit { 'sub.domain.com':
  }

Delete a DNS record - not finished - use with care

  cloudflare::delete { 'sub.domain.com':
    domain           => 'domain.com/sub.domain.com',
    require          => Class['cloudflare'],
  }

Puppet usage example

  if $add_dns {
    # Declare Cloudflare credentials
    $cloudflare_email = password_lookup("cloudflare_email", 'global')
    $cloudflare_tkn   = password_lookup("cloudflare_tkn", 'global')

    # Pass Cloudflare credentials
    class { 'cloudflare':
      cloudflare_email => "$cloudflare_email",
      cloudflare_tkn   => "$cloudflare_tkn",
    }

    # Add the sub.doamin.com
    cloudflare::add { 'sub.domain.com':
      domain           => 'domain.com/sub.domain.com',
      destination      => 'target.domain.com',
      type             => 'cname',
      proxy            => true,
      ttl              => 1,
      require          => Class['cloudflare'],
    }
  }

Riaan Nolan and Jürgen Weber

About

Cloudflare module to manage DNS entries for puppet clients

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Puppet 100.0%