Brincando com citações, recebi finalmente uma mensagem de erro útil. Aparentemente, você irá confundir o analisador YAML a menos que você cite toda a linha .
Aqui está o exemplo de trabalho:
---
- hosts: localhost
tasks:
- raw: "echo 'something: else'"
register: progOutput
- debug:
msg: "something else happened!"
when: 'progOutput.stdout_lines[-1] != "something: else"'
E aqui está a mensagem de erro útil:
ERROR! Syntax Error while loading YAML.
The error appears to have been in '<snip>/test.yml': line 4, column 28, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
tasks:
- raw: "echo 'something\: else'"
^ here
This one looks easy to fix. There seems to be an extra unquoted colon in the line
and this is confusing the parser. It was only expecting to find one free
colon. The solution is just add some quotes around the colon, or quote the
entire line after the first colon.
For instance, if the original line was:
copy: src=file.txt dest=/path/filename:with_colon.txt
It can be written as:
copy: src=file.txt dest='/path/filename:with_colon.txt'
Or:
copy: 'src=file.txt dest=/path/filename:with_colon.txt'