# command/shell tasks Results in Failures with the Use of action

**URL:** <https://forum.ansible.com/t/command-shell-tasks-results-in-failures-with-the-use-of-action/12854>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [May 23, 2013, 2:10am UTC](https://forum.ansible.com/t/command-shell-tasks-results-in-failures-with-the-use-of-action/12854 "2013-05-23T02:10:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [May 23, 2013, 2:10am UTC](https://forum.ansible.com/t/command-shell-tasks-results-in-failures-with-the-use-of-action/12854/1 "2013-05-23T02:10:34Z")

</div>

‘shell:’ and ‘action: shell’ should be interchangable, this seems like a bug.

I’ve been able to reproduce, seems like a quoting issue.

using shell:

- name: Touch Foobar  
shell: “touch /tmp/foobar”

changed: [127.0.0.1] =\> {“changed”: true, “cmd”: "touch /tmp/foobar ", “delta”: “0:00:00.022968”, “end”: “2013-05-22 22:05:50.451941”, “rc”: 0, “start”: “2013-05-22 22:05:50.428973”, “stderr”: “”, “stdout”: “”}

using action: shell

- name: Touch Foobar  
action: shell “touch /tmp/foobar”

failed: [127.0.0.1] =\> {“changed”: true, “cmd”: ""touch /tmp/foobar" ", “delta”: “0:00:00.008091”, “end”: “2013-05-22 22:05:51.235269”, “rc”: 127, “start”: “2013-05-22 22:05:51.227178”}

stderr: /bin/sh: touch /tmp/foobar: No such file or directory

using action: shell and no quotes:

- name: Touch Foobar  
action: shell touch /tmp/foobar

changed: [127.0.0.1] =\> {“changed”: true, “cmd”: "touch /tmp/foobar ", “delta”: “0:00:00.009709”, “end”: “2013-05-22 22:08:05.562070”, “rc”: 0, “start”: “2013-05-22 22:08:05.552361”, “stderr”: “”, “stdout”: “”}

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 23, 2013, 2:30am UTC](https://forum.ansible.com/t/command-shell-tasks-results-in-failures-with-the-use-of-action/12854/2 "2013-05-23T02:30:03Z")

</div>

While I agree it would be nice if these unnecessary quotes are stripped automatically by the system, this it he first I’ve seen it come up, so I’m not extremely worried by it.

It’s definitely not anything new.

Basically if something takes multiple arguments, and you quote them, it makes those things “one argument”.

That is a little bit different than quoting the whole options line, which is just telling YAML “hey this is all one string”, which is generally implicit unless you have a colon in there.
