I am trying to use Ansible on a remote host that has a version of Python 2.4.3 installed. My understanding is that a more recent version of
Python is required to properly use Ansible; however, I should be able to use the “raw” module for such older Python environments. I am able to successfully
use the “raw” module via the ansible CLI; however, when I try to use the raw module via the ansible-playbook CLI I get the following error:
“line 39\r\n with open(module, ‘wb’) as f:\r\n ^\r\nSyntaxError: invalid syntax\r\n”, “msg”: "MODULE FAILURE
Mapped “line 39” to file AnsiballZ_setup.py on the remote host. But surprised the file was invoked given the raw module was being used.
Here is an example of the playbook being tested:
- hosts: servers
remote_user: xxxxx
tasks: - name: simply test to confirm playbook works
raw: /bin/hostname
Any suggestions on how to work around this issue ?