use*_*115 3 yaml ansible ansible-playbook
问题:
如何让 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"
Run Code Online (Sandbox Code Playgroud)
验证通过:
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"
Run Code Online (Sandbox Code Playgroud)
作为参考,这个 YAML 工作得很好:
-shell: "wget 'http://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gzip'"
Run Code Online (Sandbox Code Playgroud)
尝试
- shell: >
/home/developer/eclipse/eclipse
-application org.eclipse.equinox.p2.director
-noSplash
-repository 'http://moreunit.sourceforge.net/update-site'
-installIUs org.moreunit.feature.group
Run Code Online (Sandbox Code Playgroud)
不要相信编辑器或语法荧光笔。让 ansible 告诉您是否有问题(如果需要,请使用 -C 标志运行它以模拟试运行)。还可以尝试在 repo URL 周围用双引号替换单引号。
| 归档时间: |
|
| 查看次数: |
1741 次 |
| 最近记录: |