I have the following task that fails:
- name: restore dependencies via pipenv
shell: /home/{{ ansible_user }}/.local/bin/pipenv install
args:
executable: /bin/bash
chdir: "{{ app_dir }}"
environment:
LC_ALL=C.UTF-8
LANG=C.UTF-8
with the following message:
RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/en/7.x/python3/ for mitigation steps.
This system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the following environment variables:
export LC_ALL=C.UTF-8 export LANG=C.UTF-8
What surprises me is the environment is set at the task level.
Furthermore, the command runs OK when I ssh into the machine and perform the operation manually.