我正在使用Salt,我必须在文件中添加一些文本,经过一些研究后我发现你可以使用file.append
模块来实现。
我在文件中添加[text]
之类的内容时遇到错误:
failed: could not found expected ':';at line x
州是:
file.append:
- text: |
blah blah blah
[SSL] <====================== Here is where it complains
blah blah
我应该尝试使用[
转义\
字符之前或之后如何做到这一点?
答案 0 :(得分:1)
问题是你的缩进。映射值必须缩进多于其键:
file.append:
- text: |
blah blah blah
[SSL]
blah blah