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

时间:2019-09-20 03:12:50

标签: salt-stack

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

首先,以盐“ ubuntu”状态运行。应用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 s

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

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-run fileserver.file_list saltenv = base

  • dnsconfig.sls

  • dnsinstall.sls

  • named.conf.options

saltenv = base包含那些文件

我的dnsconfig.sls

部署配置文件:

file.managed:

- name: /etc/bindnamed.conf.options

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

- mode: 644

我的dnsinstall.sls

安装bind9:

已安装pkg:

- pkgs:

  - bind9

  - bind9utils

  - bind9-doc

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

1 个答案:

答案 0 :(得分:0)

?好吧,这是我经典的“假期归来”错误... 运行命令时,您可能不包含文件扩展名:

No matching SLS found for 'dnsinstall.sls'

我猜您使用了以下命令行:

Salt ubuntu state.apply dnsinstall.sls

何时应使用:

Salt ubuntu state.apply dnsinstall

请注意第二个正确的呼叫中缺少的.sls。