We have a playbook that uses a jinja2 template to prepare a report and email us. For some reason, the template module is failing. Here's what I'm calling in my playbook:
- name: Prepare report
template:
src: templates/yum_output.txt.j2
dest: /tmp/yum_output.txt
connection: local
run_once: true
It tries to generate the report on the first host in our play, and fails as follows:
Failed to get information on remote file (/tmp/yum_output.txt): /bin/sh: /usr/bin/python: No such file or directory
On that server, which is RHEL 7.9, python 2.7.5 is installed at /bin/python, and /usr/bin/python is symbolically linked to /usr/bin/python2, which is symbolically linked to /usr/bin/python2.7.
So why would this happen and how can we fix that?
Thanks,
Harry