Member-only story

Ansible troubleshooting — Error 104: Deprecated Bare Vars

How to Solve the Ansible Error 104: Deprecated Bare Vars

Luca Berton
4 min readOct 31, 2023

Introduction

Ansible, the popular open-source automation platform, provides a straightforward and efficient way to automate tasks, manage configurations, and orchestrate processes. However, as with any tool, there are best practices to follow and potential pitfalls to avoid. In this article, we will delve into Ansible Error 104, “Deprecated Bare Vars,” which is a rule designed to identify potentially confusing expressions where it’s unclear whether a variable or string should be used. We will explore this error, understand its implications, and learn how to write clean, maintainable Ansible code that adheres to best practices.

The Problem: Deprecated Bare Vars

Ansible Error 104, known as “Deprecated Bare Vars,” is a valuable rule designed to maintain code clarity and consistency. This rule points out situations where it is unclear whether a given expression should be interpreted as a variable or a string. To address this, Ansible encourages users to either use the full variable syntax or convert the expression into a list of strings.

Problematic Code Example:

---
- ansible.builtin.debug:
msg…

--

--

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