On 03/25/2014 04:11 PM, Mehul Ved wrote:
> Hi,
>   I am using ansible 1.4.4. I get SyntaxError when running synchronize plugin.
>
> Here's the playbook entry
>
>   - name: create common folders
>     synchronize: src=s dest=/etc/ssh
>
>
>
> Here's the error that I get
>
> failed: [play] => {"failed": true, "item": "", "parsed": false}
> invalid output was:   File
> "/home/mehul/.ansible/tmp/ansible-1395752291.48-66351699093462/synchronize",
> line 556
>     except OSError, e:
>                   ^
> SyntaxError: invalid syntax
>
>
> FATAL: all hosts have already failed -- aborting
>
>
>
> I get the same error when running synchronize module using ansible command 
> line
>
> $ ansible -i hosts web -m synchronize -a "src=ssh dest=/tmp/ssh"
> play | FAILED >> {
>     "failed": true,
>     "msg": "  File
> \"/home/mehul/.ansible/tmp/ansible-1395752376.63-279538261866126/synchronize\",
> line 556\n    except OSError, e:\n                  ^\nSyntaxError:
> invalid syntax\n",
>     "parsed": false
> }
>
>
>
> Ansible is installed in virtualenv
>
> $ which python
> /home/mehul/apps/lsdeploy/venv/bin/python
>
> $ python --version
> Python 2.7.6
>
> $ which ansible
> /home/mehul/apps/lsdeploy/venv/bin/ansible
>
> $ ansible --version
> ansible 1.4.4
>
The syntax error you get could be caused by a python 3 interpreter being
used at the target machine instead of python 2. This is a common error
when running ansible on target machines running Archlinux because the
default python interpreter (at /usr/bin/python) on Arch is actually the
python3 interpreter. In these cases you should set the
"ansible_python_interpreter" variable for the affected hosts to the
correct path ("/usr/bin/python2" for archlinux).

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5331931F.2010806%40yahoo.gr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to