To be honest, we're running this playbook out of Tower, so I'm not sure why its choosing the server it is to generate the report via the template module. Is there a way I can tell it to use the Ansible control node?
Thanks, Harry On Monday, September 20, 2021 at 1:31:56 PM UTC-4 [email protected] wrote: > I dont think the issue is with your remote RHEL79. > But rather from the host you are running the play from. > Because you are using "connection: local", your localhost is responding on > behalf of your remote. > check the python path on your localhost; there are chances it doesnt have > python2 but only python3. > the question left is why does your ansible uses python2 as interpreter by > default ? which version of ansible are you on ? > Thx. > > Le vendredi 17 septembre 2021 à 06:42:20 UTC+2, rajthecomputerguy a écrit : > >> Use Verbose -vvv to see more details on error >> >> On Thursday, September 16, 2021 at 5:59:08 PM UTC+5:30 [email protected] >> wrote: >> >>> 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 >>> >> -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/deba3f2e-4d6c-4450-a5ae-af73465c2ec5n%40googlegroups.com.
