saltstack-formulas / bind-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
29 stars 117 forks source link

Jinja syntax error in /etc/default/bind9 #46

Closed matthew-parlette closed 8 years ago

matthew-parlette commented 8 years ago

I believe this showed up in #45, but I now get this when running this state with test = True (though I don't think that matters):

----------
          ID: bind_default_config
    Function: file.managed
        Name: /etc/default/bind9
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1591, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/dist-packages/salt/states/file.py", line 1446, in managed
                  **kwargs
                File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 3694, in check_managed_changes
                  **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 3393, in get_managed
                  **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 180, in render_tmpl
                  output = render_str(tmplstr, context, tmplpath)
                File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 376, in render_jinja_tmpl
                  tmplstr)
              SaltRenderError: Jinja syntax error: Encountered unknown tag 'param'. Jinja was looking for the following tags: 'elif' or 'else' or 'endif'. The innermost block that needs to be closed is 'if'.; line 4

              ---
              {% set protocol = salt['pillar.get']('bind:config:protocol', False) -%}
              {% set param = ['-u bind'] -%}
              {% if protocol -%}
                {%- param.append('-' + protocol|string) -%}    <======================
              {% endif -%}
              # run resolvconf?
              RESOLVCONF=no

              # startup options for the server
              [...]
              ---
     Started: 16:56:08.504971
    Duration: 39.773 ms
     Changes:   
----------

I just upgraded from 2015.5.2 to 2015.8.1:

$ sudo salt-master --version
salt-master 2015.8.1 (Beryllium)
$ sudo salt-minion --version
salt-minion 2015.8.1 (Beryllium)