No matching sls found for 'php-apps' in env 'base'

那年仲夏 提交于 2019-12-23 04:43:34

问题


I have the following saltstack top file.

  'blog.php.*':
    - php-apps
    - php-apps.blog

  'app.php.*':
    - php-apps
    - php-apps.some-app

  '*phpone*':
    - php-apps
    - php-apps.blog
    - php-apps.some-app

When I run high state for the above to environments It works fine. like this

salt 'blog.php.*' state.highstate or salt 'app.php.*' state.highstate

But when I run the same for the third server it fails.

salt '*phpone*' state.highstate

Error:

No matching sls found for 'php_apps' in env 'base'

I went to the minion server and found that the init.sls file in php-apps is not being copied over to minion cache location /var/cache/salt/minion/files/base/php-apps

I am not able to find any logs of state file having any compilation error which could cause this.

I tried the following but It still does not work.

  • Cleared master cache
  • Cleared minion cache
  • Recreated minion from scratch

What am I missing? Please let me know if any other information is required.


回答1:


First , I will use yaml validator to validate the yaml meta structure. i.e.. install kwalify

#install kwalify
sudo apt-get install kwalify
# Now try to check the top file with yaml meta-validation 
kwalify -m top.sls 
# to check many yaml sls file
find . | grep "sls"  | xargs   kwalify -m 

Don't be surprised when salt doesn't verify the most basic meta structure.

Because saltstack using YAML, it also suffer from tab vs space indentation issues, if you didn't force your editor to convert all TABS to fix spaces.



来源:https://stackoverflow.com/questions/35778890/no-matching-sls-found-for-php-apps-in-env-base

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!