From 1ce5d87ca04a3c8e3635cfdf8967e68c63f43a8a Mon Sep 17 00:00:00 2001 From: alexppg Date: Tue, 16 Oct 2018 09:27:08 +0200 Subject: [PATCH] Add possiblity to install certbot plugins --- README.md | 16 ++++++++++++++-- tasks/install-from-source.yml | 9 +++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 599ebb0..a4d97a8 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,18 @@ Let's Encrypt supports [generating wildcard certificates](https://community.lets Michael Porter also has a walkthrough of [Creating A Let’s Encrypt Wildcard Cert With Ansible](https://www.michaelpporter.com/2018/09/creating-a-wildcard-cert-with-ansible/), specifically with Cloudflare. +## Install plugins + +Let's Encrypt has some plugins. It's possible to install them, but only if you install from source: + + certbot_install_from_source: true + certbot_plugins: + - dns-route53 + +When usin plugins, you have to execute `cerbot` from path, so you should set a `certbot_create_command` that doesn't use `certbot_script`, as this example: + + "certbot certonly --noninteractive --agree-tos --email {{ cert_item.email | default(certbot_admin_email) }} -d {{ cert_item.domains | join(',') }} --dns-route53" + ## Dependencies None. @@ -88,12 +100,12 @@ None. ## Example Playbook - hosts: servers - + vars: certbot_auto_renew_user: your_username_here certbot_auto_renew_minute: 20 certbot_auto_renew_hour: 5 - + roles: - geerlingguy.certbot diff --git a/tasks/install-from-source.yml b/tasks/install-from-source.yml index daee685..830a530 100644 --- a/tasks/install-from-source.yml +++ b/tasks/install-from-source.yml @@ -15,3 +15,12 @@ file: path: "{{ certbot_script }}" mode: 0755 + +- name: Install plugins + pip: + name: "file://{{ my_certbot_dir}}/certbot-{{ item }}/" + state: present + extra_args: --upgrade + with_items: + - "{{ certbot_plugins }}" + when: certbot_plugins is defined