john.david.r.smith
unread,Feb 10, 2017, 10:18:06 AM2/10/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to qubes-users
hi.
i wrote some custom salt module and use it for rendering in my top-file.
everything works great as long as i am only in dom0.
as soon as my stuff is run in domU (or rather its management-vm) i get errors:
when rendering:
/var/tmp/.root_62a99a_salt/running_data/var/cache/salt/minion/files/base/top.jinja
i get an error in line 77:
77: {%- load_yaml as single_top -%}
78: {% include top %}
79: {%- endload -%}
this is the place where my top file is included.
after including the file, rendering it as yaml fails.
after adding some outputs to jinja i was able to see my rendered top file.
the line it complains about is:
{'retcode': 0, '_error': 'Failed to return clean data', 'stderr': "'my.function' is not available.", 'stdout': ''}
the original call is:
{{ salt['my.function'](yaml=yaml, grains=grains) }}
the error suggests:
when my top file is included in top.jinja, no custom salt modules are used.
this seems to be a bug.
how can i fix this?
i could add some wrapper around it and do rendering for domu using jinja, but this is kind of cumbersome.
this is also only possible since my function only does very little in domu.
furthermore this would prevent me from doing more complex stuff in domu in the future (currently it is not planned, but maybe i want to do such stuff in the future).
so i am interested in a way to fix the rendering (so it correctly uses the custom module).
-john