相关疑难解决方法(0)

在ansible lineinfile中引用

当我lineinfile在ansible中使用它不是写字',"字符 lineinfile: 'dest=/home/xyz state=present line="CACHES="default""'

它是给予,CACHES=default 但所需的输出是CACHES="default"

怎么做到这一点?

ansible ansible-playbook

15
推荐指数
2
解决办法
5万
查看次数

Ruby:将转义字符串写入YAML

下列...

require 'yaml'
test = "I'm a b&d string"
File.open('test.yaml', 'w') do |out|
  out.write(test.to_yaml)
end
Run Code Online (Sandbox Code Playgroud)

......输出......

--- this is a b&d string
Run Code Online (Sandbox Code Playgroud)

我怎样才能输出它

--- 'this is a b&d string'
Run Code Online (Sandbox Code Playgroud)

???

ruby string yaml escaping

7
推荐指数
2
解决办法
2万
查看次数

标签 统计

ansible ×1

ansible-playbook ×1

escaping ×1

ruby ×1

string ×1

yaml ×1