saltstack-formulas / monit-formula

Set up and configure the Monit http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
MIT License
5 stars 12 forks source link

email pillar is mandatory ? #3

Open arthurzenika opened 7 years ago

arthurzenika commented 7 years ago

I have the following pillar :

  mail_alert:
    account:
      server: stmp.example.org
    users:
      - contact@example.org

and I get

----------
          ID: /etc/monit/conf.d/mail
    Function: file.managed
      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 1733, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1653, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/states/file.py", line 1655, in managed
                  **kwargs
                File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 3974, in check_managed_changes
                  **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 3640, in get_managed
                  **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 178, in render_tmpl
                  output = render_str(tmplstr, context, tmplpath)
                File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 386, in render_jinja_tmpl
                  buf=tmplstr)
              SaltRenderError: Jinja variable 'salt.utils.odict.OrderedDict object' has no attribute 'email'

add email, I end up with the same traceback for password. What if my smtp does not need authentication ?

waynegemmell commented 6 years ago

I have the same issue where authentication seems to be enforced by not being able to omit the email and password. This is quite annoying and the jinja doesn't seem to be written in a way that should enforce the authentication.