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). # @var certbot_packages_extra:description: Extra packages to install with pip (e.g. DNS plugins).
certbot_packages_extra: [] certbot_packages_extra: []
certbot_virtualenv_command: /usr/bin/python3 -m venv
certbot_virtualenv: /opt/python3/certbot
certbot_user: root certbot_user: root
certbot_work_dir: /var/lib/letsencrypt certbot_work_dir: /var/lib/letsencrypt

View File

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

View File

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