Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi,
- 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:
- postfix:
- pkg:
- - installed
- service.running:
- - enable: True
- - require:
- - pkg: postfix
- - watch:
- - file: /etc/postfix/main.cf
- /etc/postfix/main.cf:
- file.managed:
- - name: /etc/postfix/main.cf
- - source: {{ pillar['postfix_main_cf'] }}
- - template: jinja
- - require:
- - pkg: postfix
- pillar top.sls:
- base:
- 'server1*':
- - smtp_relays
- smtp_relays.sls:
- postfix_mynetworks: 127.0.0.0/8 mynetworks = 192.168.0.0/24, 10.0.0.0/8
- postfix_main_cf: salt://postfix/files/main.cf.server
- The output of 'salt server1* pillar.data' shows the pillar values:
- ...
- ...
- 'postfix_main_cf': 'salt://postfix/files/main.cf.server',
- 'postfix_mynetworks': '127.0.0.0/8 mynetworks = 192.168.0.0/24, 10.0.0.0/8'}}
- But when I apply the highstate on the relay minion, I see this error:
- salt-call state.highstate
- ...
- ...
- local:
- Data failed to compile:
- ----------
- Rendering SLS global.postfix failed, render error:
- Traceback (most recent call last):
- File "/usr/lib/python2.6/dist-packages/salt/utils/templates.py", line 99, in jinja
- data = template.render(**passthrough)
- File "/usr/local/lib/python2.6/dist-packages/Jinja2-2.6-py2.6.egg/jinja2/environment.py", line 894, in render
- return self.environment.handle_exception(exc_info, True)
- File "/var/cache/salt/files/base/global/postfix.sls", line 15, in top-level template code
- - source: {{ pillar['postfix_main_cf'] }}
- UndefinedError: 'dict object' has no attribute 'postfix_main_cf'
- salt-master is running 0.10.5, minions 0.10.3 all Debian Squeeze
- Any ideas?
- Thanks in advance
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement