1.報錯[CRITICAL] Rendering SLS 'base:minions.install' failed: Jinja variable 'list' object has no element 0服務器
執行:ssh
salt-ssh -i '*' state.sls minions.install
以後,報錯:spa
[CRITICAL] Rendering SLS 'base:minions.nosls' failed: Jinja variable 'list' object has no element 0
10.10.10.30:
- Rendering SLS 'base:minions.nosls' failed: Jinja variable 'list' object has no element 0
是由於「minion_id: {{ grains['fqdn_ip4'][0] }}」沒有匹配到IP的緣由code
問題處理:blog
登錄10.10.10.30服務器,修改/etc/hosts文件,綁定主機名和網卡IPip
10.10.10.30 salt.test01.comelement
注:禁止在/etc/hosts文件中綁定主機名salt.test01.com在127.0.0.1上,不然「minion_id: {{ grains['fqdn_ip4'][0] }}」匹配的IP將是127.0.0.1io