在YAML中,我有一个非常长的字符串.我想将它保留在我的编辑器的80列(或左右)视图中,所以我想打破字符串.这是什么语法?
换句话说,我有这个:
Key: 'this is my very very very very very very long string'
Run Code Online (Sandbox Code Playgroud)
我想要这个(或者这个效果):
Key: 'this is my very very very ' +
'long string'
Run Code Online (Sandbox Code Playgroud)
我想使用上面的引号,所以我不需要在字符串中转义任何东西.
我想在完成运行一本剧本后在Ansible中显示一条横幅信息,并提供下一步的说明.这就是我所做的:
- name: display post install message
debug:
msg: |
Things left to do:
- enable dash to dock gnome plugin in gnome tweal tool
- install SpaceVim plugins: vim "+call dein#install()" +qa
- git clone the dotfiles repo
Run Code Online (Sandbox Code Playgroud)
但这会产生如下丑陋的输出:
TASK [display post install message] ********************************************
ok: [localhost] => {
"msg": "Things left to do:\n- enable dash to dock gnome plugin in gnome tweal tool\n- install SpaceVim plugins: vim \"+call dein#install()\" +qa\n- git clone the dotfiles repo\n"
}
PLAY RECAP …Run Code Online (Sandbox Code Playgroud)