FAILED! => {"changed": false, "msg": "TemplateNotFound: anVweXRlcmh1YkRvY2tlcmh1YmNvbmZpZ2pzb24uajI="}

I want to create a k8s resource with operator-sdk in ansible model. in my application, I want to {%include%} a template jupyterhubDockerhubconfigjson.j2 with same location of my based one.
liking this :

data:
.dockerconfigjson: “{% include “jupyterhubDockerhubconfigjson.j2” |b64encode %}”

However, when I add the b64encode action, it will fail. How could I encode its(a json configure file) content

You are including “jupyterhubDockerhubconfigjson.j2” |b64encode, which is “anVweXRlcmh1YkRvY2tlcmh1YmNvbmZpZ2pzb24uajI=”.
Remove the b64encode filter?

In fact, I want to add the encode here, if I remove it, it will be OK

在 2020年4月7日星期二 UTC+8下午7:14:36,Dick Visser写道:

“anVweXRlcmh1YkRvY2tlcmh1YmNvbmZpZ2pzb24uajI=” is the “jupyterhubDockerhubconfigjson.j2”
在 2020年4月7日星期二 UTC+8下午7:20:19,胡雷雷写道:

Without more context it’s mostly guessing, but you might be looking for this:

https://docs.ansible.com/ansible/latest/plugins/lookup/template.html

Thanks, I used the function, it could import the template content.

Some background:
I want to create the secret resource in k8s cluster, which included the docker config json file. the json will could be modified with some pre-defined vars(I write this part to a template file.)

在 2020年4月7日星期二 UTC+8下午7:46:46,Dick Visser写道: