【发布时间】:2018-07-24 11:53:57
【问题描述】:
在 /srv/salt/pillar/servers.sls 中有这个结构
servers:
# Monitors
- m1:
- roles: [ monitor ]
- ips: [ 192.168.0.1 ]
- b2:
- roles: [ monitor ]
- ips: [ 192.168.0.2 ]
# BPs
- w2:
- roles:
- webserver:
- type: [ apache ]
- ips: [ 192.168.0.3 ]
我想在我的 top.sls 文件中使用该信息。
如何选择例如具有监控角色的服务器?或者是 apache 类型的服务器?
base:
'*':
- common
{% Filter the servers that have the rol monitor %}
- mon
{% endfor %}
{% Filter the servers that have the type apache %}
- web_apache
{% endfor %}
【问题讨论】:
标签: salt-stack