Advertisement
Guest User

Untitled

a guest
Nov 21st, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. Hi,
  2.  
  3. I am using a jinja template to configure our smtp relays and clients (non-relays) differently for /etc/postfix/main.cf. My postfix state file looks like this:
  4.  
  5. postfix:
  6. pkg:
  7. - installed
  8.  
  9. service.running:
  10. - enable: True
  11. - require:
  12. - pkg: postfix
  13. - watch:
  14. - file: /etc/postfix/main.cf
  15.  
  16. /etc/postfix/main.cf:
  17. file.managed:
  18. - name: /etc/postfix/main.cf
  19. - source: {{ pillar['postfix_main_cf'] }}
  20. - template: jinja
  21. - require:
  22. - pkg: postfix
  23.  
  24.  
  25. pillar top.sls:
  26.  
  27. base:
  28. 'server1*':
  29. - smtp_relays
  30.  
  31.  
  32. smtp_relays.sls:
  33.  
  34. postfix_mynetworks: 127.0.0.0/8 mynetworks = 192.168.0.0/24, 10.0.0.0/8
  35. postfix_main_cf: salt://postfix/files/main.cf.server
  36.  
  37.  
  38. The output of 'salt server1* pillar.data' shows the pillar values:
  39. ...
  40. ...
  41. 'postfix_main_cf': 'salt://postfix/files/main.cf.server',
  42. 'postfix_mynetworks': '127.0.0.0/8 mynetworks = 192.168.0.0/24, 10.0.0.0/8'}}
  43.  
  44.  
  45. But when I apply the highstate on the relay minion, I see this error:
  46.  
  47. salt-call state.highstate
  48.  
  49. ...
  50. ...
  51. local:
  52. Data failed to compile:
  53. ----------
  54. Rendering SLS global.postfix failed, render error:
  55. Traceback (most recent call last):
  56. File "/usr/lib/python2.6/dist-packages/salt/utils/templates.py", line 99, in jinja
  57. data = template.render(**passthrough)
  58. File "/usr/local/lib/python2.6/dist-packages/Jinja2-2.6-py2.6.egg/jinja2/environment.py", line 894, in render
  59. return self.environment.handle_exception(exc_info, True)
  60. File "/var/cache/salt/files/base/global/postfix.sls", line 15, in top-level template code
  61. - source: {{ pillar['postfix_main_cf'] }}
  62. UndefinedError: 'dict object' has no attribute 'postfix_main_cf'
  63.  
  64.  
  65. salt-master is running 0.10.5, minions 0.10.3 all Debian Squeeze
  66.  
  67. Any ideas?
  68.  
  69. Thanks in advance
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement