GithubHelp home page GithubHelp logo

alixaxel / ansible-letsencrypt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thefinn93/ansible-letsencrypt

0.0 3.0 0.0 66 KB

An ansible role to generate TLS certificates and get them signed by Let's Encrypt

License: GNU General Public License v3.0

ansible-letsencrypt's Introduction

ansible-letsencrypt

An ansible role to generate TLS certificates and get them signed by Let's Encrypt.

Currently attempts first to use the webroot authenticator, then if that fails to create certificates, it will use the standalone authenticator. This is handy for generating certs on a fresh machine before the web server has been configured or even installed.

I've tested this on a couple of Debian Jessie boxes with nginx, if you test it on other things please let me know the results (positive or otherwise) so I can document them here/fix the issue.

Requires Ansible >= 2.0

Usage

First, read Let's Encrypt's TOS and EULA. Only proceed if you agree to them.

The following variables are available:

letsencrypt_webroot_path is the root path that gets served by your web server. Defaults to /var/www.

letsencrypt_email needs to be set to your email address. Let's Encrypt wants it. Defaults to webmaster@{{ ansible_fqdn }}.

letsencrypt_rsa_key_size allows to specify a size for the generated key.

letsencrypt_cert_domains is a list of domains you wish to get a certificate for. It defaults to a single item with the value of {{ ansible_fqdn }}.

letsencrypt_install_directory should probably be left alone, but if you set it, it will change where the letsencrypt program is installed.

letsencrypt_renewal_command_args add arguments to the letsencrypt renewal command that gets run using cron. For example, use the renewal hooks to restart a web server.

letsencrypt_standalone_command_args adds arguments to the standalone authentication method. This is mostly useful for specifying supported challenges, such as --standalone-supported-challenges tls-sni-01 to limit the authentication to port 443 if something is already running on 80 or vice versa.

letsencrypt_server sets the alternative auth server if needed. For example, during tests it's set to https://acme-staging.api.letsencrypt.org/directory to use the staging server (far higher rate limits, but certs are not trusted). It is not set by default.

The Let's Encrypt client will put the certificate and accessories in /etc/letsencrypt/live/<first listed domain>/. For more info, see the Let's Encrypt documentation.

Example Playbook

---
 - hosts: tls_servers
   user: root
   roles:
     - role: letsencrypt
       letsencrypt_webroot_path: /var/www/html
       letsencrypt_email: [email protected]
       letsencrypt_cert_domains:
        - www.example.net
        - example.net
       letsencrypt_renewal_command_args: '--renew-hook "systemctl restart nginx"'

ansible-letsencrypt's People

Contributors

aruhier avatar beda42 avatar bpartridge avatar conorsch avatar gelin avatar gled-rs avatar jtdowney avatar martbhell avatar merqlove avatar miohtama avatar pashamesh avatar pmackay avatar rfleschenberg avatar rvben avatar sobolevn avatar thefinn93 avatar thermistor avatar

Watchers

 avatar  avatar  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.