问题:
如何使Ansible YAML解析接受此命令?
详细信息如下:
这个YAML:
-shell: "/home/developer/eclipse/eclipse -application org.eclipse.equinox.p2.director -noSplash -repository
'http://moreunit.sourceforge.net/update-site' -installIUs
org.moreunit.feature.group"由下列机构验证:
http://yaml-online-parser.appspot.com/
http://www.yamllint.com/
http://codebeautify.org/yaml-validator
但是ansible说:
This one looks easy to fix. It seems that there is a value started
with a quote, and the YAML parser is expecting to see the line ended
with the same kind of quote. For instance:
when: "ok" in result.stdout
Could be written as:
when: '"ok" in result.stdout'
or equivalently:
when: "'ok' in result.stdout"作为参考,YAML的工作原理非常完美:
-shell: "wget 'http://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gzip'"发布于 2015-03-15 16:53:01
试一试
- shell: >
/home/developer/eclipse/eclipse
-application org.eclipse.equinox.p2.director
-noSplash
-repository 'http://moreunit.sourceforge.net/update-site'
-installIUs org.moreunit.feature.group不要信任编辑器或语法高亮器。让ansible告诉您是否有问题(如果您愿意,可以使用-C标志来模拟试运行)。此外,尝试用双引号代替单引号围绕回购URL。
https://stackoverflow.com/questions/29059605
复制相似问题