Member-only story

Troubleshooting Ansible: Tackling the “Permission Denied Errno 13” Error

Overcoming Hurdles: Resolving the “Permission Denied Errno 13” in Ansible

Luca Berton
4 min readDec 17, 2023

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 }}"

--

--

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