【发布时间】:2015-03-15 10:30:50
【问题描述】:
问题:
如何让 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'"
【问题讨论】:
标签: yaml ansible ansible-playbook