Advertisement
Guest User

Untitled

a guest
Aug 14th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. #pillar structure: ##########################################################
  2. networking:
  3. - eth0:
  4. - ip: 192.168.22.42
  5. - netmask: 255.255.255.0
  6. - gateway: 192.168.22.1
  7. - dns-nameservers: 192.168.22.1
  8.  
  9.  
  10. #networking file salt://files/debian-network-interfaces ###################################
  11. auto lo
  12. iface lo inet loopback
  13.  
  14. auto eth0
  15. iface eth0 inet static
  16. address {{ pillar['networking']['eth0']['ip'] }}
  17. netmask {{ pillar['networking']['eth0']['netmask'] }}
  18. gateway {{ pillar['networking']['eth0']['gateway'] }}
  19. dns-nameservers {{ pillar['networking']['eth0']['dns-nameservers'] }}
  20.  
  21.  
  22.  
  23. # networking.sls STATE ##########################################################
  24.  
  25. networking-file:
  26. file.managed:
  27. - name: /etc/network/interfaces
  28. - source: salt://files/debian-network-interfaces
  29. - template: jinja
  30.  
  31. restart-interfaces:
  32. cmd.wait:
  33. - name: /etc/init.d/networking restart
  34. - cwd: /
  35. - watch:
  36. - file: networking-file
  37.  
  38.  
  39.  
  40.  
  41. #### ERROR : ##############################################
  42.  
  43. State: - file
  44. Name: /etc/network/interfaces
  45. Function: managed
  46. Result: False
  47. Comment: Traceback (most recent call last):
  48. File "/usr/lib/python2.6/dist-packages/salt/utils/templates.py", line 63, in render_tmpl
  49. output = render_str(tmplstr, context, tmplpath)
  50. File "/usr/lib/python2.6/dist-packages/salt/utils/templates.py", line 116, in render_jinja_tmpl
  51. output = jinja_env.from_string(tmplstr).render(**context)
  52. File "/usr/lib/pymodules/python2.6/jinja2/environment.py", line 891, in render
  53. return self.environment.handle_exception(exc_info, True)
  54. File "<template>", line 6, in top-level template code
  55. File "/usr/lib/pymodules/python2.6/jinja2/environment.py", line 352, in getitem
  56. return obj[argument]
  57. UndefinedError: 'list object' has no attribute 'eth0'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement