Saltstack "Malformed topfile" 与 GitFS

Saltstack "Malformed topfile" with GitFS

我正在尝试让 Saltstack 在 Debian Squeeze 上与 GitFS 集成一起工作。 Salt master 和 minions 是 运行,GitFS 通过 GitPython (pip install 'GitPython==0.3.2.RC1') 工作。

问题: 我在通过 salt-call -l debug state.show_top 请求顶级文件时收到错误消息 Malformed topfile (state declarations not formed as a list)。但是,如果我在本地克隆存储库并使用 fileserver_backend: roots 它工作正常。

一些调试代码:

root@/# salt-call -l debug state.show_top
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Configuration file path: /etc/salt/minion
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Mako not available
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Reading configuration from /etc/salt/minion
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[INFO    ] Loading fresh modules for state activity
[DEBUG   ] Fetching file from saltenv 'development', ** attempting ** 'salt://top.sls'
[INFO    ] Fetching file from saltenv 'base', ** skipped ** latest already in cache 'salt://top.sls'
[DEBUG   ] Jinja search path: ['/var/cache/salt/minion/files/base']
[DEBUG   ] Rendered data from file: /var/cache/salt/minion/files/base/top.sls:
base:
  '*':
    - system.test

production:
  'N@aws':
    - match: compound
    - system

  'N@aws and G@roles:redis':
    - match: compound
    - redis.server

  # TODO:
  'N@aws and G@roles:queue':
    - match: compound
    - rabbitmq

  # TODO:
  'N@aws and G@roles:cronmaster':
    - match: compound
    - php.ng.cli

  # TODO:
  'N@aws and G@roles:consumer':
    - match: compound
    - php.ng.cli

  'N@aws and G@roles:app_bob':
    - match: compound
    - app.bob

  'N@aws and G@roles:app_alice':
    - match: compound
    - app.alice

  'N@aws and G@roles:mysql':
    - match: compound
    - mysql

development:
  'vagrant':
    - devtools
    - redis.server
    - mysql
    - solr
    - app.bob
    - app.alice

nodegroup:
  aws: 'G@provider:aws'
  avnet: 'G@provider:avnet'

[DEBUG   ] Results of YAML rendering:
OrderedDict([('base', OrderedDict([('*', ['system.test'])])), ('production', OrderedDict([('N@aws', [OrderedDict([('match', 'compound')]), 'system']), ('N@aws and G@roles:redis', [OrderedDict([('match', 'compound')]), 'redis.server']), ('N@aws and G@roles:queue', [OrderedDict([('match', 'compound')]), 'rabbitmq']), ('N@aws and G@roles:cronmaster', [OrderedDict([('match', 'compound')]), 'php.ng.cli']), ('N@aws and G@roles:consumer', [OrderedDict([('match', 'compound')]), 'php.ng.cli']), ('N@aws and G@roles:app_bob', [OrderedDict([('match', 'compound')]), 'app.bob']), ('N@aws and G@roles:app_alice', [OrderedDict([('match', 'compound')]), 'app.alice']), ('N@aws and G@roles:mysql', [OrderedDict([('match', 'compound')]), 'mysql'])])), ('development', OrderedDict([('vagrant', ['devtools', 'redis.server', 'mysql', 'solr', 'app.bob', 'app.alice'])])), ('nodegroup', OrderedDict([('aws', 'G@provider:aws'), ('avnet', 'G@provider:avnet')]))])
[DEBUG   ] LazyLoaded .returner
[DEBUG   ] Decrypting the current master AES key
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
local:
    - Malformed topfile (state declarations not formed as a list)
    - Malformed topfile (state declarations not formed as a list)
root@/srv# salt-call --versions-report
           Salt: 2014.7.1
         Python: 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
         Jinja2: 2.5.5
       M2Crypto: 0.20.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.1.0
        libnacl: Not Installed
         PyYAML: 3.09
          ioflo: Not Installed
          PyZMQ: 13.1.0
           RAET: Not Installed
            ZMQ: 3.2.3
           Mako: Not Installed

问题似乎与 nodegroups 有关。在 salt 源代码中进行一些调试后,出现以下结果:

[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
local:
    - G@provider:aws
    - Malformed topfile (state declarations not formed as a list)
    - G@provider:avnet
    - Malformed topfile (state declarations not formed as a list)

nodegroup 更改为使用列表后,一切正常。