Saltstack "Malformed topfile" with GitFS

349 views Asked by At

I'm trying to get Saltstack working with GitFS integration on Debian Squeeze. Salt master and minions are running and GitFS works via GitPython (pip install 'GitPython==0.3.2.RC1').

Issue: I receive the error message Malformed topfile (state declarations not formed as a list) when requesting the top file via salt-call -l debug state.show_top. However, if i clone the repository locally and use fileserver_backend: roots it works fine.

Some debugging code:

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

There are 1 answers

0
Enrico Stahn On BEST ANSWER

It appears the issue is related to the nodegroups. After some debugging in the salt source code the following turned up:

[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)

After changing the nodegroup to use a list, everything worked fine.