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

**URL:** <https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617>\
**Category:** Ansible Project\
**Tags:** kubernetes\
**Created:** [April 7, 2020, 11:03am UTC](https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617 "2020-04-07T11:03:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![user9](https://avatars.discourse-cdn.com/v4/letter/u/ebca7d/32.png) [@user9](https://forum.ansible.com/u/user9)\
**Post date:** [April 7, 2020, 11:03am UTC](https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617/1 "2020-04-07T11:03:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 7, 2020, 11:14am UTC](https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617/2 "2020-04-07T11:14:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![user9](https://avatars.discourse-cdn.com/v4/letter/u/ebca7d/32.png) [@user9](https://forum.ansible.com/u/user9)\
**Post date:** [April 7, 2020, 11:20am UTC](https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617/3 "2020-04-07T11:20:19Z")

</div>

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写道：

---

<div class="post-metadata">

**Author:** ![user9](https://avatars.discourse-cdn.com/v4/letter/u/ebca7d/32.png) [@user9](https://forum.ansible.com/u/user9)\
**Post date:** [April 7, 2020, 11:21am UTC](https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617/4 "2020-04-07T11:21:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 7, 2020, 11:46am UTC](https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617/5 "2020-04-07T11:46:16Z")

</div>

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

[https://docs.ansible.com/ansible/latest/plugins/lookup/template.html](https://docs.ansible.com/ansible/latest/plugins/lookup/template.html)

---

<div class="post-metadata">

**Author:** ![user9](https://avatars.discourse-cdn.com/v4/letter/u/ebca7d/32.png) [@user9](https://forum.ansible.com/u/user9)\
**Post date:** [April 8, 2020, 5:49am UTC](https://forum.ansible.com/t/failed-changed-false-msg-templatenotfound-anvwexrlcmh1ykrvy2tlcmh1ymnvbmzpz2pzb24uaji/32617/6 "2020-04-08T05:49:47Z")

</div>

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写道：
