CSSCorp / openstack-automation

Openstack deployment using saltstack
GNU General Public License v2.0
73 stars 44 forks source link

Jinja variable 'dict object' has no attribute 'install'; line 2 #1

Closed gstaicu closed 10 years ago

gstaicu commented 10 years ago

Hello,

Really nice work. Thank you. I am trying to test the automatically deployment of openstack using salt but I receive an error: On one of the minion: root@hawk:~# salt-call state.highstate -l debug the message is: local:

Data failed to compile:

Traceback (most recent call last):

File "/usr/lib/pymodules/python2.7/salt/state.py", line 2349, in call_highstate top = self.get_top() File "/usr/lib/pymodules/python2.7/salt/state.py", line 1926, in get_top tops = self.get_tops() File "/usr/lib/pymodules/python2.7/salt/state.py", line 1809, in get_tops env=env File "/usr/lib/pymodules/python2.7/salt/template.py", line 69, in compile_template ret = render(input_data, env, sls, **render_kwargs) File "/usr/lib/pymodules/python2.7/salt/renderers/jinja.py", line 42, in render tmp_data.get('data', 'Unknown render error in jinja renderer') SaltRenderError: Jinja variable 'dict object' has no attribute 'install'; line 2


havana: {% for cluster_component in pillar['install'] %} <====================== {% for server in pillar[cluster_component] %} {{ server }}: {% for sls in pillar['install'][cluster_component] %}

On the salt-master I configured: file_roots: base:

The project I put in /srv/havana

Thanks a lot, Gabriel

Akilesh1597 commented 10 years ago

I need some more information to tell exactly why this is happenning. First what is the salt id of your machines on which you are trying to install. The reason why I ask this is There is a 'top.sls' file in the pillar roots. That maps salt id to their pillar file. The pillar file are the ones where all the dictionary items have been defined. So i would say your pillar dictionary is not updated because it is not pointed to the correct pillar file.

On Sun, Dec 22, 2013 at 2:33 AM, gstaicu notifications@github.com wrote:

Hello,

Really nice work. Thank you. I am trying to test the automatically deployment of openstack using salt but I receive an error: On one of the minion: root@hawk:~# salt-call state.highstate -l debug the message is: local: Data failed to compile:

Traceback (most recent call last):

File "/usr/lib/pymodules/python2.7/salt/state.py", line 2349, in call_highstate top = self.get_top() File "/usr/lib/pymodules/python2.7/salt/state.py", line 1926, in get_top tops = self.get_tops() File "/usr/lib/pymodules/python2.7/salt/state.py", line 1809, in get_tops env=env File "/usr/lib/pymodules/python2.7/salt/template.py", line 69, in compile_template ret = render(input_data, env, sls, **render_kwargs) File "/usr/lib/pymodules/python2.7/salt/renderers/jinja.py", line 42, in render tmp_data.get('data', 'Unknown render error in jinja renderer') SaltRenderError: Jinja variable 'dict object' has no attribute 'install';

line 2

havana: {% for cluster_component in pillar['install'] %} <====================== {% for server in pillar[cluster_component] %} {{ server }}: {% for sls in pillar['install'][cluster_component] %}

  • {{ sls }} {% endfor %} [...]

On the salt-master I configured: file_roots: base:

  • /srv/salt/ havana:
  • /srv/havana/file pillar_roots: base:
  • /srv/pillar havana:
  • /srv/havana/pillar

The project I put in /srv/havana

Thanks a lot, Gabriel

— Reply to this email directly or view it on GitHubhttps://github.com/CSSCorp/openstack-automation/issues/1 .

Akilesh1597 commented 10 years ago

Sorry for delay. I need some more information to tell exactly why this is happening. First what is the salt id of your machines on which you are trying to install. The reason why I ask this is There is a 'top.sls' file in the pillar roots. That maps salt id to their pillar file. The pillar file are the ones where all the dictionary items have been defined. So i would say your pillar dictionary is not updated because it is not pointed to the correct pillar file.

Akilesh1597 commented 10 years ago

Please use the latest formulas