首页 新闻 会员 周边

salt pillar使用问题

0
[待解决问题]

我使用salt管理2个机房,在pillar中定义了zone数据,比如hexi(河西机房)、hedong(河东机房),我在部署prometheus监控时想根据zone来定义对应配置文件,逻辑如下,测试报错语法格式不对,请问这种方法是否可行,要如何编写?谢谢。

prometheus.sls

{% if {{ pillar['zone'] }} == 'hexi' %}
{% set prometheis_config_file = 'prometheus.yml.hexi' %}
{% elif {{ pillar['zone'] }} == 'hedong' %}
{% set prometheis_config_file = 'prometheus.yml.hedong' %}
{% endif %}

xylonxiang的主页 xylonxiang | 菜鸟二级 | 园豆:202
提问于:2020-04-20 15:04
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册