From a61e1b05905007c49626ad6258910da7bc9fc43c Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Mon, 20 Mar 2023 13:08:59 -0500 Subject: [PATCH 1/3] use --system-site-packages and install package to omit building 'netifaces' wheel --- roles/calibre-web/tasks/install.yml | 30 +++++++++++------------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/roles/calibre-web/tasks/install.yml b/roles/calibre-web/tasks/install.yml index 476a426be..36c5da0c5 100644 --- a/roles/calibre-web/tasks/install.yml +++ b/roles/calibre-web/tasks/install.yml @@ -1,19 +1,19 @@ -- name: "Install packages: imagemagick, python3-venv" +- name: "Install packages: imagemagick, python3-venv, python3-netifaces" package: name: - imagemagick - python3-venv + - python3-netifaces state: present # https://github.com/iiab/iiab/pull/3496#issuecomment-1475094542 -- name: "Install packages: python3-dev, gcc to compile 'netifaces'" - package: - name: - - python3-dev # header files - - gcc # compiler - state: present - when: python_version is version('3.10', '>=') - +#- name: "Install packages: python3-dev, gcc to compile 'netifaces'" +# package: +# name: +# - python3-dev # header files +# - gcc # compiler +# state: present +# when: python_version is version('3.10', '>=') - name: Allow ImageMagick to read PDFs, per /etc/ImageMagick-6/policy.xml, to create book cover thumbnails lineinfile: path: /etc/ImageMagick-6/policy.xml @@ -56,7 +56,8 @@ requirements: "{{ calibreweb_venv_path }}/requirements.txt" virtualenv: "{{ calibreweb_venv_path }}" # /usr/local/calibre-web-py3 virtualenv_site_packages: no - virtualenv_command: python3 -m venv {{ calibreweb_venv_path }} + virtualenv_command: python3 -m venv {{ calibreweb_venv_path }} --system-site-packages + # VIRTUALENV EXAMPLE COMMANDS: # cd /usr/local/calibre-web-py3 # source bin/activate @@ -102,15 +103,6 @@ backup: yes when: not appdb.stat.exists -# https://github.com/iiab/iiab/pull/3496#issuecomment-1475094542 -#- name: "Uninstall packages: python3-dev, gcc used to compile 'netifaces'" -# package: -# name: -# - python3-dev # header files -# - gcc # compiler -# state: absent -# when: python_version is version('3.10', '>=') - # RECORD Calibre-Web AS INSTALLED From 4089be6b253b237820f669e11226032f2e82125b Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 16 Apr 2023 08:31:52 -0500 Subject: [PATCH 2/3] always remove old virtual environment --- roles/calibre-web/tasks/install.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/calibre-web/tasks/install.yml b/roles/calibre-web/tasks/install.yml index 36c5da0c5..3c8e4345e 100644 --- a/roles/calibre-web/tasks/install.yml +++ b/roles/calibre-web/tasks/install.yml @@ -22,6 +22,11 @@ line: ' ' state: present +- name: Remove previous virtual environment {{ calibreweb_venv_path }} + file: + path: "{{ calibreweb_venv_path }}" + state: absent + - name: "Create 3 Calibre-Web folders to store data and config files: {{ calibreweb_home }}, {{ calibreweb_venv_path }}, {{ calibreweb_config }} (all set to {{ calibreweb_user }}:{{ apache_user }}) (default to 0755)" file: state: directory From 061a96a5adb85cd490987841ec536b2f612e26e8 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 16 Apr 2023 13:43:16 -0500 Subject: [PATCH 3/3] positional ordering --- roles/calibre-web/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre-web/tasks/install.yml b/roles/calibre-web/tasks/install.yml index 3c8e4345e..7ffb5a32e 100644 --- a/roles/calibre-web/tasks/install.yml +++ b/roles/calibre-web/tasks/install.yml @@ -61,7 +61,7 @@ requirements: "{{ calibreweb_venv_path }}/requirements.txt" virtualenv: "{{ calibreweb_venv_path }}" # /usr/local/calibre-web-py3 virtualenv_site_packages: no - virtualenv_command: python3 -m venv {{ calibreweb_venv_path }} --system-site-packages + virtualenv_command: python3 -m venv --system-site-packages {{ calibreweb_venv_path }} # VIRTUALENV EXAMPLE COMMANDS: # cd /usr/local/calibre-web-py3