Saltstack"格式错误的topfile"与GitFS

时间:2015-11-29 02:00:50

标签: salt-stack gitfs

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

问题:通过Malformed topfile (state declarations not formed as a list)请求顶级文件时收到错误消息salt-call -l debug state.show_top。但是,如果我在本地克隆存储库并使用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

1 个答案:

答案 0 :(得分:0)

问题似乎与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以使用列表后,一切正常。