Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ceph:
- osd.0:
- host: ubun1
- devs: /dev/hihi
- mon.a:
- host: ubun1
- ods.1:
- host: ubun2
- devs: /dev/h2
- In [32]: data['ceph']
- Out[32]:
- {'mon.a': {'host': 'ubun1'},
- 'ods.1': {'devs': '/dev/h2', 'host': 'ubun2'},
- 'osd.0': {'devs': '/dev/hihi', 'host': 'ubun1'}}
- {% for i in pillar['ceph'] %}
- [{{ pillar[i] }}]
- {% if i.startswith('mon') %}
- host = {{ pillar['ceph'][i]['host'] }}
- mon addr = {{ pillar['ceph'][i]['ip'] }}:6789
- {% elif i.startswith('osd') %}
- host = {{ pillar['ceph'][i]['host'] }}
- devs = {{ pillar['ceph'][i]['devs'] }}
- {% elif i.startswith('mds') %}
- host = {{ pillar['ceph'][i]['host'] }}
- {% endif %}
- {% endfor %}
- State: - file
- Name: /etc/ceph/ceph.conf
- Function: managed
- Result: False
- Comment: Traceback (most recent call last):
- File "/usr/lib/pymodules/python2.7/salt/utils/templates.py", line 55, in render_tmpl
- output = render_str(tmplstr, context, tmplpath)
- File "/usr/lib/pymodules/python2.7/salt/utils/templates.py", line 98, in render_jinja_tmpl
- output = jinja_env.from_string(tmplstr).render(**context)
- File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render
- return self.environment.handle_exception(exc_info, True)
- File "<template>", line 12, in top-level template code
- UndefinedError: 'dict object' has no attribute 'mon.a'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement