# SyntaxError with local\_action

**URL:** <https://forum.ansible.com/t/syntaxerror-with-local-action/14674>\
**Category:** Ansible Project\
**Created:** [February 28, 2014, 11:24am UTC](https://forum.ansible.com/t/syntaxerror-with-local-action/14674 "2014-02-28T11:24:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehul\_Ved](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mehul\_Ved](https://forum.ansible.com/u/Mehul_Ved)\
**Post date:** [February 28, 2014, 11:24am UTC](https://forum.ansible.com/t/syntaxerror-with-local-action/14674/1 "2014-02-28T11:24:16Z")

</div>

I was following rsync example from [https://github.com/ansible/ansible/pull/2508](https://github.com/ansible/ansible/pull/2508) to recursively transfer files. I added following lines to my tasks

1. 
  - name: copy generic config files for freeswitch

2. sudo: no

3. local\_action: command rsync -a files/conf root@{{ ansible\_ssh\_host }}:/usr/local/share/freeswitch/

It gave me following error:

> invalid output was: File “/home/mehul/.ansible/tmp/ansible-1393604508.71-11919565258498/command”, line 475
> 
> except OSError, e:
> 
> ^
> 
> SyntaxError: invalid syntax
> 
> FATAL: all hosts have already failed – aborting

I get the same error even if I change the local action to:

> local\_action: command echo “foo”
> 
> local\_action: shell echo “foo”

% python --version  
Python 2.7.6

% pip freeze ☹  
Jinja2==2.7.2  
MarkupSafe==0.18  
MySQL-python==1.2.5  
PyYAML==3.10  
ansible==1.4.4  
ansible-shell==0.0.2  
ecdsa==0.10  
epdb==0.12  
httplib2==0.8  
paramiko==1.12.1  
pycrypto==2.6.1  
wsgiref==0.1.2

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 28, 2014, 2:02pm UTC](https://forum.ansible.com/t/syntaxerror-with-local-action/14674/2 "2014-02-28T14:02:26Z")

</div>

That’s curious.

If you still see this on the development branch, please file a bug on github at [github.com/ansible/ansible](http://github.com/ansible/ansible) with steps to reproduce.
