Add option to install from pypi

This commit is contained in:
Wayne Warren 2019-05-23 13:32:14 +00:00
parent 7efc6a50f5
commit aebb3e4ee1
3 changed files with 47 additions and 1 deletions

View File

@ -27,6 +27,8 @@ certbot_create_standalone_stop_services:
# - apache
# - varnish
certbot_pypi_version: latest
# To install from source (on older OSes or if you need a specific or newer
# version of Certbot), set this variable to `yes` and configure other options.
certbot_install_from_source: false

View File

@ -0,0 +1,25 @@
---
- name: Install latest Certbot from pypi
when:
- certbot_pypi_version == "latest"
pip:
name: "{{ item }}"
state: latest
with_items:
- certbot
- certbot-nginx
- name: Install latest Certbot from pypi
when:
- certbot_pypi_version != "latest"
pip:
name: "{{ item }}"
state: present
version: "{{ certbot_pypi_version }}"
with_items:
- certbot
- certbot-nginx
- name: Set Certbot script variable.
set_fact:
certbot_script: "/usr/local/bin/certbot"

View File

@ -1,11 +1,26 @@
---
- import_tasks: include-vars.yml
tags:
- certbot
- import_tasks: install-with-package.yml
when: not certbot_install_from_source
when:
- not certbot_install_from_source
- not certbot_install_from_pypi
tags:
- certbot
- import_tasks: install-from-source.yml
when: certbot_install_from_source
tags:
- certbot
- import_tasks: install-from-pypi.yml
when:
- not certbot_install_from_source
- certbot_install_from_pypi
tags:
- certbot
- include_tasks: create-cert-standalone.yml
with_items: "{{ certbot_certs }}"
@ -14,6 +29,10 @@
- certbot_create_method == 'standalone'
loop_control:
loop_var: cert_item
tags:
- certbot
- import_tasks: renew-cron.yml
when: certbot_auto_renew
tags:
- certbot