相关疑难解决方法(0)

在YAML中,如何在多行中断字符串?

在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)

我想使用上面的引号,所以我不需要在字符串中转义任何东西.

string syntax yaml

1388
推荐指数
8
解决办法
58万
查看次数

在Ansible中显示横幅消息

我想在完成运行一本剧本后在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)

ansible

12
推荐指数
1
解决办法
8057
查看次数

标签 统计

ansible ×1

string ×1

syntax ×1

yaml ×1