‘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”: “”}