Search code examples
salt-project

Salt can't parse files any more: Requisite declaration... is not formed as a single key dictionary


About two-month-old sls files are working no more. I've tried to put the minimal example below:

salt 'myserver.internal' state.highstate gave:

myserver.internal:
    Data failed to compile:
----------
    Requisite declaration dhparam in SLS nginx is not formed as a single key dictionary

----------
    Requisite declaration /etc/nginx/sites-available/myapp.conf in SLS nginx is not formed as a single key dictionary
ERROR: Minions returned with non-zero exit code

with the following nginx.sls:

/etc/nginx/sites-available/myapp.conf:
  file.managed:
    - name: /etc/nginx/sites-available/myapp.conf
    - source: salt://nginx-myapp.conf.jinja
    - template: jinja
    - require:
      - dhparam

dhparam:
  cmd:
    - run
    - name: "mkdir -p /etc/nginx/ssl/; openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048"
    - unless: ls /etc/nginx/ssl/dhparam.pem

And there are tens of those errors when I run the whole configuration. Am I missing something? Maybe, some crucial dependency not installed/updated/broken? yamllint did not find any problems in my SLS files. Same files worked well on another server two months ago.

Versions:

salt-master 2016.11.6+ds-1

salt-minion 2015.8.8+ds-1

The system is Ubuntu Xenial 16.04.2 LTS on both master and minion.


Solution

  • The problem is the version of the minion. While I added repo key for saltstack, I forgot to add

    deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/latest xenial main 
    

    to /etc/apt/sources.list.d/saltstack.list and run apt update before installing salt-minion.

    When I corrected that, files started to work again.