Code Monkey home page Code Monkey logo

ansible-letsencrypt-cloudflare's Introduction

Build Status

LetsEncrypt-Cloudflare

This role simplifies the process of renewing LetsEncrypt Certificates when utilising Cloudflare as a DNS provider.

Requirements

  • Python >= 2.6
  • OpenSSL (will automatically be installed if supported)

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml for many more variables that can be modified)

Required Fields:

letsencrypt_email: ""
cloudflare_email: ""
cloudflare_api_key: "" # 'Global' API key for specified Cloudflare account
cloudflare_domain: "" # Cloudflare hosted DNS zone for entries to be created under

Important Notes:

By default, the role will use the inventory hostname as the Common Name to request a certificate, and place all generated/recieved certificate files in /etc/ssl/[Certificate Common Name], and all LetsEncrypt account files in /etc/ssl/lets_encrypt. These paths can all be overridden (see defaults/main.yml).

Furthermore, the certificate files can also be copied and renamed to another location after generation, by modifying any of the following variables:

copy_csr_full_path: ""
copy_crt_full_path: ""
copy_key_full_path: ""
copy_intermediate_full_path: "" # Requires include_intermediate set to 'yes'
copy_fullchain_full_path: "" # Requires include_intermediate set to 'yes'

The role also defaults to using the "staging" letsencrypt endpoints which will generate functionally correct yet untrusted certificates. In order to generate valid certificates, set:

letsencrypt_production: yes

Generated files can be removed after use by specifying the following variable:

cleanup_all: yes

Example Playbook

- hosts: servers
  tasks:
    - name: Renew/Download new SSL certificates
      include_role:
        name: letsencrypt-cloudflare
      vars:
        letsencrypt_email: "[email protected]"
        cloudflare_email: "[email protected]"
        cloudflare_domain: "abc.com"
        cloudflare_api_key: "AAABBBCCCDDDEEE111222333"
        letsencrypt_production: yes
        include_intermediate: yes

TODO:

  • Add support for multiple CN's

License

MIT

Author Information

Created in 2017 by Ben Dews

ansible-letsencrypt-cloudflare's People

Contributors

bendews avatar mkletz avatar siramikvase avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.