mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
Add option to install from pypi
This commit is contained in:
parent
7efc6a50f5
commit
aebb3e4ee1
@ -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
|
||||
|
25
tasks/install-from-pypi.yml
Normal file
25
tasks/install-from-pypi.yml
Normal 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"
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user