Virtualbox

鹽堆棧os:...模式在top.sls中不匹配

  • October 23, 2015

我試圖在使用管理的虛擬機中區分我的top.sls文件中的 Ubuntu 框和 Arch 框Virtualbox 5.0.4``vagrant 1.7.4``salt 2015.8.1 (Beryllium)

這不起作用:

base:
   'os:Arch':
       - base.arch

確實有效:

base:
   {% if grains['os'] == 'Arch' %}
   '*':
       - base.arch
   {% endif %}

摘自salt-call grains.items

os:
   Arch
os_family:
   Arch
osarch:
   x86_64
oscodename:
osfullname:
   Arch Linux
osrelease:

有沒有人有任何見解?

這應該有效:

base:
 'os:Arch':
   - match: grain
   - base.arch

請參閱https://docs.saltstack.com/en/latest/ref/states/top.html

引用自:https://serverfault.com/questions/731156