feat: add option to customize virtualenv
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Robert Kaussow 2021-06-12 17:43:27 +02:00
parent 34fa40dbc2
commit a01ebed87c
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 12 additions and 9 deletions

View File

@ -5,6 +5,9 @@
# @var certbot_packages_extra:description: Extra packages to install with pip (e.g. DNS plugins).
certbot_packages_extra: []
certbot_virtualenv_command: /usr/bin/python3 -m venv
certbot_virtualenv: /opt/python3/certbot
certbot_user: root
certbot_work_dir: /var/lib/letsencrypt

View File

@ -10,8 +10,8 @@
- name: Upgrade python dependencies
pip:
name: "{{ item }}"
virtualenv: /opt/python3/certbot
virtualenv_command: /usr/bin/python3 -m venv
virtualenv: "{{ certbot_virtualenv }}"
virtualenv_command: "{{ certbot_virtualenv_command }} -m venv"
extra_args: --upgrade
loop:
- pip
@ -20,8 +20,8 @@
- name: Install dependencies
pip:
name: "{{ item }}"
virtualenv: /opt/python3/certbot
virtualenv_command: /usr/bin/python3 -m venv
virtualenv: "{{ certbot_virtualenv }}"
virtualenv_command: "{{ certbot_virtualenv_command }} -m venv"
environment:
TMPDIR: /opt/python3/tmp
loop: "{{ certbot_packages_extra }}"
@ -29,20 +29,20 @@
- name: Install certbot
pip:
name: "{{ item }}"
virtualenv: /opt/python3/certbot
virtualenv_command: /usr/bin/python3 -m venv
virtualenv: "{{ certbot_virtualenv }}"
virtualenv_command: "{{ certbot_virtualenv_command }} -m venv"
loop: "{{ __certbot_packages }}"
- name: Adjust file permissions
file:
name: /opt/python3/certbot
name: "{{ certbot_virtualenv }}"
recurse: True
mode: u+rwX,go+rX,go-w
state: directory
- name: Make certbot binaries executable
file:
name: "/opt/python3/certbot/bin/{{ item }}"
name: "{{ certbot_virtualenv }}/bin/{{ item }}"
mode: 0755
loop: "{{ __certbot_binaries }}"

View File

@ -1,4 +1,4 @@
#!/usr/bin/env sh
set -eo pipefail
exec /opt/python3/certbot/bin/{{ item }} "$@"
exec {{ certbot_virtualenv }}/bin/{{ item }} "$@"