【发布时间】:2019-08-22 12:53:36
【问题描述】:
我需要在 yml 中创建一些具有 ansible 角色的配置文件。这个例子我想要什么:
filebeat.inputs:
- type: log
paths:
- /var/log/system.log
- /var/log/wifi.log
在模板目录中的 ansible 目录结构中,我有包含此类文本的文件:
filebeat.inputs:
- type: {{filebeat_input.type}}
{{ filebeat_input.paths | to_yaml}}
在目录默认值中,我有这样的 main.yml: filebeat_create_config: true
filebeat_input:
type: log
paths:
- "/var/log/*.log"
- "/var/somelog/*.log"
当 im run ansible-playbook with this role im 得到这个时:
filebeat.inputs:
- type: log
[/var/log/*.log, /var/sdfsadf]
我哪里错了?我需要改变什么和在哪里得到我想要的(见上面的例子)。 感谢您的帮助!
【问题讨论】: