Member-only story

FATAL template error while templating string — Ansible troubleshooting

How to reproduce, troubleshoot, and fix the “FATAL template error while templating string” Ansible runtime error.

Luca Berton
3 min readSep 21, 2021

Today we’re going to talk about Ansible troubleshooting and specifically about the “FATAL template error while templating string” error.

I’m Luca Berton and welcome to today’s episode of Ansible Pilot

demo

The best way of talking about Ansible troubleshooting is to jump in a live demo to show you practically the FATAL template error while templating string” error and how to solve it!

  • template_error_string_error.yml
---
- name: file module demo
hosts: all
vars:
myfile: "{{ ~/example.txt }}"
tasks:
- name: Creating an empty file
ansible.builtin.file:
path: "{{ myfile }}"
state: touch

output

$ ansible-playbook -i demo/inventory troubleshooting/template_error_string_error.ymlPLAY [file module demo]…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet