Member-only story
Troubleshooting Ansible: Tackling the “Permission Denied Errno 13” Error
Overcoming Hurdles: Resolving the “Permission Denied Errno 13” in Ansible
Introduction
Welcome to another episode of Ansible Pilot! I’m Luca Berton, and today we’re delving into Ansible troubleshooting, focusing on the pesky “Permission Denied Errno 13” error. Join me as we explore the intricacies of this issue, reproduce it in a live demo, and learn how to effectively resolve it using privilege escalation in Ansible Playbooks.
The Demo
Let’s jump right into a live demo to understand how to troubleshoot the Ansible fatal error [Errno 13] Permission denied and fix it in an Ansible Playbook.
Error Code
# permissiondenied_error.yml
---
- name: set environment demo
hosts: all
gather_facts: false
vars:
os_environment:
- key: EDITOR
value: vi
tasks:
- name: customize /etc/environment
ansible.builtin.lineinline:
dest: "/etc/environment"
state: present
regexp: "^{{ item.key }}="
line: "{{ item.key }}={{ item.value }}"
with_items: "{{ os_environment }}"