Giter Site home page Giter Site logo

ansible-acme-nginx's Introduction

ansible-acme-nginx

Sets up SSL certificate signed by Let's Encrypt using acme-tiny

Features

  • Uses acme-tiny for better code auditability.
  • Doesn't run acme-tiny as root.
  • Provides an nginx snippet that is easily included in your configs for challenges.
  • Automatically renew certificates every 30 days.

Requirements

  • Ansible 2.0+
  • A working nginx installation. Recommended role: ansible-nginx.

Usage

First of all, look at comments in vars/main.yml for details on how each variable works. This is how your role invocation will look like:

- hosts: webserver
  roles:
    - role: ansible-acme-nginx
      acme_ssl_base_folder: /opt/mysslstuff
      acme_challenges_folder_path: "{{ ssl_base_folder }}/challenges"
      acme_domains:
        - example.com
        - www.example.com

This role should be ran before you provision your website, otherwise, you won't have your SSL certs available.

Preferably, before you run this role, you have a fully configured-and-running nginx that is configured with a "catchall" configuration that answers to ACME challenges locations (make sure that it points to our acme_challenges_folder_path, where we'll actually meet the challenges!).

The ansible-nginx role does that with minimal configuration.

However, catchall configs have lower priority than your more specific server blocks, that is why you'll need to change your nginx config for every site to include the acme_well_known.conf snippet that is also create by this role and placed in /etc/nginx/snippets. You can see an example in my ansible-wordpress role. This snippet adds a location pointing to acme_challenges_folder_path. With this snippet in place, you won't ever need to shutdown your webserver in order to answer your ACME challenge.

The principle is: if your website has never been provisioned before, our catch all nginx conf is there to answer ACME challenges. Otherwise, in case of regular cert updates, it your website's nginx conf's responsibility to answer ACME challenge, which is done easily by including the provided snippet.

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.