--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/IJo6Z8Hro2w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Unable to manage file: Jinja error: argument of type 'StrictUndefined' is not iterabl
While running the salt call.
Iam using salt minion. if i rerun it again ,it will dissapear.
ID: /opt/inmob/conf/cosmos-config/1.0.6/uat.py
Function: file.managed
Result: False
Comment: Unable to manage file: Jinja error: argument of type 'StrictUndefined' is not iterable
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 306, in render_jinja_tmpl
output = template.render(**decoded_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 1, in top-level template code
File "/usr/lib/python2.7/dist-packages/salt/utils/jinja.py", line 105, in get_source
if '..' in template:
TypeError: argument of type 'StrictUndefined' is not iterable
; line 1
---
{% import_yaml pillar['cosmos-settings'] as cosmos_settings %} <======================
{% set colo = salt['environ.get']('IDP_CLUSTER') %}
{% set environment = salt['environ.get']("IDP_ENVIRONMENT") %}
{% set ENV = salt['environ.get']%}
{% set cosmos = cosmos_settings[environment][colo]["cosmos"]["app"] %}
{% set hostname = salt['cmd.run']('hostname') %}
[...]
---
Started: 18:30:08.330336
Duration: 178.846 ms
Changes:
this is the full erro i am getting. Can you have a look ?
sudo -E /usr/bin/salt-call --file-root=/srv/salt/cosmos-django state.highstate -l debug --local pillar='{"cosmos-config":"cosmos-config.json","cosmos-settings":"cosmos-settings.json"}'
is there anything wrong ?
--
You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/IJo6Z8Hro2w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{{conf_dir}}/{{config}}/{{configs[config]["version"]}}/{{environment}}.py:
file:
- managed
- source: {{conf_dir}}/{{config}}/{{configs[config]["version"]}}/active.py
- template: jinja
- user: root
- group: root
- mode: 644
My commands is
sudo -E /usr/bin/salt-call --file-root=/srv/salt/cosmos-django state.highstate -l debug --local pillar='{"cosmos-config":"cosmos-config.json","cosmos-settings":"cosmos-settings.json"}'
Inside {{conf_dir}}/{{config}}/{{configs[config]["version"]}}/active.py file how should i reference to the cosmos-settings.json .
Myobservations is it is failing for first time installtion and then succeesding.
this is the error iam getting for first time.
File "/usr/lib/python2.7/dist-packages/salt/states/file.py", line 1459, in managed
**kwargs
File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 2841, in get_managed
**kwargs)
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 121, in render_tmpl
output = render_str(tmplstr, context, tmplpath)
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 324, in render_jinja_tmpl
buf=tmplstr)
SaltRenderError: Jinja variable 'dict object' has no attribute 'cosmos-settings'
Could you have a look into it ?
/srv/salt/cosmos-django/cosmos-django/init.sls.
iam setting the files root in command
sudo -E /usr/bin/salt-call --file-root=/srv/salt/cosmos-django state.highstateighstate -l debug --local pillar='{"cosmos-config":"cosmos-config.json","cosmos-settings":"cosmos-settings.json"}'
My pilaar json is at
/srv/salt/cosmos-django/cosmos-settings.json
Is that all rite ?
File "/usr/lib/python2.7/dist-packages/salt/states/file.py", line 1459, in managed
**kwargs
File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 2841, in get_managed
**kwargs)
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 121, in render_tmpl
output = render_str(tmplstr, context, tmplpath)
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 324, in render_jinja_tmpl
buf=tmplstr)
SaltRenderError: Jinja variable 'dict object' has no attribute 'cosmos-settings'