在 env 'base' 中找不到 'dnsinstall.sls' 的匹配 sls

No matching sls found for 'dnsinstall.sls' in env 'base'

我正在使用 salt-stack 设置 DNS 服务器。但是 env=base 在某处出错了

首先,运行加盐'ubuntu'state.apply dnsinstall:

ubuntu:

      ID: install bind9
Function: pkg.installed
    Name: bind9
  Result: True
 Comment: The following packages were installed/updated: bind9
 Started: 02:40:06.590171
Duration: 14219.3 ms
 Changes:   
          ----------
          bind9:
              ----------
              new:
                  1:9.10.3.dfsg.P4-8ubuntu1.15
              old:
          bind9utils:
              ----------
              new:
                  1:9.10.3.dfsg.P4-8ubuntu1.15

旧:

      ID: install bind9utils
Function: pkg.installed
    Name: bind9utils
  Result: True
 Comment: Package bind9utils is already installed
 Started: 02:40:20.816659
Duration: 277.111 ms

改动:

      ID: install bind9_doc
Function: pkg.installed
    Name: bind9-doc
  Result: True
 Comment: The following packages were installed/updated: bind9-doc
 Started: 02:40:21.094023
Duration: 4857.395 ms
 Changes:   
          ----------
          bind9-doc:
              ----------
              new:
                  1:9.10.3.dfsg.P4-8ubuntu1.15
              old:

ubuntu

的摘要

成功:3(更改=2)

失败:0

总状态 运行:3 总 运行 时间:19.354 秒

但是当我第二次 运行 相同的代码时:

ubuntu:

数据编译失败:

No matching SLS found for 'dnsinstall.sls' in env 'base'

我也做了一个file.managed推送到配置文件,也有同样的问题:

quan@quanlm:/srv/salt$ sudo salt '*' state.apply dnsconfig.sls

ubuntu:

Data failed to compile:

No matching sls found for 'dnsconfig.sls' in env 'base'

但是当我尝试运行这一行时:

sudo salt-运行 fileserver.file_list saltenv=base

saltenv=base 包含那些文件

我的dnsconfig.sls

部署配置文件:

file.managed:

- name: /etc/bindnamed.conf.options

- source: salt://named.conf.options

- mode: 644

我的dnsinstall.sls

安装 bind9:

pkg.installed:

- pkgs:

  - bind9

  - bind9utils

  - bind9-doc

哪里错了,我不明白为什么不能正常工作

嗯,这是我的经典 "back from holidays" 错误... 当 运行 命令时,您可能不包含文件扩展名:

No matching SLS found for 'dnsinstall.sls'

我猜你使用了这个命令行:

Salt ubuntu state.apply dnsinstall.sls

什么时候应该使用:

Salt ubuntu state.apply dnsinstall

注意第二个正确的调用中缺少的 .sls。