Member-only story

Ansible Troubleshooting: Unraveling the “Not a Valid Attribute for a Play” Error

How to reproduce, troubleshoot, and fix the “not a valid attribute for a Play” error.

Luca Berton
4 min readDec 9, 2023

Introduction

In today’s episode of Ansible Pilot, I’m Luca Berton, and we’ll be diving into Ansible troubleshooting, focusing on the infamous “not a valid attribute for a Play” error. This error can be a stumbling block for many, but fear not — I’ll guide you through reproducing, troubleshooting, and fixing this issue.

Unveiling the Error in a Live Demo

The most effective way to explore Ansible troubleshooting is through a live demonstration. Let’s reproduce the “not a valid attribute for a Play” error and walk through the steps to resolve it.

Error Code: invalid_play_attribute_error.yml

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

Error Execution

--

--

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