I have a custom module with a function that i can use in my states like this
{% set myvar = salt['mymodule.myfunction']() %}
Now I want/need to use it in my pillar. I have tried calling it the same way but I got an error
Jinja variable 'salt.loader.LazyLoader object' has no attribute 'mymodule.myfunction'
Is there any way to declare this module and function as valid in pillar?
Thanks
edit
The actual function is a simple regex to convert the minion ID to a short form of it. I finally implemented the actual functionality with Jinja in both states and pillar, and it works. I want to use it in states and pillar to be able to load a .sls file if it exists to override default setting with per-minion ones.
So my problem is actually solved but the question behind: how to have a (execution) module that can be loaded in states AND pillar, is still relevant i think. I may rename my question.