jonaswinkler / paperless-ng

A supercharged version of paperless: scan, index and archive all your physical documents
https://paperless-ng.readthedocs.io/en/latest/
GNU General Public License v3.0
5.37k stars 355 forks source link

[BUG] Ansible Installation fails at "get commit for target tag" task #1545

Open moxli opened 2 years ago

moxli commented 2 years ago

Describe the bug

I am trying to install Paperless NG with Ansible. The installation fails at the step "get commit for target tag" with the following error:

"You need to install \"jmespath\" prior to running json_query filter"

I tried to install jmespath on the target manually (pip3 install jmespath) but the error still persists, probably due to the use a virtualenv.

To Reproduce Steps to reproduce the behavior:

  1. Install Paperless through Ansible Galaxy: ansible-galaxy install git+https://github.com/jonaswinkler/paperless-ng.git,ng-1.5.0
  2. Run the Ansible playbook
  3. The error occurs

Expected behavior

The installation goes through.

Screenshots N.A.

Webserver logs

TASK [paperless-ng : get commit for target tag] ******************************************************************************
fatal: [10.0.0.24]: FAILED! => {"msg": "You need to install \"jmespath\" prior to running json_query filter"}

Ansible Playbook

- hosts: 10.0.0.24
  become: yes
  gather_facts: True
  vars_files:
    - vars/paperless-ng-vars.yml
  roles:
    - paperless-ng

Ansible Vars

ansible_python_interpreter: /usr/bin/python3

paperlessng_secret_key: <removed>

paperlessng_superuser_name: <removed>
paperlessng_superuser_email: <removed>
paperlessng_superuser_password: <removed>

paperlessng_ocr_languages:
    - eng
    - deu

Relevant information

C0nsultant commented 2 years ago

Hey @moxli, sorry for the late reply. I don't hang around here all that often anymore. The code for checking the GH tags is indeed run on the ansible target host, but the contained ansible substitutions that require jmespath are run on the ansible control node. You should be able to solve this problem by installing jmespath in the python environment you're running your playbook from.

On a sidenote, I just stood up your setup (Debian Bullseye as ansible controller and Ubuntu 20.04 as ansible target) and was not able to reproduce the problem. :shrug: