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.
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